Class TransportType

  • All Implemented Interfaces:
    java.io.Serializable

    public final class TransportType
    extends java.lang.Object
    implements java.io.Serializable
    Represents network transport types. MINA provides three transport types by default:

    You can also create your own transport type. Please refer to TransportType(String[], boolean).

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      TransportType​(java.lang.String[] names, boolean connectionless)
      Creates a new instance.
      TransportType​(java.lang.String[] names, java.lang.Class<? extends java.lang.Object> envelopeType, boolean connectionless)
      Creates a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class<? extends java.lang.Object> getEnvelopeType()  
      static TransportType getInstance​(java.lang.String name)
      Returns the transport type of the specified name.
      java.util.Set<java.lang.String> getNames()
      Returns the known names of this transport type.
      boolean isConnectionless()
      Returns true if the session of this transport type is connectionless.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • SOCKET

        public static final TransportType SOCKET
        Transport type: TCP/IP (Registry name: "SOCKET" or "TCP")
      • DATAGRAM

        public static final TransportType DATAGRAM
        Transport type: UDP/IP (Registry name: "DATAGRAM" or "UDP")
    • Constructor Detail

      • TransportType

        public TransportType​(java.lang.String[] names,
                             boolean connectionless)
        Creates a new instance. New transport type is automatically registered to internal registry so that you can look it up using getInstance(String).
        Parameters:
        names - the name or aliases of this transport type
        connectionless - true if and only if this transport type is connectionless
        Throws:
        java.lang.IllegalArgumentException - if names are already registered or empty
      • TransportType

        public TransportType​(java.lang.String[] names,
                             java.lang.Class<? extends java.lang.Object> envelopeType,
                             boolean connectionless)
        Creates a new instance. New transport type is automatically registered to internal registry so that you can look it up using getInstance(String).
        Parameters:
        names - the name or aliases of this transport type
        connectionless - true if and only if this transport type is connectionless
        Throws:
        java.lang.IllegalArgumentException - if names are already registered or empty
    • Method Detail

      • getInstance

        public static TransportType getInstance​(java.lang.String name)
        Returns the transport type of the specified name. All names are case-insensitive.
        Parameters:
        name - the name of the transport type
        Returns:
        the transport type
        Throws:
        java.lang.IllegalArgumentException - if the specified name is not available.
      • isConnectionless

        public boolean isConnectionless()
        Returns true if the session of this transport type is connectionless.
      • getEnvelopeType

        public java.lang.Class<? extends java.lang.Object> getEnvelopeType()
      • getNames

        public java.util.Set<java.lang.String> getNames()
        Returns the known names of this transport type.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object