Class VirtualizedMonitorEndPointConstructor
java.lang.Object
com.iizix.server.monitor.VirtualizedMonitorEndPointConstructor
- All Implemented Interfaces:
IEndPointConstructor<Object>
public class VirtualizedMonitorEndPointConstructor extends Object implements IEndPointConstructor<Object>
The VirtualizedMonitor constructor of end points: the WebSocket of iiziGo's Server Monitor, which a development server registers. A connection is accepted from the computer the server runs on only, unless the server was started to accept other computers (
ServerMonitorAccess, CC-MONITOR-LOOPBACK).- Author:
- Christopher Mindus
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the server as it was started: other computers are accepted only when the JVM was started with-Diizi.allow.monitor.remote=true.VirtualizedMonitorEndPointConstructor(boolean isRemoteAllowed) Constructor.Method Summary
Modifier and TypeMethodDescriptioncreateInstance(ServerShell server, long sessionID, IWebSocketComm comm, String uri, String query, Map<String, List<String>> headerFields, Object object) Creates a new end point.String[]Gets the list of potential handled context paths for the websocket.isHandled(ServerShell server, IWebSocketComm comm, String uri, String query, Map<String, List<String>> headerFields) Checks if this end point constructor handles this URI.
Constructor Details
VirtualizedMonitorEndPointConstructor
public VirtualizedMonitorEndPointConstructor()Constructor for the server as it was started: other computers are accepted only when the JVM was started with-Diizi.allow.monitor.remote=true.VirtualizedMonitorEndPointConstructor
public VirtualizedMonitorEndPointConstructor(boolean isRemoteAllowed) Constructor.- Parameters:
isRemoteAllowed- true to accept connections from other computers, false to accept the computer the server runs on only (a loopback address).
Method Details
getHandledContextPaths
Gets the list of potential handled context paths for the websocket.- Specified by:
getHandledContextPathsin interfaceIEndPointConstructor<Object>- Returns:
- The array of possibly handled context paths.
isHandled
public Object isHandled(ServerShell server, IWebSocketComm comm, String uri, String query, Map<String, List<String>> headerFields) Checks if this end point constructor handles this URI. A connection that does not come from the computer the server runs on is not handled, and logged, unless the server accepts other computers: the remote address of the socket decides, never a header field of the request.- Specified by:
isHandledin interfaceIEndPointConstructor<Object>- Parameters:
server- Server shell.comm- The Web Socket communication properties.uri- The URI.query- The Query (after the URI).headerFields- HTTP header fields, null for a pre-check of the handled state, to avoid processing a request further to e.g. negotiate WebSocket protocol.- Returns:
- An Object if handled, null when not handled. This Object is passed in to the
createInstance()method when theheaderFieldsare non-null and the construction should take place.
createInstance
public IEndPoint createInstance(ServerShell server, long sessionID, IWebSocketComm comm, String uri, String query, Map<String, List<String>> headerFields, Object object) throws IOException Creates a new end point.- Specified by:
createInstancein interfaceIEndPointConstructor<Object>- Parameters:
server- Server shell.sessionID- The session ID.comm- The Web Socket communication properties.uri- The URI.query- The Query (after the URI).headerFields- HTTP header fields.object- The Object returned inisHandled().- Returns:
- The new end point.
- Throws:
IOException- For communications failure.