Class TransportRegistry


  • public class TransportRegistry
    extends java.lang.Object
    Class to cache CA transports (connections to other hosts).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear cache.
      Transport[] get​(java.net.InetSocketAddress address)
      Lookup for a transport for given address (all priorities).
      Transport get​(java.net.InetSocketAddress address, int priority)
      Lookup for a transport for given address.
      int numberOfActiveTransports()
      Get number of active (cached) transports.
      void put​(java.net.InetSocketAddress address, Transport transport)
      Cache new (address, transport) pair.
      Transport remove​(java.net.InetSocketAddress address, int priority)
      Remove (address, transport) pair from cache.
      Transport[] toArray()
      Get array of all active (cached) transports.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TransportRegistry

        public TransportRegistry()
    • Method Detail

      • put

        public void put​(java.net.InetSocketAddress address,
                        Transport transport)
        Cache new (address, transport) pair.
        Parameters:
        address - address of the host computer.
        transport - tranport to the host computer.
      • get

        public Transport get​(java.net.InetSocketAddress address,
                             int priority)
        Lookup for a transport for given address.
        Parameters:
        address - address of the host computer.
        priority - priority of the transport.
        Returns:
        corresponding transport, null if none found.
      • get

        public Transport[] get​(java.net.InetSocketAddress address)
        Lookup for a transport for given address (all priorities).
        Parameters:
        address - address of the host computer.
        Returns:
        array of corresponding transports, null if none found.
      • remove

        public Transport remove​(java.net.InetSocketAddress address,
                                int priority)
        Remove (address, transport) pair from cache.
        Parameters:
        address - address of the host computer.
        priority - priority of the transport to be removed.
        Returns:
        removed transport, null if none found.
      • clear

        public void clear()
        Clear cache.
      • numberOfActiveTransports

        public int numberOfActiveTransports()
        Get number of active (cached) transports.
        Returns:
        number of active (cached) transports.
      • toArray

        public Transport[] toArray()
        Get array of all active (cached) transports.
        Returns:
        array of all active (cached) transports.