Package com.linecorp.armeria.server
Class ServerPort
java.lang.Object
com.linecorp.armeria.server.ServerPort
- All Implemented Interfaces:
Comparable<ServerPort>
public final class ServerPort extends Object implements Comparable<ServerPort>
A pair of server-side bind address and
SessionProtocol
.-
Constructor Summary
Constructors Constructor Description ServerPort(int port, SessionProtocol... protocols)
Creates a newServerPort
that listens to the specifiedport
of all available network interfaces using the specifiedSessionProtocol
s.ServerPort(int port, Iterable<SessionProtocol> protocols)
Creates a newServerPort
that listens to the specifiedport
of all available network interfaces using the specifiedSessionProtocol
s.ServerPort(InetSocketAddress localAddress, SessionProtocol... protocols)
Creates a newServerPort
that listens to the specifiedlocalAddress
using the specifiedSessionProtocol
s.ServerPort(InetSocketAddress localAddress, Iterable<SessionProtocol> protocols)
Creates a newServerPort
that listens to the specifiedlocalAddress
using the specifiedSessionProtocol
s. -
Method Summary
Modifier and Type Method Description int
compareTo(ServerPort o)
boolean
equals(Object obj)
int
hashCode()
boolean
hasHttp()
Returns whether theSessionProtocol.HTTP
,SessionProtocol.H1C
orSessionProtocol.H2C
is in the list ofSessionProtocol
s.boolean
hasHttps()
Returns whether theSessionProtocol.HTTPS
,SessionProtocol.H1
orSessionProtocol.H2
is in the list ofSessionProtocol
s.boolean
hasProtocol(SessionProtocol protocol)
Returns whether the specifiedprotocol
is in the list ofSessionProtocol
s.boolean
hasProxyProtocol()
Returns whether theSessionProtocol.PROXY
is in the list ofSessionProtocol
s.boolean
hasTls()
Returns whether there is aSessionProtocol
which is over TLS.InetSocketAddress
localAddress()
Returns the local address thisServerPort
listens to.Set<SessionProtocol>
protocols()
Returns theSessionProtocol
s thisServerPort
uses.String
toString()
-
Constructor Details
-
ServerPort
Creates a newServerPort
that listens to the specifiedport
of all available network interfaces using the specifiedSessionProtocol
s. -
ServerPort
Creates a newServerPort
that listens to the specifiedlocalAddress
using the specifiedSessionProtocol
s. -
ServerPort
Creates a newServerPort
that listens to the specifiedport
of all available network interfaces using the specifiedSessionProtocol
s. -
ServerPort
Creates a newServerPort
that listens to the specifiedlocalAddress
using the specifiedSessionProtocol
s.
-
-
Method Details
-
localAddress
Returns the local address thisServerPort
listens to. -
protocols
Returns theSessionProtocol
s thisServerPort
uses. -
hasTls
public boolean hasTls()Returns whether there is aSessionProtocol
which is over TLS. -
hasHttp
public boolean hasHttp()Returns whether theSessionProtocol.HTTP
,SessionProtocol.H1C
orSessionProtocol.H2C
is in the list ofSessionProtocol
s. -
hasHttps
public boolean hasHttps()Returns whether theSessionProtocol.HTTPS
,SessionProtocol.H1
orSessionProtocol.H2
is in the list ofSessionProtocol
s. -
hasProxyProtocol
public boolean hasProxyProtocol()Returns whether theSessionProtocol.PROXY
is in the list ofSessionProtocol
s. -
hasProtocol
Returns whether the specifiedprotocol
is in the list ofSessionProtocol
s. -
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ServerPort>
-
toString
-