Class CATransportRegistry


  • public class CATransportRegistry
    extends Object
    Class to cache CA transports (connections to other hosts).
    Version:
    $id$
    Author:
    Matej Sekoranja
    • Constructor Detail

      • CATransportRegistry

        public CATransportRegistry()
        Constructor.
    • Method Detail

      • put

        public void put​(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​(InetSocketAddress address,
                             short priority)
        Lookup for a transport for given address.
        Parameters:
        address - address of the host computer.
        priority - priority of the transport.
        Returns:
        curressponing transport, null if none found.
      • get

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

        public Transport remove​(InetSocketAddress address,
                                short 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.