Package com.iizix.prop
Class SocketCommProps
- java.lang.Object
- com.iizix.prop.GProp<GProp<?>[]>
- com.iizix.prop.PropCnr
- com.iizix.prop.SocketCommProps
- All Implemented Interfaces:
EventListener
,IGProp<GProp<?>[]>
,IPropCnr
,java.lang.Cloneable
- Direct Known Subclasses:
TelnetCommProps
,WebSocketCommProps
public class SocketCommProps extends PropCnr
This property container contains all properties required for a Socket (NIO) connection using Proxy, WebSocket, SSL, etc, required by the SocketProp property.- Author:
- Christopher Mindus
Field Summary
Fields inherited from class com.iizix.prop.PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID
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
Constructors Constructor Description SocketCommProps()
Creates the socket property container without a name.SocketCommProps(Atom propertyAtom)
Creates the socket property container with the specified name.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SocketCommProps
clone()
Clone method overridden in order not to clone the proxy password.SSLCommProps
createSecureProps()
Creates or gets the secure properties.boolean
doResolveHostNames()
Checks if host name resolve is enabled or if the host address should be returned (for performance reasons) for a call to e.g.java.lang.String
getBindAddress()
Gets the bind address for the port, i.e.java.lang.String
getHost()
Gets the destination host name or IP address for the socket destination.int
getPort()
Gets the host port for the socket.java.lang.String
getProxyHost()
Gets the proxy host name if any.int
getProxyPort()
Gets the proxy port if any.java.lang.String
getProxyPW()
Gets the authentication password for HTTP proxy if required.void
getProxyPW(java.lang.String password)
Sets the authentication password for HTTP proxy if required.int
getProxyType()
Gets the proxy type: 0=none/DIRECT, 1=HTTP, 2=SOCKS 4/5.java.lang.String
getProxyUser()
Gets the authentication user name for HTTP proxy if required.SSLCommProps
getSecureProps()
Gets the secure properties.To check for secure communication, useisSecure()
.boolean
isSecure()
Gets the secure socket flag.boolean
isVerbose()
Checks for verbose output.void
setBindAddress(java.lang.String bindAddress)
Sets the bind address for the socket, i.e.void
setHost(java.lang.String host)
Sets the destination host name/IP address for the socket.void
setPort(int port)
Gets the host port for the socket.void
setProxyHost(java.lang.String proxyHost)
Sets the proxy host name if any.void
setProxyPort(int proxyPort)
Sets the proxy port if any.void
setProxyType(int proxyType)
Sets the proxy type: 0=none/DIRECT, 1=HTTP, 2=SOCKS 4/5.void
setProxyUser(java.lang.String proxyUser)
Gets the authentication user name for HTTP proxy if required.void
setResolveHostNames(boolean doResolveHostNames)
Sets if host name resolve is enabled or if the host address should be returned (for performance reasons) for a call to e.g.void
setSecure(boolean on)
Sets the secure socket flag.void
setSecureProps(SSLCommProps secureProps)
Sets or removed the secure properties.void
setVerbose(boolean on)
Sets verbose mode.void
setWebSocket(boolean webSocket)
Sets if WebSocket protocol is used.boolean
useWebSocket()
Checks if WebSocket protocol is used.Methods inherited from class com.iizix.prop.PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, doVirtualizePropCnr, 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, getReferences, 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, 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, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, hasChanged, 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, 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, onVirtualizationCompleted, onVirtualized, 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, verifyHasPropertyItem, 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, 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, verifyHasPropertyItem, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Constructor Detail
SocketCommProps
public SocketCommProps()
Creates the socket property container without a name. The name must be set in all cases using thesetPropertyAtom
call.
SocketCommProps
public SocketCommProps(Atom propertyAtom)
Creates the socket 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 Detail
clone
public SocketCommProps clone()
Clone method overridden in order not to clone the proxy password.
setVerbose
public void setVerbose(boolean on)
Sets verbose mode.- Parameters:
on
- true for verbose mode, false for silent.
isVerbose
public boolean isVerbose()
Checks for verbose output.- Returns:
- true for verbose output, false for silent.
getHost
public java.lang.String getHost()
Gets the destination host name or IP address for the socket destination.- Returns:
- null if none is set.
getPort
public int getPort()
Gets the host port for the socket.- Returns:
- 0 if none if set.
getBindAddress
public java.lang.String getBindAddress()
Gets the bind address for the port, i.e. the local host name or IP address.- Returns:
- null if none is set or not required.
isSecure
public boolean isSecure()
Gets the secure socket flag.- Returns:
- true if SSL-secured, false if not.
setSecure
public void setSecure(boolean on)
Sets the secure socket flag.
getProxyHost
public java.lang.String getProxyHost()
Gets the proxy host name if any.- Returns:
- null for no proxy, otherwise a host name or IP address.
getProxyPort
public int getProxyPort()
Gets the proxy port if any.- Returns:
- 0 for no proxy.
getProxyType
public int getProxyType()
Gets the proxy type: 0=none/DIRECT, 1=HTTP, 2=SOCKS 4/5.
useWebSocket
public boolean useWebSocket()
Checks if WebSocket protocol is used.- Returns:
- true if WebSocket is used, false otherwise.
getProxyUser
public java.lang.String getProxyUser()
Gets the authentication user name for HTTP proxy if required.- Returns:
- null for none, otherwise a user name.
getProxyPW
public java.lang.String getProxyPW()
Gets the authentication password for HTTP proxy if required.- Returns:
- null for none, otherwise a password for the user name in question.
setHost
public void setHost(java.lang.String host)
Sets the destination host name/IP address for the socket.- Parameters:
host
- the host name or IP address (IPv4 or IPv6).- Throws:
java.lang.NullPointerException
- if the parameter is null.
setPort
public void setPort(int port)
Gets the host port for the socket.- Parameters:
port
- the port number 1-65535.- Throws:
java.lang.IllegalArgumentException
- if the port is not 1-65535.
setBindAddress
public void setBindAddress(java.lang.String bindAddress)
Sets the bind address for the socket, i.e. the local host name or IP address.- Parameters:
bindAddress
- The bind address as host name or IP address (IPv4 or IPv6).
setSecureProps
public void setSecureProps(SSLCommProps secureProps) throws PropException
Sets or removed the secure properties.- Parameters:
secureProps
- The secure properties, or null to remove them.- Throws:
PropException
- If the properties couldn't be added, set or removed.
getSecureProps
public SSLCommProps getSecureProps() throws PropException
Gets the secure properties.To check for secure communication, useisSecure()
.- Returns:
- The instance of the secure properties, null if not secure.
- Throws:
PropException
- If the secure properties couldn't be added.
createSecureProps
public SSLCommProps createSecureProps() throws PropException
Creates or gets the secure properties. If the no secure properties are present, a new instance is created.- Returns:
- The instance of the secure properties.
- Throws:
PropException
- If the secure properties couldn't be added.
setProxyHost
public void setProxyHost(java.lang.String proxyHost)
Sets the proxy host name if any.- Parameters:
proxyHost
- The proxy host name or IP address.
setProxyPort
public void setProxyPort(int proxyPort)
Sets the proxy port if any.- Parameters:
proxyPort
- 0 for no proxy, otherwise 1-65535.- Throws:
java.lang.IllegalArgumentException
- if the proxyPort is not 0-65535.
setProxyType
public void setProxyType(int proxyType)
Sets the proxy type: 0=none/DIRECT, 1=HTTP, 2=SOCKS 4/5.- Parameters:
proxyType
- 0=none/DIRECT, 1=HTTP, 2=SOCKS 4/5.- Throws:
java.lang.IllegalArgumentException
- if the proxyType is not 0-2.
setWebSocket
public void setWebSocket(boolean webSocket)
Sets if WebSocket protocol is used.- Parameters:
webSocket
- true if WebSocket is used, false otherwise.
setProxyUser
public void setProxyUser(java.lang.String proxyUser)
Gets the authentication user name for HTTP proxy if required.- Parameters:
proxyUser
- The user name.
getProxyPW
public void getProxyPW(java.lang.String password)
Sets the authentication password for HTTP proxy if required. This password is not stored for persistence nor transmitted if the class instance is cloned or transmitted in transactions.- Parameters:
password
- null for none, otherwise a password for the user name in question.
setResolveHostNames
public void setResolveHostNames(boolean doResolveHostNames)
Sets if host name resolve is enabled or if the host address should be returned (for performance reasons) for a call to e.g. getRemoteHost().- Parameters:
doResolveHostNames
- true if host names should be resolved, default is false.
doResolveHostNames
public boolean doResolveHostNames()
Checks if host name resolve is enabled or if the host address should be returned (for performance reasons) for a call to e.g. getRemoteHost().- Returns:
- true if host names should be resolved, default is false.