public class BrokerClusterPublisher
extends java.lang.Object
Constructor and Description |
---|
BrokerClusterPublisher(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
java.lang.String client_group,
java.lang.String app_name,
BrokerConnectionDescriptor desc,
BrokerConnectionDescriptor mon_desc)
Creates a BrokerClusterPublisher.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelConnectionCallback()
Cancel the cluster publisher's connection callback, if any registered.
|
void |
cancelSelectionCallback()
Cancel the cluster publisher's selection callback, if any registered.
|
boolean |
canPublish(java.lang.String event_type_name)
Test if can publish or deliver an event of a given type.
|
void |
deliver(java.lang.String dest_id,
BrokerEvent event)
Deliver one event.
|
void |
deliver(java.lang.String dest_id,
BrokerEvent[] events)
Deliver multiple events.
|
BrokerEvent[] |
deliverRequestAndWait(java.lang.String dest_id,
BrokerEvent event,
int msecs)
Deliver one request event and wait for replies.
|
void |
destroy()
Destroy BrokerClusterPublisher.
|
void |
disconnect()
Disconnect BrokerClusterPublisher.
|
void |
excludeBroker(java.lang.String brokerName)
Exclude specified broker for cluster operations.
|
java.lang.String |
getApplicationName()
Get the application name.
|
java.lang.String[] |
getCanPublishNames()
Get the list of event type names which this client can publish or deliver.
|
java.lang.String |
getClientGroup()
Get the client group name.
|
java.lang.String |
getClientId()
Get the application client identifier.
|
BrokerEvent |
getClusterPublisherInfo()
Get the cluster publisher info.
|
BrokerEvent |
getClusterPublisherStats()
Get the cluster publisher statistics.
|
java.lang.String |
getLastUsed()
Get the broker name on which the last cluster operation was executed.
|
java.lang.String |
getMonitorClientId()
Get the cluster monitor client's identifier.
|
java.lang.String |
getTerritoryName()
Get the territory name of the client's broker.
|
void |
includeBroker(java.lang.String brokerName)
Include specified broker for cluster operations.
|
boolean |
isConnected()
Check if connected.
|
void |
localPublish(BrokerEvent event)
Publish one event to clients on the local broker only.
|
void |
localPublish(BrokerEvent[] events)
Publish multiple events to clients on the local broker only.
|
BrokerEvent[] |
localPublishRequestAndWait(BrokerEvent event,
int msecs)
Publish one request event and wait for replies.
|
static BrokerClusterPublisher |
newOrReconnect(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
java.lang.String client_group,
java.lang.String app_name,
BrokerConnectionDescriptor desc,
BrokerConnectionDescriptor mon_desc)
Attempts to create BrokerClusterPublisher.
|
void |
publish(BrokerEvent event)
Publish one event.
|
void |
publish(BrokerEvent[] events)
Publish multiple events.
|
BrokerEvent[] |
publishRequestAndWait(BrokerEvent event,
int msecs)
Publish one request event and wait for replies.
|
static BrokerClusterPublisher |
reconnect(java.lang.String broker_host,
java.lang.String broker_name,
java.lang.String client_id,
java.lang.String client_group,
java.lang.String app_name,
BrokerConnectionDescriptor desc,
BrokerConnectionDescriptor mon_desc)
Reconnects BrokerClusterPublisher.
|
void |
registerConnectionCallback(BrokerCPConnectionCallback obj,
java.lang.Object client_data)
Register a connection callback for the cluster publisher.
|
void |
registerSelectionCallback(BrokerCPSelectionCallback obj,
java.lang.Object client_data)
Register a cluster publisher selection callback for this client.
|
java.lang.String |
toString()
Returns a string with the client information in a form suitable for human viewing.
|
public BrokerClusterPublisher(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, java.lang.String client_group, java.lang.String app_name, BrokerConnectionDescriptor desc, BrokerConnectionDescriptor mon_desc) throws BrokerException
BrokerClientExistsException
- If a client using the specified client ID already exists.BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerInvalidClientIdException
- If the ID contains illegal characters.BrokerInvalidNameException
- If the app_name contains illegal characters.BrokerNoPermissionException
- If permission to join the specified client group is denied.BrokerNotRunningException
- If the host exists but no broker is running on that host.BrokerNullParameterException
- If broker_host, client_group, or app_name are null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the broker.BrokerUnknownBrokerNameException
- If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.BrokerUnknownClientGroupException
- If the specified client group does not exist on the broker.BrokerException
public void localPublish(BrokerEvent[] events) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If any of the events does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish all of the event types.BrokerNullParameterException
- If events is null, or if any element in the array is null.BrokerUnknownEventTypeException
- If the event type for any of the events does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public void localPublish(BrokerEvent event) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event is null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public BrokerEvent[] localPublishRequestAndWait(BrokerEvent event, int msecs) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event is null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public void publish(BrokerEvent[] events) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If any of the events does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish all of the event types.BrokerNullParameterException
- If events is null, or if any element in the array is null.BrokerUnknownEventTypeException
- If the event type for any of the events does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public void publish(BrokerEvent event) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event is null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public BrokerEvent[] publishRequestAndWait(BrokerEvent event, int msecs) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event is null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public void deliver(java.lang.String dest_id, BrokerEvent[] events) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If any of the events does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish all of the event types.BrokerNullParameterException
- If events is null, or if any element in the array is null.BrokerUnknownEventTypeException
- If the event type for any of the events does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public void deliver(java.lang.String dest_id, BrokerEvent event) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If event is null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public BrokerEvent[] deliverRequestAndWait(java.lang.String dest_id, BrokerEvent event, int msecs) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerInvalidClientIdException
- If the destination ID includes invalid characters.BrokerInvalidEventException
- If the event does not match its type definition.BrokerNoPermissionException
- If the client does not have permission to publish the event type.BrokerNullParameterException
- If dest_id or event are null.BrokerUnknownEventTypeException
- If the event type for the event does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public static BrokerClusterPublisher newOrReconnect(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, java.lang.String client_group, java.lang.String app_name, BrokerConnectionDescriptor desc, BrokerConnectionDescriptor mon_desc) throws BrokerException
BrokerClientContentionException
- If the client ID is already in use by another client. For shared state clients, this means the maximum number of reconnects has been
exceeded.BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerInvalidClientIdException
- If the ID contains illegal characters.BrokerNoPermissionException
- If permission to join the specified client group is denied.BrokerNotRunningException
- If the host exists but no broker is running on that host.BrokerNullParameterException
- If broker_host, client_id, client_group, or app_name are null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the broker.BrokerUnknownBrokerNameException
- If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.BrokerUnknownClientGroupException
- If the specified client group does not exist on the broker.BrokerUnknownClientIdException
- If the specified client ID does not exist on the broker.BrokerException
public static BrokerClusterPublisher reconnect(java.lang.String broker_host, java.lang.String broker_name, java.lang.String client_id, java.lang.String client_group, java.lang.String app_name, BrokerConnectionDescriptor desc, BrokerConnectionDescriptor mon_desc) throws BrokerException
BrokerClientContentionException
- If the client ID is already in use by another client. For shared state clients, this means the maximum number of reconnects has been
exceeded.BrokerCommFailureException
- If problems occur establishing the connection.BrokerHostNotFoundException
- If the specified host does not exist.BrokerNoPermissionException
- If permission to join the specified client group is denied.BrokerNotRunningException
- If the host exists but no broker is running on that host.BrokerNullParameterException
- If broker_host or client_id are null.BrokerSecurityException
- If a secure connection is attempted but is rejected by the broker.BrokerUnknownBrokerNameException
- If the specified broker does not exist. If broker_name is null, this indicates that there is no default broker.BrokerUnknownClientIdException
- If the specified client ID does not exist on the broker.BrokerException
public void disconnect() throws BrokerException
Note that destroy-on-disconnect clients will destroy themselves when disconnect happens, so disconnect is identical to destroy in behavior for such clients. May throw any communications exception, but the local client object is marked as disconnected even if an exception is thrown.
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerClusterPublisherException
- If no client is found on the cluster pool or all the clients have been already destroyed or disconnected.BrokerException
public void destroy() throws BrokerException
BrokerInvalidClientException
- If any of the cluster client has been already destroyed or disconnected.BrokerClusterPublisherException
- If no client is found on the cluster pool or all the clients have been already destroyed or disconnected.BrokerException
public void registerSelectionCallback(BrokerCPSelectionCallback obj, java.lang.Object client_data) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerNullParameterException
- If obj is null.BrokerException
public void cancelSelectionCallback() throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerException
public void registerConnectionCallback(BrokerCPConnectionCallback obj, java.lang.Object client_data) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerNullParameterException
- If obj is null.BrokerException
public void cancelConnectionCallback() throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerException
public void excludeBroker(java.lang.String brokerName) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerClusterPublisherException
- If the specified broker is not part of the cluster publisher operation or the last single broker client connection found on the client
pool.BrokerInvalidPortException
- If the specified port is invalidBrokerException
public void includeBroker(java.lang.String brokerName) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerClusterPublisherException
- If the specified broker was not previously excluded from the client pool or the it is currently present in the client pool.BrokerInvalidPortException
- If the specified port is invalidBrokerException
public java.lang.String getClientGroup()
public java.lang.String getClientId()
public java.lang.String getMonitorClientId()
public boolean isConnected()
public java.lang.String getApplicationName()
public boolean canPublish(java.lang.String event_type_name) throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerNullParameterException
- If event_type_name is null.BrokerUnknownEventTypeException
- If the event type does not exist on the broker.BrokerClusterPublisherException
- If no broker is available on the cluster poolBrokerException
public java.lang.String[] getCanPublishNames() throws BrokerException
BrokerInvalidClientException
- If the client has been disconnected or destroyed.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public java.lang.String getTerritoryName() throws BrokerException
BrokerInvalidClientException
- If the client has been destroyed or disconnected.BrokerClusterPublisherException
- If no broker is available on the cluster pool.BrokerException
public java.lang.String getLastUsed()
public java.lang.String toString()
toString
in class java.lang.Object
public BrokerEvent getClusterPublisherInfo() throws BrokerException
BrokerException
public BrokerEvent getClusterPublisherStats() throws BrokerException
BrokerException
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.