Interface ProtocolPipeline

    • Method Detail

      • add

        void add​(Protocol protocol)
        Adds a protocol to the current pipeline. This will call the Protocol.init(UserConnection) method.
        Parameters:
        protocol - protocol to add to the end
      • add

        void add​(java.util.Collection<Protocol> protocols)
        Adds a collection of protocols to the current pipeline. This will call the Protocol.init(UserConnection) method.

        Callers of this method should make sure the collection is correctly sorted.

        Parameters:
        protocols - correctly sorted protocols to add to the end
      • contains

        boolean contains​(java.lang.Class<? extends Protocol> protocolClass)
        Returns whether the protocol is in this pipeline.
        Parameters:
        protocolClass - protocol class
        Returns:
        whether the protocol class is in this pipeline
      • getProtocol

        <P extends Protocol> @Nullable P getProtocol​(java.lang.Class<P> pipeClass)
        Returns the protocol from the given class if present in the pipeline.
        Type Parameters:
        P - protocol
        Parameters:
        pipeClass - protocol class
        Returns:
        protocol from class
        See Also:
        contains(Class), for a faster implementation
      • pipes

        java.util.List<Protocol> pipes()
        Returns the list of protocols this pipeline contains.
        Returns:
        list of protocols in this pipe
      • hasNonBaseProtocols

        boolean hasNonBaseProtocols()
        Returns whether this pipe has protocols that are not base protocols, as given by Protocol.isBaseProtocol().
        Returns:
        whether this pipe has protocols that are not base protocols
      • cleanPipes

        void cleanPipes()
        Cleans the pipe and adds the base protocol. /!\ WARNING - It doesn't add version-specific base Protocol.