Package org.drasyl.util
Class WebSocketUtil
- java.lang.Object
-
- org.drasyl.util.WebSocketUtil
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isWebSocketNonSecureURI(URI uri)
static boolean
isWebSocketSecureURI(URI uri)
static boolean
isWebSocketURI(URI uri)
static int
webSocketPort(URI uri)
-
-
-
Field Detail
-
WS_PORT
public static final int WS_PORT
- See Also:
- Constant Field Values
-
WSS_PORT
public static final int WSS_PORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
webSocketPort
public static int webSocketPort(URI uri)
- Parameters:
uri
- the URI to be used for determining the WebSocket URI- Returns:
- the port in the WebSocket URI. If no custom port is specified, the protocol default port is assumed
- Throws:
IllegalArgumentException
- if no port could be determinedNullPointerException
- ifuri
isnull
-
isWebSocketSecureURI
public static boolean isWebSocketSecureURI(URI uri)
- Parameters:
uri
- the URI to be checked- Returns:
true
ifuri
is a WebSocket Secure URI. Otherwise, returnsfalse
- Throws:
NullPointerException
- ifuri
isnull
-
isWebSocketNonSecureURI
public static boolean isWebSocketNonSecureURI(URI uri)
- Parameters:
uri
- the URI to be checked- Returns:
true
ifuri
is a non-secure Websocket URI. Otherwise, returnsfalse
- Throws:
NullPointerException
- ifuri
isnull
-
isWebSocketURI
public static boolean isWebSocketURI(URI uri)
- Parameters:
uri
- the URI to be checked- Returns:
true
ifuri
is Websocket URI. Otherwise, returnsfalse
- Throws:
NullPointerException
- ifuri
isnull
-
-