Class BrokerCompleteTerritoryGateway
- java.lang.Object
-
- COM.activesw.api.client.BrokerCompleteTerritoryGateway
-
public class BrokerCompleteTerritoryGateway extends java.lang.Object
Holds all of the information describing a broker as far as import and export are concerned.
-
-
Field Summary
Fields Modifier and Type Field Description BrokerAccessControlList
acl
BrokerTerritoryGatewayInfo
info
java.lang.String[]
remote_can_publish
BrokerSubscription[]
remote_can_subscribe
-
Constructor Summary
Constructors Constructor Description BrokerCompleteTerritoryGateway()
Constructor.BrokerCompleteTerritoryGateway(BrokerClusterGatewayInfo clusterGWInfo)
Constructor.BrokerCompleteTerritoryGateway(BrokerTerritoryGatewayInfo info)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
refresh(BrokerAdminClient client)
Refreshes the information about a Territory Gateway based on the given broker admin client.static BrokerCompleteTerritoryGateway
retrieve(BrokerAdminClient client, java.lang.String territory_name)
Retrieves the information about a Territory Gateway based on the given broker admin client.void
store(BrokerAdminClient client)
Stores the information from this Territory Gateway into the broker for which the given client object has been provided.void
store(BrokerAdminClient client, boolean clusterGateway)
java.lang.String
toString()
Converts this Territory Gateway's information into a string.java.lang.String
toString(int indent_level)
Converts this Territory Gateway's information into a string.void
write(java.io.Writer writer, int indent_level)
Writes this Territory Gateway's information out in a textual format.
-
-
-
Field Detail
-
info
public BrokerTerritoryGatewayInfo info
-
acl
public BrokerAccessControlList acl
-
remote_can_publish
public java.lang.String[] remote_can_publish
-
remote_can_subscribe
public BrokerSubscription[] remote_can_subscribe
-
-
Constructor Detail
-
BrokerCompleteTerritoryGateway
public BrokerCompleteTerritoryGateway()
Constructor.
-
BrokerCompleteTerritoryGateway
public BrokerCompleteTerritoryGateway(BrokerTerritoryGatewayInfo info)
Constructor. Sets the remote territory info.
-
BrokerCompleteTerritoryGateway
public BrokerCompleteTerritoryGateway(BrokerClusterGatewayInfo clusterGWInfo)
Constructor. Sets the remote territory info.
-
-
Method Detail
-
retrieve
public static BrokerCompleteTerritoryGateway retrieve(BrokerAdminClient client, java.lang.String territory_name) throws BrokerException
Retrieves the information about a Territory Gateway based on the given broker admin client.- Throws:
BrokerNullParameterException
- If client or territory_name are null.BrokerInvalidClientException
- If client has been destroyed or disconnected.BrokerNotInTerritoryException
- If the broker is not a member of a territory.BrokerUnknownTerritoryException
- If there is no gateway to the specified territory from this broker.BrokerException
-
refresh
public void refresh(BrokerAdminClient client) throws BrokerException
Refreshes the information about a Territory Gateway based on the given broker admin client.- Throws:
BrokerNullParameterException
- If client or info or info.remote_territory_name are null.BrokerInvalidClientException
- If client has been destroyed or disconnected.BrokerNotInTerritoryException
- If the broker is not a member of a territory.BrokerUnknownTerritoryException
- If there is no gateway to the specified territory from this broker.BrokerException
-
store
public void store(BrokerAdminClient client) throws BrokerException
Stores the information from this Territory Gateway into the broker for which the given client object has been provided. It does this by first confirming that the gateway to the remote territory exists. If it does not it is created.Other gateways already configured for the broker are not deleted.
Only the following BrokerTerritoryGatewayInfo members are used during a store: remote_territory_name, remote_host_name, remote_broker_name, auth_type, and encrypt_level.
All specifics about a Territory Gateway are overwritten, except that if a local territory gateway already exists, but connects to a different remote broker and host than those specified, that part of the situation is not altered.
- The auth_type and encrypt_level in the info member replace the current settings on the Territory Gateway.
- If the access control list is set it replaces the existing one.
- If either of the remote_can_publish or remote_can_subscribe lists is non-null, the shared event types list for the gateway is replaced. The sub_id fields in the remote_can_subscribe array are ignored.
- Throws:
BrokerInvalidAccessListException
- If the access list is not valid.BrokerNullParameterException
- If the client parameter is null or the instance variable info or info.remote_territory_name are null.BrokerInvalidClientException
- If client has been destroyed or disconnected.BrokerOutOfRangeException
- If a gateway already exists between the broker's territory and the remote territory specified in in the 'info' member, but that gateway was established by either another broker in the broker's territory or, if established through the broker, is connected to a different broker in the remote territory than that specified in in the 'info' member. Nothing about the gateway will have been altered if this exception is thrown.BrokerNotRunningException
- If the other side of the gateway doesn't existing yet and shared event types cannot be established. Everything else about the gateway will have been setup, and so this object needs to be stored again once the other side of the gateway is up.BrokerUnknownBrokerNameException
- If the other side of the gateway doesn't exist yet and the remote broker couldn't be found. Bring up the remote broker and try again.BrokerException
-
store
public void store(BrokerAdminClient client, boolean clusterGateway) throws BrokerException
- Throws:
BrokerException
-
write
public void write(java.io.Writer writer, int indent_level) throws BrokerException, java.io.IOException
Writes this Territory Gateway's information out in a textual format. This is usually done to a file. The indent_level is the number of 4 character indents to use.Unicode characters in the output are escaped using backslash-u notiation (e.g. ӿ).
Does not write anything if 'info' or 'info.remote_territory_name' are null.
- Throws:
java.io.IOException
- If there is an error wrtiting to the file.BrokerNullParameterException
- If writer is null.BrokerOutOfRangeException
- If indent_level is less than 0.BrokerException
-
toString
public java.lang.String toString(int indent_level) throws BrokerException
Converts this Territory Gateway's information into a string. The string is in proper format for saving to a file. The indent_level is the number of 4 character indents to use.Unicode characters in the output are escaped using backslash-u notiation (e.g. ӿ).
Returns an empty string if all of the data members are null, or if all of them return empty strings when converted to strings.
- Throws:
BrokerOutOfRangeException
- If indent_level is less than 0.BrokerException
-
toString
public java.lang.String toString()
Converts this Territory Gateway's information into a string. The string is in proper format for saving to a file.Unicode characters in the output are escaped using backslash-u notiation (e.g. ӿ).
Returns an empty string if all of the data members are null, or if all of them return empty strings when converted to strings.
- Overrides:
toString
in classjava.lang.Object
-
-