Enum Class TransportType

java.lang.Object
java.lang.Enum<TransportType>
com.linecorp.armeria.common.util.TransportType
All Implemented Interfaces:
Serializable, Comparable<TransportType>, Constable

public enum TransportType extends Enum<TransportType>
Native transport types.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
     
     
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Class<? extends io.netty.channel.socket.DatagramChannel>
    Returns the DatagramChannel class that is available for this transport type.
    static Class<? extends io.netty.channel.socket.DatagramChannel>
    datagramChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
    Returns the available DatagramChannel class that is compatible with the specified EventLoopGroup.
    Class<? extends io.netty.channel.unix.ServerDomainSocketChannel>
    Returns the ServerDomainSocketChannel class that is available for this transport type.
    static Class<? extends io.netty.channel.unix.ServerDomainSocketChannel>
    domainServerChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
    Returns the ServerDomainSocketChannel class that is compatible with the specified EventLoopGroup.
    Class<? extends io.netty.channel.unix.DomainSocketChannel>
    Returns the DomainSocketChannel class that is available for this transport type.
    static Class<? extends io.netty.channel.unix.DomainSocketChannel>
    domainSocketChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
    Returns the available DomainSocketChannel class that is compatible with the specified EventLoopGroup.
    boolean
    Returns whether this TransportType is currently available.
    static boolean
    isSupported(io.netty.channel.EventLoopGroup eventLoopGroup)
    Returns whether the specified EventLoopGroup is supported by any of the currently available TransportTypes.
    Returns lowercase name of TransportType.
    io.netty.channel.EventLoopGroup
    newEventLoopGroup(int nThreads, Function<TransportType,ThreadFactory> threadFactoryFactory)
    Creates the available EventLoopGroup.
    Class<? extends io.netty.channel.ServerChannel>
    Returns the ServerChannel class that is available for this transport type.
    static Class<? extends io.netty.channel.ServerChannel>
    serverChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
    Returns the ServerChannel class that is compatible with the specified EventLoopGroup.
    Class<? extends io.netty.channel.socket.SocketChannel>
    Returns the SocketChannel class that is available for this transport type.
    static Class<? extends io.netty.channel.socket.SocketChannel>
    socketChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
    Returns the available SocketChannel class that is compatible with the specified EventLoopGroup.
    boolean
    Returns whether this TransportType supports Unix domain sockets or not.
    static boolean
    supportsDomainSockets(io.netty.channel.EventLoopGroup eventLoopGroup)
    Returns whether the specified EventLoopGroup supports Unix domain sockets or not.
    Returns why this TransportType is not available.
    Returns the enum constant of this class with the specified name.
    static TransportType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

  • Method Details

    • values

      public static TransportType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TransportType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • serverChannelType

      public static Class<? extends io.netty.channel.ServerChannel> serverChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns the ServerChannel class that is compatible with the specified EventLoopGroup.
      Throws:
      IllegalStateException - if the specified EventLoopGroup is not supported or its TransportType is not currently available.
    • serverChannelType

      public Class<? extends io.netty.channel.ServerChannel> serverChannelType()
      Returns the ServerChannel class that is available for this transport type.
      Throws:
      IllegalStateException - if this TransportType is not currently available.
    • socketChannelType

      public static Class<? extends io.netty.channel.socket.SocketChannel> socketChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns the available SocketChannel class that is compatible with the specified EventLoopGroup.
      Throws:
      IllegalStateException - if the specified EventLoopGroup is not supported or its TransportType is not currently available.
    • socketChannelType

      public Class<? extends io.netty.channel.socket.SocketChannel> socketChannelType()
      Returns the SocketChannel class that is available for this transport type.
      Throws:
      IllegalStateException - if this TransportType is not currently available.
    • supportsDomainSockets

      public static boolean supportsDomainSockets(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns whether the specified EventLoopGroup supports Unix domain sockets or not.
    • supportsDomainSockets

      public boolean supportsDomainSockets()
      Returns whether this TransportType supports Unix domain sockets or not.
    • domainServerChannelType

      public static Class<? extends io.netty.channel.unix.ServerDomainSocketChannel> domainServerChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns the ServerDomainSocketChannel class that is compatible with the specified EventLoopGroup.
      Throws:
      IllegalStateException - if the specified EventLoopGroup is not supported or its TransportType is not currently available.
    • domainServerChannelType

      public Class<? extends io.netty.channel.unix.ServerDomainSocketChannel> domainServerChannelType()
      Returns the ServerDomainSocketChannel class that is available for this transport type.
      Throws:
      IllegalStateException - if this TransportType is not currently available or doesn't support Unix domain sockets.
    • domainSocketChannelType

      public static Class<? extends io.netty.channel.unix.DomainSocketChannel> domainSocketChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns the available DomainSocketChannel class that is compatible with the specified EventLoopGroup.
      Throws:
      IllegalStateException - if the specified EventLoopGroup is not supported or its TransportType is not currently available or doesn't support Unix domain sockets.
    • domainSocketChannelType

      public Class<? extends io.netty.channel.unix.DomainSocketChannel> domainSocketChannelType()
      Returns the DomainSocketChannel class that is available for this transport type.
      Throws:
      IllegalStateException - if this TransportType is not currently available.
    • datagramChannelType

      public static Class<? extends io.netty.channel.socket.DatagramChannel> datagramChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns the available DatagramChannel class that is compatible with the specified EventLoopGroup.
      Throws:
      IllegalStateException - if the specified EventLoopGroup is not supported or its TransportType is not currently available.
    • datagramChannelType

      public Class<? extends io.netty.channel.socket.DatagramChannel> datagramChannelType()
      Returns the DatagramChannel class that is available for this transport type.
      Throws:
      IllegalStateException - if this TransportType is not currently available.
    • isSupported

      public static boolean isSupported(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns whether the specified EventLoopGroup is supported by any of the currently available TransportTypes.
    • lowerCasedName

      public String lowerCasedName()
      Returns lowercase name of TransportType. This method is a shortcut for:
      
       Ascii.toLowerCase(name());
       
    • isAvailable

      public boolean isAvailable()
      Returns whether this TransportType is currently available.
      See Also:
    • unavailabilityCause

      @Nullable public @Nullable Throwable unavailabilityCause()
      Returns why this TransportType is not available.
      Returns:
      why this TransportType is not available, or null if this TransportType is currently available.
      See Also:
    • newEventLoopGroup

      public io.netty.channel.EventLoopGroup newEventLoopGroup(int nThreads, Function<TransportType,ThreadFactory> threadFactoryFactory)
      Creates the available EventLoopGroup.