Package com.iizix.prop
Class WebSocketServerCommProps
java.lang.Object
com.iizix.prop.GProp<GProp<?>[]>
com.iizix.prop.PropCnr
com.iizix.prop.ServerSocketCommProps
com.iizix.prop.WebSocketServerCommProps
- All Implemented Interfaces:
EventListener
,IGProp<GProp<?>[]>
,IPropCnr
,Cloneable
This property container contains all properties required for a WebSocket Server (NIO) connection.
Field Summary
Fields inherited from class com.iizix.prop.PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID, nameTable
Fields inherited from class com.iizix.prop.GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Constructor Summary
ModifierConstructorDescriptionprotected
Creates the WebSocket server property container without a name.WebSocketServerCommProps
(Atom propertyAtom) Creates the WebSocket server property container with the specified name.Method Summary
Modifier and TypeMethodDescriptionboolean
Check for fail if sub-protocol is not present.void
doFailForUnsupportedSubProtocol
(boolean doFail) Set failure action if sub-protocol is not present.boolean
Flag indicating frames sent back and forth should be masked, valid from protocol version 7 or better.int[]
Gets the cache parameters as 3 integers in an array, param[0] is minLength, param[1] is maxLength, param[2] is count.int
Gets the ending port (inclusive) for server socket ports for acceptance.int
Gets the starting port for server socket ports for acceptance.int
Gets the maximum reply timeout for a complete message from the server, before the connection is closed.String[]
Gets the sub-protocols as a String array.boolean
Checks if the Origin HTTP header field should be validated or not.void
setCacheParams
(int minLength, int maxLength, int count) Sets the parameters for cache: minLength, maxLength, count.void
setMaskFrames
(boolean on) Sets if masking of frames sent back and forth should be masked, valid from protocol version 7 or better.void
setPortRange
(int from, int end) Sets the port range the "from-port" and the "end-port" (inclusive) for server socket ports for acceptance.void
setServerReadMessageTimeout
(int timeout) Sets the maximum reply timeout for a complete message from the server, before the connection is closed.void
setSubProtocols
(String[] subProtocols) Sets the sub-protocols from a String array.void
setValidateOrigin
(boolean validate) Sets if the Origin HTTP header field should be validated or not.Methods inherited from class com.iizix.prop.ServerSocketCommProps
doResolveHostNames, getBindAddress, getPort, isVerbose, setBindAddress, setPort, setResolveHostNames, setVerbose
Methods inherited from class com.iizix.prop.PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, clone, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isSibling, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualize
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, extendsClone, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Constructor Details
WebSocketServerCommProps
protected WebSocketServerCommProps()Creates the WebSocket server property container without a name. The name must be set in all cases using thesetPropertyAtom
call.WebSocketServerCommProps
Creates the WebSocket server property container with the specified name. All system-reserved names for components begins with "$".- Parameters:
propertyAtom
- the name of the component, unique within it's parent.
Method Details
getFromPort
public int getFromPort()Gets the starting port for server socket ports for acceptance. The first available free server socket will be used, up to the "end-port" (inclusive).- Returns:
- The port number, default value is 14000.
getEndPort
public int getEndPort()Gets the ending port (inclusive) for server socket ports for acceptance.- Returns:
- The port number, default value is 16000.
setPortRange
public void setPortRange(int from, int end) Sets the port range the "from-port" and the "end-port" (inclusive) for server socket ports for acceptance. The first available free server socket will be used.- Parameters:
from
- the port 1-65535.end
- the port from-65535.- Throws:
IllegalArgumentException
- For invalid arguments.
doMaskFrames
public boolean doMaskFrames()Flag indicating frames sent back and forth should be masked, valid from protocol version 7 or better.- Returns:
- true masking is enabled, false otherwise.
setMaskFrames
public void setMaskFrames(boolean on) Sets if masking of frames sent back and forth should be masked, valid from protocol version 7 or better.- Parameters:
on
- true to enable frame masking, false otherwise.
getSubProtocols
Gets the sub-protocols as a String array.- Returns:
- An array of sub-protocols, it may be zero in length for no sub-protocols.
setSubProtocols
Sets the sub-protocols from a String array. The array may be empty, i.e. of length zero or null for no sub-protocols.- Parameters:
subProtocols
- The sub-protocols as a String array.
doFailForUnsupportedSubProtocol
public boolean doFailForUnsupportedSubProtocol()Check for fail if sub-protocol is not present.- Returns:
- true (default) for failure, false to accept any or no sub-protocol.
doFailForUnsupportedSubProtocol
public void doFailForUnsupportedSubProtocol(boolean doFail) Set failure action if sub-protocol is not present.- Parameters:
doFail
- true for failure as an WebSocketException, false to accept any or no sub-protocol.
setCacheParams
public void setCacheParams(int minLength, int maxLength, int count) Sets the parameters for cache: minLength, maxLength, count.- Parameters:
minLength
- The minimum length for caching, 7 is the smallest value.maxLength
- The maximum length for caching, normally 80 or so (maximum 1024).count
- The count should normally be larger than 200 and smaller than 1000 (maximum 2048).- Throws:
IllegalArgumentException
- If arguments are not valid.
getCacheParams
public int[] getCacheParams()Gets the cache parameters as 3 integers in an array, param[0] is minLength, param[1] is maxLength, param[2] is count.The default values are minLength=7, maxLength=80, count=700 if nothing is specified.
- Returns:
- Array of 3 integer parameters, param[0] is minLength, param[1] is maxLength, param[2] is count.
getServerReadMessageTimeout
public int getServerReadMessageTimeout()Gets the maximum reply timeout for a complete message from the server, before the connection is closed. This timeout is used for connection and close exchange of data.- Returns:
- timeout in milliseconds, default is 20 seconds.
setServerReadMessageTimeout
public void setServerReadMessageTimeout(int timeout) Sets the maximum reply timeout for a complete message from the server, before the connection is closed. This timeout is used for connection and close exchange of data.- Parameters:
timeout
- timeout in milliseconds, default is 20000, -1 sets an indefinite timeout.
isOriginValidated
public boolean isOriginValidated()Checks if the Origin HTTP header field should be validated or not. If the Web Socket is created from a File://page.html then origin is null.- Returns:
- The validation flag.
setValidateOrigin
public void setValidateOrigin(boolean validate) Sets if the Origin HTTP header field should be validated or not. If the Web Socket is created from a File://page.html then origin is null.- Parameters:
validate
- The validation flag.