Class TransportRegistry


  • public final class TransportRegistry
    extends Object
    Class to cache PVA transports (connections to other hosts).
    Version:
    $Id$
    Author:
    Matej Sekoranja
    • Constructor Detail

      • TransportRegistry

        public TransportRegistry()
        Constructor.
    • Method Detail

      • put

        public void put​(Transport transport)
        Save/cache new transport into the registry.
        Parameters:
        transport - transport to be registered.
      • get

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

        public Transport[] get​(String type,
                               InetSocketAddress address)
        Lookup for a transport for given address (all priorities).
        Parameters:
        type - protocol type (e.g. tcp, udp, ssl, etc.).
        address - address of the host computer.
        Returns:
        array of corresponding transports, null if none found.
      • remove

        public Transport remove​(Transport transport)
        Remove transport from the registry.
        Parameters:
        transport - transport to remove.
        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​(String type)
        Get array of all active (cached) transports.
        Parameters:
        type - protocol type (e.g. tcp, udp, ssl, etc.).
        Returns:
        array of all active (cached) transports.
      • toArray

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