public class BrokerConnectionDescriptor
extends java.lang.Object
Connection Sharing: A BrokerClient object created with connection sharing set to true will allow its connection to the broker to be re-used by other BrokerClient objects in order to increase performance. When set to false, the network connection used by the client will never be shared.
Automatic Reconnect: A BrokerClient object created with automatic reconnect set to true will attempt to reconnect to the broker if at any time it finds that its connection to the broker has been lost. If its client does not exist, then a new one will get created. Explicitly calling disconnect() or destroy() on a client disables this feature.
State Sharing: A BrokerClient object created with state sharing set to true will allow other BrokerClient objects to use reconnect to open sessions with the client's state on the broker. All BrokerClients which are sharing the client's state will affect one another. This feature should be used with care. A value of false, is the default, and causes the Broker to only allow one session to use the client's state at a time. This quality only applies to making a new client. It is completely ignored when reconnecting clients.
Shared Event Ordering: A BrokerClient object created with state sharing set to true and with enforced event order set to SHARED_ORDER_BY_PUBLISHER, will enforce that the events delivered to the clients are ordered so that no event from a publisher is processed until its preceding events are processed. If enforced event order is set to SHARED_ORDER_NONE, then no ordering is imposed on the events delivered to the clients. This feature should be used with care because it can cause a client's events to be processed out of order. A value of SHARED_ORDER_BY_PUBLISHER, is the default. This quality only applies to making a new client. It is completely ignored when reconnecting clients, or when creating clients which do not have state sharing enabled.
Secure Socket Certificate: Secure socket layer (SSL) support requires a certificate file in order to validate the digital certificates. SSL is enabled whenever the certifcate file is not null. In addition, a certificate in the file can be specified using the distinguished name. If the distinguished name is null, then the client connects annonymously. If it is non-null, then the digital certificate for that name is used. If it is USE_DEFAULT_DN, then the default name in the certificate file is used.
Access Label Hint: When using the access label feature, this allows a client to specify a hint string to be used to look up the client's access label. Access labels are only looked up when creating a client, so the hint is ignored when reconnecting.
Forced Reconnect: A BrokerClient object created with forced reconnect set to true can be forcefully reconnected to. This will reconnect to the client and possibly disconnect the existing connected session. Forced reconnect cannot be used in conjunction with shared state. A value of false is the default.
Redelivery Count: A BrokerClient object created with redelivery count set to true will have delivery counts tracked for it by the Broker. Redelivery counts can be incremented automatically or manually. A value of false for redelivery count is the default. If turned on, manual increments are the default.
Keep Alive settings: KeepAlive settings are pertinent to the network connection that is created on behalf of BrokerClient object. In case of State
Sharing Clients KeepAlive settings might be different for different sessions of the client. Keep Alive settings are important for network connection sharing,
connections with different Keep Alive settings can not be shared. KeepAlive settings are comprised from 3 attributes:
KeepAlivePeriod: Specifies how often the Broker will send Keep Alive messages through the connection. Integer.MAX_VALUE (default) means Broker will
not send Keep Alive messages
MaxResponseTime: Specifies how long the Broker will wait for a response from a Client before disconnecting it. Integer.MAX_VALUE(default) means the
Broker will not never disconnect the Client. See also KeepAliveRetryCount.
KeepAliveRetryCount: Broker will retry sending KeepAlive messages this many times before actually disconnecting the Client. Default value is 1.
Client Storage: A BrokerClient object may override it's storage type in the Broker by supplying a different storage type, BrokerTypeDef.STORAGE_VOLATILE, BrokerTypeDef.STORAGE_PERSISTENT, or BrokerTypeDef.STORAGE_GUARANTEED. Default is according to Client Group.
Client LifeCycle: A BrokerClient object may override it's lifecycle in the Broker, by supplying a different lifecycle, BrokerAdminClient.LIFECYCLE_DESTROY_ON_DISCONNECT or BrokerAdminClient.LIFECYCLE_EXPLICIT_DESTROY. Default is according to Client Group.
Priority Ordering A BrokerClient may request that events sent to it are received in priority order. The event's priority is set by the BrokerClient sending the events. Default value is false (no priority ordering).
Modifier and Type | Field and Description |
---|---|
static BrokerConnectionDescriptor |
defaultDescriptor |
static int |
ENCRYPT_LEVEL_ENCRYPTION |
static int |
ENCRYPT_LEVEL_NO_ENCRYPTION |
static int |
ENCRYPT_LEVEL_US_DOMESTIC
Deprecated.
Replaced By
ENCRYPT_LEVEL_ENCRYPTION |
static int |
ENCRYPT_LEVEL_US_EXPORT
Deprecated.
Replaced By
ENCRYPT_LEVEL_ENCRYPTION |
static java.lang.String |
SHARED_ORDER_BY_PUBLISHER |
static java.lang.String |
SHARED_ORDER_NONE |
static java.lang.String |
USE_DEFAULT_DN |
Constructor and Description |
---|
BrokerConnectionDescriptor()
Create an empty connection descriptor.
|
BrokerConnectionDescriptor(BrokerConnectionDescriptor desc)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(BrokerConnectionDescriptor desc) |
java.lang.String |
getAccessLabelHint()
Get the access label hint.
|
boolean |
getAckVolatile()
Internal use only.
|
java.lang.String |
getAuthUserName()
Get the authentication user name of the descriptor
|
boolean |
getAutomaticReconnect()
Get the automatic reconnect status of the descriptor.
|
boolean |
getAutomaticRedeliveryCount()
Get the redelivery_count_auto status of the descriptor.
|
int |
getClientLifeCycle()
Internal use only.
|
int |
getClientStorage()
Internal use only.
|
boolean |
getConnectionShare()
Get the connection share status of the descriptor.
|
int |
getConnectionShareLimit()
Get the maximum number of clients that may share the connection.
|
boolean |
getForcedReconnect()
Get the forced_reconnect status of the descriptor.
|
int |
getKeepAlivePeriod()
Get the Keep Alive Period of the descriptor.
|
int |
getKeepAliveRetryCount()
Get the Keep Alive Retry Count of the descriptor.
|
java.util.Locale |
getLocale()
Get the locale for this connection.
|
int |
getMaxResponseTime()
Get the Max Response Time of the descriptor.
|
boolean |
getPriorityOrdering()
Get the event priority ordering status of the descriptor.
|
boolean |
getRedeliveryCountEnabled()
Get the redelivery_count status of the descriptor.
|
java.lang.String |
getSharedEventOrdering()
Get the shared event ordering status of the descriptor.
|
int |
getSocketConnectTimeout()
Get the socket connect timeout.
|
boolean |
getSocketKeepAliveEnabled() |
boolean |
getSocketLinger()
Get the socket linger state.
|
int |
getSocketLingerTimeout()
Get the socket linger timeout.
|
int |
getSocketRecvBufferSize()
Get the inbound socket buffer size.
|
int |
getSocketSendBufferSize()
Get the outbound socket buffer size.
|
boolean |
getSocketTcpNoDelay()
Get the socket setting of Nagle's algorithm.
|
static BrokerSSLCertificate |
getSSLCertificate(java.lang.String certificate_file,
java.lang.String trust_file,
COM.activesw.api.client.enums.KeystoreType keystore_type,
COM.activesw.api.client.enums.TruststoreType truststore_type,
java.lang.String password)
Get the SSL certificate for a specific distinguished name from a certificate file.
|
static BrokerSSLCertificate |
getSSLCertificate(java.lang.String certificate_file,
java.lang.String password,
java.lang.String distinguished_name)
Get the SSL certificate for a specific distinguished name from a certificate file.
|
static java.lang.String[] |
getSSLCertificateDns(java.lang.String certificate_file,
java.lang.String password)
Get the list of distinguished names from a certificate file.
|
static java.lang.String[] |
getSSLCertificateDns(java.lang.String certificate_file,
java.lang.String trust_file,
COM.activesw.api.client.enums.KeystoreType keystore_type,
COM.activesw.api.client.enums.TruststoreType truststore_type,
java.lang.String password)
Get the list of distinguished names from a certificate file.
|
java.lang.String |
getSSLCertificateFile()
Deprecated.
Get the secure socket layer (SSL) certificate file.
|
java.lang.String |
getSSLCipherSuites() |
java.lang.String |
getSSLDistinguishedName()
Get the secure socket layer (SSL) distinguished name.
|
boolean |
getSSLEncrypted()
Get the secure socket layer encryption flag.
|
static int |
getSSLEncryptionLevel()
Get the SSL encryption level that this library is capable of.
|
java.lang.String |
getSSLKeystore() |
COM.activesw.api.client.enums.KeystoreType |
getSSLKeystoreType()
Returns the keystore type set on the connection descriptor.
|
java.lang.String |
getSSLProvider() |
static java.lang.String[] |
getSSLRootDns(java.lang.String keystore,
java.lang.String truststore,
COM.activesw.api.client.enums.KeystoreType keystore_type,
COM.activesw.api.client.enums.TruststoreType truststore_type,
java.lang.String password)
Get the list of trusted root distinguished names from a certificate file.
|
java.lang.String |
getSSLTruststore() |
COM.activesw.api.client.enums.TruststoreType |
getSSLTruststoreType()
Returns the truststore type set on the connection descriptor.
|
boolean |
getStateShare()
Get the state share status of the descriptor.
|
void |
setAccessLabelHint(java.lang.String hint)
Set the access label hint.
|
void |
setAckVolatile(boolean on)
Internal use only.
|
void |
setAuthInfo(java.lang.String username,
java.lang.String password)
Set the authentication user name and password of the descriptor
|
void |
setAutomaticReconnect(boolean reconnect)
Set the automatic reconnect status of the descriptor.
|
void |
setAutomaticRedeliveryCount(boolean on)
Set the redelivery_count_auto status of the descriptor.
|
void |
setClientLifeCycle(int l)
Internal use only.
|
void |
setClientStorage(int s)
Internal use only.
|
void |
setConnectionShare(boolean shared)
Set the connection share status of the descriptor.
|
void |
setConnectionShareLimit(int limit)
Set the maximum number of clients that may share the connection.
|
void |
setForcedReconnect(boolean forced)
Set the forced reconnect status of the descriptor.
|
void |
setKeepAlive(int KeepAlivePeriod,
int MaxResponseTime,
int RetryCount)
Set the Keep Alive settings on the descriptor
|
void |
setLocale(java.util.Locale locale)
Set the locale for this connection.
|
void |
setPriorityOrdering(boolean new_value)
Set the event priority ordering status of the descriptor.
|
void |
setRedeliveryCountEnabled(boolean on)
Set the redelivery_count status of the descriptor.
|
void |
setSharedEventOrdering(java.lang.String ordering)
Set the shared event ordering status of the descriptor.
|
void |
setSocketConnectTimeout(int socketConnectTimeout)
Set the socket connect timeout.
|
void |
setSocketKeepAliveEnabled(boolean enabled) |
void |
setSocketLinger(boolean socketLinger)
Set the socket linger state.
|
void |
setSocketLingerTimeout(int socketLingerTimeout)
Set the socket linger timeout.
|
void |
setSocketRecvBufferSize(int socketRecvBufferSize)
Set the inbound socket buffer size.
|
void |
setSocketSendBufferSize(int socketSendBufferSize)
Set the outbound socket buffer size.
|
void |
setSocketTcpNoDelay(boolean socketTcpNoDelay)
Enable or disable the Nagle's algorithm on the socket.
|
void |
setSSLCertificate(java.lang.String keystore,
java.lang.String truststore,
COM.activesw.api.client.enums.KeystoreType keystore_type,
COM.activesw.api.client.enums.TruststoreType truststore_type,
java.lang.String password) |
void |
setSSLCipherSuites(java.lang.String ssl_cipher_suites) |
void |
setSSLDistinguishedName(java.lang.String dn) |
void |
setSSLEncrypted(boolean encrypted)
Set the secure socket layer encryption flag.
|
void |
setSSLProvider(java.lang.String ssl_provider) |
void |
setStateShare(boolean shared)
Set the state share status of the descriptor.
|
java.lang.String |
toString()
Return a human-readable string with the descriptor's value.
|
public static final java.lang.String USE_DEFAULT_DN
public static final int ENCRYPT_LEVEL_NO_ENCRYPTION
public static final int ENCRYPT_LEVEL_US_EXPORT
ENCRYPT_LEVEL_ENCRYPTION
public static final int ENCRYPT_LEVEL_US_DOMESTIC
ENCRYPT_LEVEL_ENCRYPTION
public static final int ENCRYPT_LEVEL_ENCRYPTION
public static final java.lang.String SHARED_ORDER_NONE
public static final java.lang.String SHARED_ORDER_BY_PUBLISHER
public static final BrokerConnectionDescriptor defaultDescriptor
public BrokerConnectionDescriptor()
public BrokerConnectionDescriptor(BrokerConnectionDescriptor desc)
public boolean equals(BrokerConnectionDescriptor desc)
public boolean getConnectionShare()
public void setConnectionShare(boolean shared)
public int getConnectionShareLimit()
public void setConnectionShareLimit(int limit)
java.lang.IllegalArgumentException
- if limit < 2public boolean getAutomaticReconnect()
public void setAutomaticReconnect(boolean reconnect)
public boolean getStateShare()
public void setStateShare(boolean shared)
public java.lang.String getSharedEventOrdering()
public void setSharedEventOrdering(java.lang.String ordering) throws BrokerException
BrokerNullParameterException
- If ordering is null.BrokerOutOfRangeException
- If odering contains spaces or unprintable characters.BrokerException
public java.lang.String getSSLCertificateFile()
public java.lang.String getSSLKeystore()
public java.lang.String getSSLTruststore()
public COM.activesw.api.client.enums.TruststoreType getSSLTruststoreType()
TruststoreType
The Truststore type. The possible value is JKS.public COM.activesw.api.client.enums.KeystoreType getSSLKeystoreType()
KeystoreType
The Keystore type. The possible value is PKCS12.public java.lang.String getSSLDistinguishedName()
public void setSSLDistinguishedName(java.lang.String dn)
public void setSSLCertificate(java.lang.String keystore, java.lang.String truststore, COM.activesw.api.client.enums.KeystoreType keystore_type, COM.activesw.api.client.enums.TruststoreType truststore_type, java.lang.String password) throws BrokerException
keystore
- truststore
- keystore_type
- KeystoreType
. The possible value is PKCS12.truststore_type
- TruststoreType
. The possible value is JKS.password
- BrokerException
public boolean getSSLEncrypted()
public void setSSLEncrypted(boolean encrypted)
public java.lang.String getAccessLabelHint()
public void setAccessLabelHint(java.lang.String hint)
public static int getSSLEncryptionLevel()
public static java.lang.String[] getSSLCertificateDns(java.lang.String certificate_file, java.lang.String password) throws BrokerException
BrokerFileNotFoundException
- If the certificate file is not found or readable.BrokerNoPermissionException
- If the password is not valid or if the file is not a certificate file.BrokerNullParameterException
- If the cetificate_file or password are null.BrokerSecurityException
- If SSL support is not available.BrokerException
public static java.lang.String[] getSSLCertificateDns(java.lang.String certificate_file, java.lang.String trust_file, COM.activesw.api.client.enums.KeystoreType keystore_type, COM.activesw.api.client.enums.TruststoreType truststore_type, java.lang.String password) throws BrokerException
certificate_file
- trust_file
- keystore_type
- KeystoreType
. The possible value is PKCS12.truststore_type
- TruststoreType
. The possible value is JKS.password
- BrokerException
public static java.lang.String[] getSSLRootDns(java.lang.String keystore, java.lang.String truststore, COM.activesw.api.client.enums.KeystoreType keystore_type, COM.activesw.api.client.enums.TruststoreType truststore_type, java.lang.String password) throws BrokerException
keystore
- keystore filetruststore
- truststore filekeystore_type
- KeystoreType
. The possible value is PKCS12.truststore_type
- TruststoreType
. The possible value is JKS.password
- passwordBrokerException
public static BrokerSSLCertificate getSSLCertificate(java.lang.String certificate_file, java.lang.String password, java.lang.String distinguished_name) throws BrokerException
BrokerFileNotFoundException
- If the certificate file is not found or readable.BrokerNoPermissionException
- If the password is not valid or if the file is not a certificate file.BrokerNullParameterException
- If the cetificate_file, password, or distinguished_name are null.BrokerSecurityException
- If SSL support is not available.BrokerUnknownNameException
- If a distinguished name is specified but does not exist in the certificate file.BrokerException
public static BrokerSSLCertificate getSSLCertificate(java.lang.String certificate_file, java.lang.String trust_file, COM.activesw.api.client.enums.KeystoreType keystore_type, COM.activesw.api.client.enums.TruststoreType truststore_type, java.lang.String password) throws BrokerException
BrokerFileNotFoundException
- If the certificate file is not found or readable.BrokerNoPermissionException
- If the password is not valid or if the file is not a certificate file.BrokerNullParameterException
- If the cetificate_file, password, or distinguished_name are null.BrokerSecurityException
- If SSL support is not available.BrokerUnknownNameException
- If a distinguished name is specified but does not exist in the certificate file.BrokerException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean getForcedReconnect()
public void setForcedReconnect(boolean forced)
public boolean getRedeliveryCountEnabled()
public void setRedeliveryCountEnabled(boolean on)
public boolean getAutomaticRedeliveryCount()
public void setAutomaticRedeliveryCount(boolean on)
public int getKeepAlivePeriod()
public int getMaxResponseTime()
public int getKeepAliveRetryCount()
public boolean getAckVolatile()
public void setAckVolatile(boolean on)
public void setKeepAlive(int KeepAlivePeriod, int MaxResponseTime, int RetryCount) throws BrokerOutOfRangeException
KeepAlivePeriod
- - valid range from 1 to Integer.MAX_VALUEMaxResponseTime
- - valid range from 1 to KeepAlivePeriodRetryCount
- - valid range from 1 to Integer.MAX_VALUEBrokerOutOfRangeException
- If parameters do not fall within specified rangepublic void setLocale(java.util.Locale locale)
null
will set the connection's locale to that of the Broker's.locale
- The locale for this connection.public java.util.Locale getLocale()
public int getClientStorage()
public void setClientStorage(int s)
public int getClientLifeCycle()
public void setClientLifeCycle(int l)
public boolean getPriorityOrdering()
public void setPriorityOrdering(boolean new_value)
public void setAuthInfo(java.lang.String username, java.lang.String password)
username
- Specifies the basic authentication user namepassword
- Specifies the basic authentication passwordpublic java.lang.String getAuthUserName()
public boolean getSocketTcpNoDelay()
true
if Nagle's algorithm is disabledsetSocketTcpNoDelay(boolean)
public void setSocketTcpNoDelay(boolean socketTcpNoDelay)
socketTcpNoDelay
- true
to disable Nagle's algorithmgetSocketTcpNoDelay()
public java.lang.String getSSLCipherSuites()
public void setSSLCipherSuites(java.lang.String ssl_cipher_suites)
public java.lang.String getSSLProvider()
public void setSSLProvider(java.lang.String ssl_provider)
public int getSocketConnectTimeout()
SOCKET_CONNECT_TIMEOUT
,
setSocketConnectTimeout(int)
public void setSocketConnectTimeout(int socketConnectTimeout)
socketConnectTimeout
- the socket connect timeout in secondsSOCKET_CONNECT_TIMEOUT
,
getSocketConnectTimeout()
public boolean getSocketLinger()
true
if socket linger is enabledSOCKET_LINGER
,
setSocketLinger(boolean)
public void setSocketLinger(boolean socketLinger)
socketLinger
- true
to enable socket lingerSOCKET_LINGER
,
getSocketLinger()
public int getSocketLingerTimeout()
SOCKET_LINGER_TIMEOUT
,
setSocketLingerTimeout(int)
public void setSocketLingerTimeout(int socketLingerTimeout)
socketLingerTimeout
- the socket linger timeoutSOCKET_LINGER_TIMEOUT
,
getSocketLingerTimeout()
public int getSocketSendBufferSize()
SOCKET_SEND_BUFFER_SIZE
,
setSocketSendBufferSize(int)
public void setSocketSendBufferSize(int socketSendBufferSize)
socketSendBufferSize
- the outbound socket buffer sizeSOCKET_SEND_BUFFER_SIZE
,
getSocketSendBufferSize()
public int getSocketRecvBufferSize()
SOCKET_RECV_BUFFER_SIZE
,
setSocketRecvBufferSize(int)
public void setSocketRecvBufferSize(int socketRecvBufferSize)
socketRecvBufferSize
- the inbound socket buffer sizeSOCKET_RECV_BUFFER_SIZE
,
getSocketRecvBufferSize()
public boolean getSocketKeepAliveEnabled()
public void setSocketKeepAliveEnabled(boolean enabled)
Copyright © 2002-2006 webMethods, Inc. Copyright © 2007-2021 Software AG Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.