Package COM.activesw.api.client
Class BrokerServerClient
java.lang.Object
COM.activesw.api.client.BrokerServerClient
Representation of an Broker Server client.
Many calls say they can throw a "communications exception". These exceptions are:
-
- BrokerCommFailureException
- If a networking error occurs.
- BrokerConnectionClosedException
- If the Broker disconnects from the application.
- BrokerFailureException
- If an error occurs on the Broker which prevents the operation from being completed.
- BrokerProtocolException
- If an error occurs in communication between the Broker and the application.
- BrokerTimeoutException
- If the request was not handled in a reasonable time. Most operations use the default timeout of 30 seconds.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionBrokerServerClient
(String broker_host, BrokerConnectionDescriptor desc) Create a Broker Server client. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Verifies that the backup of the meta-data is still OK to proceed.void
createBroker
(String broker_name, String description, boolean is_default) Create a Broker.void
destroy()
Destroy the Broker Server client.void
Notifies the Broker that backup of the meta-data is complete.Returns the active Broker Server Filter Collation locale.int
Get the base port currently being used by the Broker Server.Get the process information currently in use by the Broker Server.Get the SSL configuration currently in use on by the Broker Server.Get the SSL configuration currently in use on by the Broker Server.Get the BrokerServer's SSL identity that is currently in use on by the Broker Server.Get the Broker Server's administrative access control list (ACL).int
Returns 1 if the audit error state is enabled and 0 if the audit error state is disabledshort[]
Returns the audit operationsCOM.activesw.api.client.BrokerAuditLogEntry[]
getAuditRecords
(Integer noRecords, Integer AckId, int msecs) Reads the 'noRecords' number of audit records taking into consideration that AckId is the ID of the last record accessed.int
Returns 1 if the audit state is enabled and 0 if the audit state is disabled.Locale[]
COM.activesw.api.client.BrokerBasicAuthIdentity
Returns the Broker Server's basic authentication identity that is in use.boolean
Returns whether basic authentication is configured on Broker Server.Get the list of Brokers in a given server.boolean
Returns whether to bypass basic authentication checks on Broker Server.Get the name of the default Broker in the server.Get the Broker Server description.getDNFromKeystore
(String keystore, String password, BrokerSSLConfigV2.KeystoreType keystoreType) Get the distinguished name in the given keystore on the Broker Server.String[]
getDNsFromCertFile
(String certificate_file, String password) Get the list of distinguished names available in the given certificate file on the Broker Server.protected Locale
getFilterCollationLocaleInternal
(boolean saved) Returns the FIPS mode set on the Broker Server.Get the Broker Server hardware info string.Get the host name of the Broker Server.getIssuerDNFromKeystore
(String keystore, String password, BrokerSSLConfigV2.KeystoreType keystoreType) Get the issuer distinguished name in the given keystore on the Broker Server.Deprecated.Get the Broker Server license file content.Get the Broker Server license file name.Get the Broker server logging configuration.String[]
Get the path names for the MetaData storage files.int
Get the Broker Monitor port managing the current Broker Server.Get the Product display name.int
Get the Broker Server publication processing state.String[]
getRootDNsFromCertFile
(String certificate_file, String password) Get the list of trusted root distinguished names available in the given certificate file on the Broker Server.String[]
getRootDNsFromTruststore
(String truststore, BrokerSSLConfigV2.TruststoreType truststoreType) Get the list of trusted root distinguished names available in the given truststore on the Broker Server.Returns the saved Broker Server Filter Collation locale.Get the SSL configuration to be used next time the Broker Server is started.Get the SSL configuration to be used next time the Broker Server is started.Get the BrokerServer's SSL identity that will be used the next time the Broker Server is restarted.getServerLogEntries
(BrokerDate first_entry, String locale, int num_entries) COM.activesw.api.client.BrokerServerLogInfo
Get the Broker Server log status.static int
getServerProcessRunStatus
(String broker_host) Specifies whether the Broker Server is online, stopped, starting, stopping, unresponsive, failed, or unknown.static int
getServerProcessRunStatus
(String broker_monitor_host, int monitorPort, int brokerPort) Specifies whether the Broker Server is online, stopped, starting, stopping, unresponsive, failed, or unknown.Get the current status of the Broker Server SSL configuration.getStats()
Get the Broker Server statistics.Get the Broker Server storage statistics.Get the Broker Server system usage statistics.Get the Broker Server version string.int
Get the Broker Server's version number.boolean
boolean
Returns true if streaming is enabled on the Broker Server.void
pause Broker Server publication processing.void
pruneServerLog
(BrokerDate older_than) Delete entries from the Broker Server log.void
registerConnectionCallback
(BrokerServerConnectionCallback obj, Object client_data) Register a connection callback for this client.void
resume Broker Server publication processing.void
Set the Broker Server's administrative access control list (ACL).void
setAuditOnErrorState
(int state) Sets audit on error and the action for the audit log error.void
setAuditOperations
(short[] ops) Sets the audit operations as specified by the values in ops.void
setAuditState
(int state) Enables/Disables the audit state.void
setBasicAuthIdentity
(COM.activesw.api.client.BrokerBasicAuthIdentity new_identity) Sets the Broker Server's identity for basic authentication.void
setDefaultBrokerName
(String broker_name) Set the name of the default Broker in the server.void
setDescription
(String description) Set the Broker Server description.void
setFilterCollationLocale
(String locale) Set the Broker Server Filter Collation locale.void
setLicense
(String license) Deprecated.Deprecated in webMethods Broker 9.0, instead usesetLicenseFileName(String)
void
setLicenseContent
(String licenseFileContent) Set the license file content for Broker Server.void
setLicenseFile
(String licenseFile) Deprecated.Deprecated in webMethods Broker 9.0, instead usesetLicenseFileName(String)
void
setLicenseFileName
(String licenseFileName) Set the license file name for Broker Server.void
setLogConfig
(BrokerLogConfig log_config) Set the Broker Server logging configuration.void
setSSLConfig
(BrokerSSLConfig new_config) Set the SSL configuration to be used next time the Broker Server is started.void
setSSLConfig
(String certificate_file, String password, String distinguished_name) Set the SSL configuration to be used next time the Broker Server is started.void
setSSLConfigV2
(BrokerSSLConfigV2 new_config) Set the SSL configuration to be used next time the Broker server is started.boolean
Notifies the Broker that backup of the meta-data is going to start.static void
startServerProcess
(String broker_host) Start the Broker Server process (if it is not already started).static void
startServerProcess
(String broker_monitor_host, int monitorPort, int brokerPort) Start the Broker Server process (if it is not already started).void
Stop the Broker Server process.toString()
Get a string with the server client information in a form suitable for human viewing.
-
Field Details
-
BROKER_SERVER_DEFAULT_PORT
public static final int BROKER_SERVER_DEFAULT_PORT- See Also:
-
SERVER_STATUS_STARTING
public static final int SERVER_STATUS_STARTING- See Also:
-
SERVER_STATUS_RUNNING
public static final int SERVER_STATUS_RUNNING- See Also:
-
SERVER_STATUS_STOPPING
public static final int SERVER_STATUS_STOPPING- See Also:
-
SERVER_STATUS_STOPPED
public static final int SERVER_STATUS_STOPPED- See Also:
-
SERVER_STATUS_ERROR
public static final int SERVER_STATUS_ERROR- See Also:
-
SERVER_STATUS_UNKNOWN
public static final int SERVER_STATUS_UNKNOWN- See Also:
-
SERVER_STATUS_FAILED
public static final int SERVER_STATUS_FAILED- See Also:
-
SSL_STATUS_ENABLED
public static final int SSL_STATUS_ENABLED- See Also:
-
SSL_STATUS_ERROR
public static final int SSL_STATUS_ERROR- See Also:
-
SSL_STATUS_DISABLED
public static final int SSL_STATUS_DISABLED- See Also:
-
SSL_STATUS_NOT_SUPPORTED
public static final int SSL_STATUS_NOT_SUPPORTED- See Also:
-
SERVER_LOG_ALL_ENTRIES
public static final int SERVER_LOG_ALL_ENTRIES- See Also:
-
PUBLISH_PROCESSING_ACTIVE
public static final int PUBLISH_PROCESSING_ACTIVE- See Also:
-
PUBLISH_PROCESSING_PAUSE
public static final int PUBLISH_PROCESSING_PAUSE- See Also:
-
-
Constructor Details
-
BrokerServerClient
public BrokerServerClient(String broker_host, BrokerConnectionDescriptor desc) throws BrokerException Create a Broker Server client. A server client is used to by administration applications to manage Broker and system functions of Brokers in that server. A Broker Server client is said to have "limited access" if it is not authorized under the host's ACL. Some operations will give BrokerNoPermissionExceptions to clients with limited access. The shared state flag of the BrokerConnectionDescriptor is always ignored.- Throws:
BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerNotRunningException
- If the host exists but no Broker Server is running on that host.BrokerNullParameterException
- If broker_host is null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the Broker Server.BrokerException
-
-
Method Details
-
destroy
Destroy the Broker Server client. Disconnects from the Broker Server. May throw any communications exception, but the local client object is marked as disconnected even if an exception is thrown.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getAdminACL
Get the Broker Server's administrative access control list (ACL).- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerException
-
setAdminACL
Set the Broker Server's administrative access control list (ACL).- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerNullParameterException
- If ACL is null.BrokerException
-
getDNFromKeystore
public String getDNFromKeystore(String keystore, String password, BrokerSSLConfigV2.KeystoreType keystoreType) throws BrokerException Get the distinguished name in the given keystore on the Broker Server.The keystoreType parameter specifies the type of keystore: either PKCS12 or PEM. If the keystoreType is null, the type is assumed to be PKCS12.
- Throws:
BrokerFileNotFoundException
- If the keystore is not found or cannot be read.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the password is invalid or if the file is not a keystore, or if the client has limited access.BrokerNullParameterException
- If keystore is null.BrokerSSLConfigException
- If the keystoreType is invalid.BrokerException
-
getIssuerDNFromKeystore
public String getIssuerDNFromKeystore(String keystore, String password, BrokerSSLConfigV2.KeystoreType keystoreType) throws BrokerException Get the issuer distinguished name in the given keystore on the Broker Server.The keystoreType parameter specifies the type of keystore: either PKCS12 or PEM. If the keystoreType is null, the type is assumed to be PKCS12.
- Throws:
BrokerFileNotFoundException
- If the keystore is not found or cannot be read.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the password is invalid or if the file is not a keystore, or if the client has limited access.BrokerNullParameterException
- If keystore is null.BrokerSSLConfigException
- If the keystoreType is invalid.BrokerException
-
getRootDNsFromTruststore
public String[] getRootDNsFromTruststore(String truststore, BrokerSSLConfigV2.TruststoreType truststoreType) throws BrokerException Get the list of trusted root distinguished names available in the given truststore on the Broker Server.The truststoreType parameter specifies the type of truststore: either PEM or DIR. If the truststoreType is null, the type is assumed to be PEM.
- Throws:
BrokerFileNotFoundException
- If the certificate file is not found or cannot be read.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the password is invalid or if the file is not a certificate file, or if the client has limited access.BrokerNullParameterException
- If certificate_file is null.BrokerException
-
getDNsFromCertFile
Get the list of distinguished names available in the given certificate file on the Broker Server. The password parameter may be null if the certificate_file is the same as the Broker's active certificate file. In these cases, the Broker's active certificate file and password are used. If the Broker does not currently have an active SSL setup, then null parameter exceptions will be returned as appropriate.- Throws:
BrokerFileNotFoundException
- If the certificate file is not found or cannot be read.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the password is invalid or if the file is not a certificate file, or if the client has limited access.BrokerNullParameterException
- If certificate_file is null.BrokerException
-
getRootDNsFromCertFile
public String[] getRootDNsFromCertFile(String certificate_file, String password) throws BrokerException Get the list of trusted root distinguished names available in the given certificate file on the Broker Server. The password parameter may be null if the certificate_file is the same as the Broker's active certificate file. In these cases, the Broker's active certificate file and password are used. If the Broker does not currently have an active SSL setup, then null parameter exceptions will be returned as appropriate.- Throws:
BrokerFileNotFoundException
- If the certificate file is not found or cannot be read.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the password is invalid or if the file is not a certificate file, or if the client has limited access.BrokerNullParameterException
- If certificate_file is null.BrokerException
-
getActiveSSLConfigV2
Get the SSL configuration currently in use on by the Broker Server. This may not be the same as the most recently set configuration. See setSSLConfig() for more information.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerIncompatibleVersionException
- If the Broker does not support the old form of SSL configuration.BrokerException
-
getSavedSSLConfigV2
Get the SSL configuration to be used next time the Broker Server is started. This may not be the same as the active configuration. See setSSLConfig() for more information.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerIncompatibleVersionException
- If the Broker does not support the old form of SSL configuration.BrokerException
-
setSSLConfigV2
Set the SSL configuration to be used next time the Broker server is started. To disable SSL, set the keystore to null. Note that the Broker keeps both its active SSL configuration and a saved configuration to use on the next startup. This is because the Broker must be restarted to change its SSL configuration. When the configuration is first made, the Broker will immediately adopt it, but all future changes are merely saved away for the next restart. Thus, the active and saved configurations might not match.- Throws:
BrokerFileNotFoundException
- If the certificate file is not found or cannot be read.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the password is invalid or if the file is not a certificate file, or if the client has limited access.BrokerNullParameterException
- If distinguished_name is null when certificate_file is non-null.BrokerUnknownNameException
- If a distinguished name is specified but does not exist in the certificate file.BrokerIncompatibleVersionException
- If the Broker does not support the new form of SSL configuration.BrokerSSLConfigException
- If there is a problem with the SSL configuration.BrokerException
-
setBasicAuthIdentity
public void setBasicAuthIdentity(COM.activesw.api.client.BrokerBasicAuthIdentity new_identity) throws BrokerException Sets the Broker Server's identity for basic authentication. To disable Basic Auth, set the user name to null.- Throws:
BrokerInvalidClientException
- The BrokerServerClient has been destroyed or is disconnected.BrokerIncompatibleVersionException
- Broker Server does not support this operation.BrokerNullParameterException
- The new_identity parameter is null.COM.activesw.api.client.BrokerBasicAuthFailureException
- Basic Authentication failed for the user.BrokerException
-
getBasicAuthIdentity
public COM.activesw.api.client.BrokerBasicAuthIdentity getBasicAuthIdentity() throws BrokerExceptionReturns the Broker Server's basic authentication identity that is in use.- Throws:
BrokerInvalidClientException
- The BrokerServerClient has been destroyed or is disconnected.BrokerNoPermissionException
- The client does not have permission to obtain the Broker's basic authentication identity.BrokerIncompatibleVersionException
- Broker Server does not support this operation.BrokerException
-
getActiveSSLConfig
Get the SSL configuration currently in use on by the Broker Server. This may not be the same as the most recently set configuration. See setSSLConfig() for more information.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerIncompatibleVersionException
- If the Broker does not support the old form of SSL configuration.BrokerException
-
getSavedSSLConfig
Get the SSL configuration to be used next time the Broker Server is started. This may not be the same as the active configuration. See setSSLConfig() for more information.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerIncompatibleVersionException
- If the Broker does not support the old form of SSL configuration.BrokerException
-
setSSLConfig
public void setSSLConfig(String certificate_file, String password, String distinguished_name) throws BrokerException Set the SSL configuration to be used next time the Broker Server is started. To disable SSL, set the certificate_file to null. To change the distinguished name within the same file without giving the password again, pass the current certificate_file with the password as null. Note that the Broker keeps both its active SSL configuration and a saved configuration to use on the next startup. This is because the Broker must be restarted to change its SSL configuration. When the configuration is first made, the Broker will immediately adopt it, but all future changes are merely saved away for the next restart. Thus, the active and saved configurations may not match.- Throws:
BrokerFileNotFoundException
- If the certificate file is not found or cannot be read.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the password is invalid or if the file is not a certificate file, or if the client has limited access.BrokerNullParameterException
- If distinguished_name is null when certificate_file is non-null.BrokerUnknownNameException
- If a distinguished name is specified but does not exist in the certificate file.BrokerIncompatibleVersionException
- If the Broker does not support the old form of SSL configuration.BrokerException
-
setSSLConfig
Set the SSL configuration to be used next time the Broker Server is started. To disable SSL, set the certificate_file to null. To change the distinguished name within the same file without giving the password again, pass the current certificate_file with the password as null. Note that the Broker keeps both its active SSL configuration and a saved configuration to use on the next startup. This is because the Broker must be restarted to change its SSL configuration. When the configuration is first made, the Broker will immediately adopt it, but all future changes are merely saved away for the next restart. Thus, the active and saved configurations might not match.- Throws:
BrokerFileNotFoundException
- If the certificate file is not found or cannot be read.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the password is invalid or if the file is not a certificate file, or if the client has limited access.BrokerNullParameterException
- If distinguished_name is null when certificate_file is non-null.BrokerUnknownNameException
- If a distinguished name is specified but does not exist in the certificate file.BrokerIncompatibleVersionException
- If the Broker does not support the old form of SSL configuration.BrokerException
-
getActiveSSLIdentity
Get the BrokerServer's SSL identity that is currently in use on by the Broker Server. This may not be the same as the one most recently set.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerIncompatibleVersionException
- If the Broker does not support this call.BrokerException
-
getSavedSSLIdentity
Get the BrokerServer's SSL identity that will be used the next time the Broker Server is restarted. This may not be the same as the active identity.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerIncompatibleVersionException
- If the Broker does not support this call.BrokerException
-
getSSLStatus
Get the current status of the Broker Server SSL configuration. This operation is open to all users. The level value can be any of the BrokerConnectionDescriptor.ENCRYPT_LEVEL_* values. The status value can be any of the SSL_STATUS_* values. If the value is SSL_STATUS_ERROR, then the error string is set to a description of the failure, otherwise it is null.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getBasicAuthStatus
Returns whether basic authentication is configured on Broker Server. The possible values are "True" and "False". This operation is open to all users.- Throws:
BrokerInvalidClientException
- The BrokerServerClient has been destroyed or is disconnected.BrokerIncompatibleVersionException
- Broker Server does not support this operation.BrokerException
-
getBypassAuthCheckStatus
Returns whether to bypass basic authentication checks on Broker Server. The possible values are "True" and "False". This operation is open to all users.- Throws:
BrokerInvalidClientException
- The BrokerServerClient has been destroyed or is disconnected.BrokerIncompatibleVersionException
- Broker Server does not support this operation.BrokerException
-
getHostName
Get the host name of the Broker Server. -
getActivePort
Get the base port currently being used by the Broker Server. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getMonitorPort
Get the Broker Monitor port managing the current Broker Server. This operation is open to all users.- Returns:
- the Monitor port managing this server
- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getActiveProcessInfo
Get the process information currently in use by the Broker Server.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerException
-
getLogConfig
Get the Broker server logging configuration. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
setLogConfig
Set the Broker Server logging configuration. Any log config entries which have the 'value' parameter set, when the value is not required by the config entry will simply cause the value to be ignored.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerInvalidLogConfigException
- If one or more log configuration entries are not valid. If this exception is thrown, all valid entries are still set.BrokerNoPermissionException
- If the client has limited access.BrokerException
-
getServerLogStatus
Get the Broker Server log status.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the version of the Broker is known not to this operation.BrokerNoPermissionException
- If the client has limited access.BrokerException
-
getServerLogEntries
public BrokerServerLogEntry[] getServerLogEntries(BrokerDate first_entry, String locale, int num_entries) throws BrokerException - Throws:
BrokerException
-
pruneServerLog
Delete entries from the Broker Server log. Deletes all entries from the given date (inclusive) and older.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the version of the Broker is known not to this operation.BrokerNullParameterException
- If older_than is null.BrokerNoPermissionException
- If the client has limited access.BrokerException
-
getLicense
Deprecated.Deprecated in webMethods Broker 9.0, instead usegetLicenseFileName()
- Throws:
BrokerException
-
setLicense
Deprecated.Deprecated in webMethods Broker 9.0, instead usesetLicenseFileName(String)
- Throws:
BrokerException
-
setLicenseFile
Deprecated.Deprecated in webMethods Broker 9.0, instead usesetLicenseFileName(String)
- Throws:
BrokerException
-
getLicenseFileName
Get the Broker Server license file name. Returns the license file name for webMethods Broker 8.0 or later. Returns the license key for webMethods Broker 7.1.2 or earlier versions.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerException
-
setLicenseFileName
Set the license file name for Broker Server. Set the license file name for webMethods Broker 8.0 or later. Set the license key for webMethods Broker 7.1.2 or earlier versions.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerInvalidLicenseException
- If the license file is not a valid license file.BrokerNoPermissionException
- If the client has limited access.BrokerNullParameterException
- If license is null.BrokerException
-
getLicenseContent
Get the Broker Server license file content. Applicable only for webMethods Broker version 8.0 or later.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker does not support getLicenseContentBrokerNoPermissionException
- If the client has limited access.BrokerException
-
setLicenseContent
Set the license file content for Broker Server. Applicable only for webMethods Broker version 8.0 or later.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerInvalidLicenseException
- If the license file is not a valid license file.BrokerNoPermissionException
- If the client has limited access.BrokerIncompatibleVersionException
- If the Broker Server does not support setLicenseContentBrokerNullParameterException
- If license is null.BrokerException
-
getDescription
Get the Broker Server description. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
setDescription
Set the Broker Server description.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerNullParameterException
- If description is null.BrokerException
-
getVersionNumber
public int getVersionNumber()Get the Broker Server's version number. Returns one of the BrokerClient.VERSION_* contant values.If the Broker Server is newer than the client's version, the client's version is reported.
-
getVersion
Get the Broker Server version string. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getProductDisplayName
Get the Product display name. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getHardwareInfo
Get the Broker Server hardware info string.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getServerProcessRunStatus
Specifies whether the Broker Server is online, stopped, starting, stopping, unresponsive, failed, or unknown. The state can be any of the following values:SERVER_STATUS_STARTING
,SERVER_STATUS_RUNNING
,SERVER_STATUS_STOPPING
,SERVER_STATUS_STOPPED
,SERVER_STATUS_ERROR
,SERVER_STATUS_UNKNOWN
,SERVER_STATUS_FAILED
. Broker Monitor running at default portBrokerMonitorClient.BROKER_MONITOR_DEFAULT_PORT
is queried for the Broker Server status. UsegetServerProcessRunStatus(String, int, int)
to query Broker Monitor running at non-default port.- Parameters:
broker_host
- Broker Server host name, e.g. "localhost:6859"- Throws:
BrokerException
BrokerHostNotFoundException
- If the specified host does not exist.BrokerInvalidClientException
- If the client has been destroyed.BrokerNotRunningException
- If the host exists but no Broker Monitor is running on that host.BrokerNullParameterException
- If broker_host is null.BrokerUnknownServerException
- If the specified host has a monitor running, but no server is configured on the specified port.
-
getServerProcessRunStatus
public static int getServerProcessRunStatus(String broker_monitor_host, int monitorPort, int brokerPort) throws BrokerException Specifies whether the Broker Server is online, stopped, starting, stopping, unresponsive, failed, or unknown. The state can be any of the following values:SERVER_STATUS_STARTING
,SERVER_STATUS_RUNNING
,SERVER_STATUS_STOPPING
,SERVER_STATUS_STOPPED
,SERVER_STATUS_ERROR
,SERVER_STATUS_UNKNOWN
,SERVER_STATUS_FAILED
.- Parameters:
broker_monitor_host
- Broker Monitor host name, e.g. "localhost"monitorPort
- Broker Monitor portbrokerPort
- Broker Server port- Throws:
BrokerException
BrokerHostNotFoundException
- If the specified host does not exist.BrokerInvalidClientException
- If the client has been destroyed.BrokerNotRunningException
- If the host exists but no Broker Monitor is running on that host.BrokerNullParameterException
- If broker_host is null.BrokerUnknownServerException
- If the specified host has a monitor running, but no server is configured on the specified port.
-
startServerProcess
Start the Broker Server process (if it is not already started). Broker Monitor running at default portBrokerMonitorClient.BROKER_MONITOR_DEFAULT_PORT
is used for starting the Broker Server. UsestartServerProcess(String, int, int)
to use Broker Monitor running at non-default port.- Parameters:
broker_host
- Broker Server host with port, e.g. "localhost:6849"- Throws:
BrokerException
BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerNotRunningException
- If the host exists but no Broker Server is running on that host.BrokerNullParameterException
- If broker_host is null.BrokerUnknownServerException
- If the specified host has a monitor running, but no server is configured on the specified port.
-
startServerProcess
public static void startServerProcess(String broker_monitor_host, int monitorPort, int brokerPort) throws BrokerException Start the Broker Server process (if it is not already started).- Parameters:
broker_monitor_host
- Broker Monitor host name, e.g. "localhost"monitorPort
- Broker Monitor portbrokerPort
- Broker Server port- Throws:
BrokerException
BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerNotRunningException
- If the host exists but no Broker Server is running on that host.BrokerNullParameterException
- If broker_host is null.BrokerUnknownServerException
- If the specified host has a monitor running, but no server is configured on the specified port.
-
stopProcess
Stop the Broker Server process. This operation will also destroy() this client.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerException
-
getStats
Get the Broker Server statistics. Each statistic is stored as a field in the event object. The statistics are:- now -- (date) Current time on the Broker Server's host.
- createTime -- (date) Time when the server was first started.
- serverStartTime -- (date) Time when the server was most recently started.
- numConnections -- (int) Current number of non-SSL connections.
- numSSLConnections -- (int) Current number of SSL connections.
- highestNumConnections -- (int) Highest number of non-SSL connections since the last time the server was started.
- highestNumSSLConnections -- (int) Highest number of SSL connections since the last time the server was started.
- highestNumConnectionsTime -- (date) Time when highestNumConnections last changed. Forever (zero date and time) if never had a non-SSL connect since the last time the server started.
- highestNumSSLConnectionsTime -- (date) Time when highestNumSSLConnections last changed. Forever (zero date and time) if never had an SSL connect since the last time the server started.
- licensedConections -- (int) Licensed number of total SSL and non-SSL connections. -1 if not limited.
- licensedSSLConections -- (int) Licensed number of SSL connections. -1 if not limited.
- isLicenseExpiringSoon -- (boolean) True if expiring within a month.
- isLicenseExpired -- (boolean) True if expired already.
- licenseExpirationTime -- (date) When the license expires. Forever (zero date and time) if will not expire.
- licenseTimeRemaining -- (int) Number of seconds until license expires. Forever (zero date and time) if will not expire.
- isMeteringEnabled -- (boolean) True if license metering is enabled.
- meteringLastReportTime -- (date) Last metering submission time to metering-agent.
- meteringDeltaBytesIn -- (long) Number of bytes published in current metering interval.
- meteringDeltaBytesOut -- (long) Number of bytes subscribed in current metering interval.
- meteringDeltaMessagesIn -- (long) Number of messages published in current metering interval.
- meteringDeltaMessagesOut -- (long) Number of messages subscribed in current metering interval.
- meteringDeltaTransactions -- (long) Number of new transactions in current metering interval.
- meteringDeltaConnections -- (long) Number of new connections in current metering interval.
- isDiskSpaceLow -- (boolean) True if disk free < 1 Meg.
- isDiskSpaceVeryLow -- (boolean) True if disk free < 100k.
- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getUsageStats
Get the Broker Server system usage statistics. Each statistic is stored as a field in the event object.- now -- (date) Current time on the Broker Server's host.
- userTimeUsed -- (double) Number of seconds (or fractions thereof) of CPU user time used by the Broker since it started.
- systemTimeUsed -- (double) Number of seconds (or fractions thereof) of CPU system time used by the Broker since it started.
- percentageCPUUsed -- (double) Percentage of host CPU used by Broker. This is an instantaneous value, not a long term one. Note: this is not set at all on the Windows platform.
- guaranteedSpaceUsed -- (long) Number of kbytes the guaranteed storage is using on the disk.
- guaranteedSpaceReserved -- (long) Number of kbytes the reserved for guaranteed storage on the disk. If zero, then storage will be resized as needed. If non-zero, then storage will be fixed at this size.
- guaranteedSpaceMax -- (long) The maximum number of kbytes the guaranteed storage can grow to due to system limits, if disk space or reservation limits are not hit first.
- guaranteedDiskSize -- (long) Size of the guaranteed store disk in kbytes.
- guaranteedDiskFree -- (long) Amount of free space on the disk in kbytes.
- guaranteedDiskName -- (unicode string) Name of the guaranteed disk partition.
- persistentSpaceUsed -- (long) Number of kbytes the persistent storage is using on the disk.
- persistentSpaceMax -- (long) The maximum number of kbytes the persistent storage can grow to due to system limits, if disk space or reservation limits are not hit first.
- persistentDiskSize -- (long) Size of the persistent store disk in kbytes.
- persistentDiskFree -- (long) Amount of free space on the disk in kbytes.
- persistentDiskName -- (unicode string) Name of the persistent disk partition.
- swapSpaceFree -- (long) Number of kbytes of free swap space.
- swapSpaceMax -- (long) Total number of kbytes of swap space.
- systemMemorySize -- (long) Total number of kbytes of system memory.
- maxMemorySize -- (long) Number of kbytes Broker sets as a limit for memory usage.
- memoryUsed -- (long) Total number of kbytes allocated by Broker on Heap.
- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getStorageStats
Get the Broker Server storage statistics. Each statistic is stored as a field in the event object.- now -- (date) Current time on the Broker Server's host.
- sessions -- (structure array) An array of structures describing statistics of each of the storage files used.
- sessions[].session_url -- (unicode string) url describing the storage file name.
- sessions[].stats[] -- (structure array) An array of structures describing statistics of each of the storage files employed by the specified session.
- sessions[].stats[].filename -- (unicode string) Storage file name
- sessions[].stats[].max_kbytes_available -- (long) Maximum storage size available.
- sessions[].stats[].current_kbytes_reserved -- (long) Current storage size reserved.
- sessions[].stats[].current_kbytes_inuse -- (long) Current storage size in use.
- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
setFilterCollationLocale
Set the Broker Server Filter Collation locale. Effective the next time the server restarts.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerNullParameterException
- If description is null.BrokerInvalidNameException
- If the locale name is invalid.BrokerException
-
getActiveFilterCollationLocale
Returns the active Broker Server Filter Collation locale.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerNullParameterException
- If description is null.BrokerInvalidNameException
- If the locale name is invalid.BrokerException
-
getSavedFilterCollationLocale
Returns the saved Broker Server Filter Collation locale.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerNullParameterException
- If description is null.BrokerInvalidNameException
- If the locale name is invalid.BrokerException
-
getFilterCollationLocaleInternal
- Throws:
BrokerException
-
createBroker
public void createBroker(String broker_name, String description, boolean is_default) throws BrokerException Create a Broker. It can optionally be created as the default Broker.- Throws:
BrokerExistsException
- If a Broker with the given name already exists.BrokerInvalidBrokerNameException
- If the Broker name is not valid.BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerNullParameterException
- If broker_name or description are is null.BrokerException
-
getBrokers
Get the list of Brokers in a given server. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getDefaultBrokerName
Get the name of the default Broker in the server. Returns null if there is no default Broker. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
setDefaultBrokerName
Set the name of the default Broker in the server. If broker_name is null, then there will be no default Broker.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access.BrokerUnknownBrokerNameException
- If the Broker does not exist in the server.BrokerException
-
registerConnectionCallback
public void registerConnectionCallback(BrokerServerConnectionCallback obj, Object client_data) throws BrokerException Register a connection callback for this client. Calling this on a client which already has an existing callback will replace that callback. 'obj' may be null to clear the callback. 'client_data' may be null. The callback method will be called with connect_state set to BrokerClient.CONNECT_STATE_DISCONNECTED if the client is disconnected. It will be called with BrokerClient.CONNECT_STATE_CONNECTED if the client connection is re-established (only happens if automatic reconnect is enabled). It will be called with BrokerClient.CONNECT_STATE_RECONNECTED if the disconnect is discovered, but the connection is re-established immediately (only happens if automatic reconnect is enabled).- Throws:
BrokerInvalidClientException
- If the client has been disconnected or destroyed.BrokerException
-
startMetaDataBackup
Notifies the Broker that backup of the meta-data is going to start.- Returns:
- True if it is safe to proceed with the backup
- Throws:
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerIncompatibleVersionException
- If the Broker does not support changelocks.BrokerException
-
endMetaDataBackup
Notifies the Broker that backup of the meta-data is complete.- Throws:
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerIncompatibleVersionException
- If the Broker does not support changelocks.BrokerException
-
checkMetaDataBackup
Verifies that the backup of the meta-data is still OK to proceed.- Throws:
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerIncompatibleVersionException
- If the Broker does not support changelocks.BrokerException
-
getMetaDataStorageFiles
Get the path names for the MetaData storage files.- Throws:
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerIncompatibleVersionException
- If the Broker does not support changelocks.BrokerException
-
toString
Get a string with the server client information in a form suitable for human viewing. Returns null if the server client is not valid. -
getAvailableLocales
- Throws:
BrokerException
-
getPublicationProcessingState
Get the Broker Server publication processing state. This operation is open to all users.- Returns:
- the publication processing state of this server. PUBLISH_PROCESSING_ACTIVE (0) - event publication is active PUBLISH_PROCESSING_PAUSE (1) - event publication is paused
- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
pausePublishProcessing
pause Broker Server publication processing. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
resumePublishProcessing
resume Broker Server publication processing. This operation is open to all users.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerException
-
getAuditRecords
public COM.activesw.api.client.BrokerAuditLogEntry[] getAuditRecords(Integer noRecords, Integer AckId, int msecs) throws BrokerException Reads the 'noRecords' number of audit records taking into consideration that AckId is the ID of the last record accessed. Throws the timeout exception if the Broker Server does not respond.- Parameters:
noRecords
- Number of records to be read from the Audit log. This number must be less than the total number of audit records.AckId
- This is an optional parameter. This is the ID of the last record read.msecs
- The number of milliseconds to wait for a reply from the Broker Server before timing out.- Throws:
BrokerException
BrokerTimeoutException
- If the request was not handled within msecs (No audit log entries in this case)BrokerInvalidClientException
- If the client has been destroyed.BrokerNoPermissionException
- If the client has limited access or has no permission to retrieve the audit records.
-
setAuditOperations
Sets the audit operations as specified by the values in ops.- Parameters:
ops
- Ops is an array of Boolean values to enable/disable the audit operations. Array index - Operation 0 - CONNECTION 1 - SESSION 2 - SERVER MODIFICATION3 - SERVER SECURITY 4 - SERVER START/STOP 5 - BROKER MODIFICATION 6 - DOCTYPE MODIFICATION 7 - CLIENTGROUP MODIFICATION 8 - CLIENTGROUP SECURITY 9 - GATEWAY MODIFICATION 10 - TERRITORY MODIFICATION 11 - CLIENT QUEUE- Throws:
BrokerException
BrokerTimeoutException
- If the request was not handled within the default timeout of 30000 milliseconds.BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker Server version is incompatible and does not support the old form of SSL configuration.BrokerNoPermissionException
- If the client has limited access or has no permission to set the audit operations.
-
setAuditState
Enables/Disables the audit state.- Parameters:
state
- Boolean value to enable or disable audit logging.- Throws:
BrokerException
BrokerTimeoutException
- If the request was not handled within the default timeout of 30000 milliseconds.BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker Server version is incompatible and does not support the old form of SSL configuration.BrokerNoPermissionException
- If the client has limited access or has no permission to set the audit state.
-
getAuditState
Returns 1 if the audit state is enabled and 0 if the audit state is disabled.- Throws:
BrokerException
BrokerTimeoutException
- If the request was not handled within the default timeout of 30000 milliseconds.BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker Server version is incompatible and does not support the old form of SSL configuration.BrokerNoPermissionException
- If the client has limited access or has no permission to get the audit state.
-
setAuditOnErrorState
Sets audit on error and the action for the audit log error. Specify 1 to enable the audit logging error action. Specifies whether or not to perform an audit logging operation if there is an error during audit logging.- Parameters:
state
- Enable or disable auditing when an error occurs.- Throws:
BrokerException
BrokerTimeoutException
- If the request was not handled within the default timeout of 30000 milliseconds.BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker Server version is incompatible and does not support the old form of SSL configuration.BrokerNoPermissionException
- If the client has limited access or has no permission to set the audit on error state.
-
getAuditOnErrorState
Returns 1 if the audit error state is enabled and 0 if the audit error state is disabled- Throws:
BrokerException
BrokerTimeoutException
- If the request was not handled within the default timeout of 30000 milliseconds.BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker Server version is incompatible and does not support the old form of SSL configuration.BrokerNoPermissionException
- If the client has limited access or has no permission to get the audit on error state.
-
getAuditOperations
Returns the audit operations- Throws:
BrokerException
BrokerTimeoutException
- If the request was not handled within the default timeout of 30000 milliseconds.BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker Server version is incompatible and does not support the old form of SSL configuration.BrokerNoPermissionException
- If the client has limited access or has no permission to get the audit operations.
-
isConnectionUsingSSL
- Throws:
BrokerInvalidClientException
-
getFipsMode
Returns the FIPS mode set on the Broker Server.- Returns:
- the version of Open SSL used if FIPS mode is enabled or null if FIPS mode is disabled.
- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker does not support getFipsModeBrokerNoPermissionException
- If the client has limited access.BrokerTimeoutException
- If the request was not handled in a reasonable time.BrokerException
-
isStreamingEnabled
Returns true if streaming is enabled on the Broker Server.- Throws:
BrokerInvalidClientException
- If the client has been destroyed.BrokerIncompatibleVersionException
- If the Broker does not support streaming.BrokerNoPermissionException
- If the client has limited access.BrokerTimeoutException
- If the request was not handled in a reasonable time.BrokerException
-
getConnectionDescriptor
-
getLicenseFileName()