Class PacketTransporterImpl

  • All Implemented Interfaces:
    Module

    public class PacketTransporterImpl
    extends BasicModule
    In-memory implementation of the packet transporter service.
    Author:
    Iain Shigeoka
    • Constructor Detail

      • PacketTransporterImpl

        public PacketTransporterImpl()
        This is a singleton, you can't create one. Be very careful not to do anything that refers back to the factory's create method. Do initialization in the init() method if at all possible.
    • Method Detail

      • getTransportHandler

        public TransportHandler getTransportHandler()
        Obtain the transport handler that this transporter uses for delivering transport packets.
        Returns:
        The transport handler instance used by this transporter
      • deliver

        public void deliver​(org.xmpp.packet.Packet packet)
                     throws UnauthorizedException,
                            PacketException
        Delivers the given packet based on packet recipient and sender. The deliverer defers actual routing decisions to other classes.

        Warning

        Be careful to enforce concurrency DbC of concurrent by synchronizing any accesses to class resources.
        Parameters:
        packet - The packet to route
        Throws:
        NullPointerException - If the packet is null or the packet could not be routed
        UnauthorizedException - if the user is not authorised
        PacketException
      • initialize

        public void initialize​(XMPPServer server)
        Description copied from class: BasicModule

        Initializes the basic module.

        Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

        Specified by:
        initialize in interface Module
        Overrides:
        initialize in class BasicModule
        Parameters:
        server - the server hosting this module.