Class BrokerCompleteServer

java.lang.Object
COM.activesw.api.client.BrokerCompleteServer

public class BrokerCompleteServer extends Object
Holds all of the information describing a server as far as import and export are concerned.
  • Field Details

  • Constructor Details

    • BrokerCompleteServer

      public BrokerCompleteServer()
      Constructor.
  • Method Details

    • retrieve

      public static BrokerCompleteServer retrieve(BrokerServerClient client) throws BrokerException
      Retrieves the information about a Broker Server and creates an object. Retrieves the server information, but NOT the Brokers in the server.

      Any server information which the client does not have permission to read is set to null.

      Throws:
      BrokerNullParameterException - If client is null.
      BrokerInvalidClientException - If client has been destroyed or disconnected.
      BrokerException
    • deepRetrieve

      public static BrokerCompleteServer deepRetrieve(BrokerServerClient client, String client_id, String client_group, String app_name, BrokerConnectionDescriptor desc) throws BrokerException
      Retrieves all the information about a Broker server and creates an object. Retrieves any Brokers which the client has permission to access. Follows the rules in BrokerCompleteBroker.deepRetrieve().

      The client_id, client_group, app_name, and desc are used in establishing connections to the individual brokers. See the constructor for BrokerAdminClient.

      Any server information which the client does not have permission to read is set to null.

      Throws:
      BrokerNullParameterException - If client, client_group, or app_name are null.
      BrokerInvalidClientException - If client has been destroyed or disconnected.
      BrokerException
    • refresh

      public void refresh(BrokerServerClient client) throws BrokerException
      Refreshes the information about a Broker server based on the given client. Refreshes the server information, but NOT the Brokers in the server.

      Any server information which the client does not have permission to read is set to null.

      Throws:
      BrokerNullParameterException - If client is null.
      BrokerInvalidClientException - If client has been destroyed or disconnected.
      BrokerException
    • deepRefresh

      public void deepRefresh(BrokerServerClient client, String client_id, String client_group, String app_name, BrokerConnectionDescriptor desc) throws BrokerException
      Refreshes the information about a Broker server based on the given client. Refreshes everything including all the Brokers in the server.

      Rebuilds the 'brokers' array in this object. If any Broker no longer exists or if the client does not have permission to access a Broker, that Broker will not be found in the new 'brokers' array. The information refreshed within each broker follows the rules in BrokerCompleteBroker.deepRefresh().

      The client_id, client_group, app_name, and desc are used in establishing connections to the individual brokers. See the constructor for BrokerAdminClient.

      Any server information which the client does not have permission to read is set to null.

      Throws:
      BrokerNullParameterException - If client is null.
      BrokerInvalidClientException - If client has been destroyed or disconnected.
      BrokerException
    • store

      public void store(BrokerServerClient client) throws BrokerException
      Stores the information from this object into the server for which the given client object has been provided.

      The host name in this object is ignored. Other values may be overwritten or merged.

      • If the description is set, it replaces the existing value.
      • If the port is set to something other than zero, it replaces the existing value.
      • If the logging configuration is set, it replaces the existing value.
      • If the SSL configuration is set, it replaces the existing value.
      • If the DN access list is set, it replaces the existing value.
      Does NOT store the brokers under this server. The caller must ask for those to be stored separately by using the BrokerCompleteBroker store or deepStore method. If you'd like this server and all of its Brokers stored, use the deepStore method instead.

      If an exception is thrown, nothing is changed.

      Throws:
      BrokerInvalidClientException - If the client is null or has been destroyed.
      BrokerNoPermissionException - If the client does not have permission to change the specified information.
      BrokerException
    • write

      public void write(Writer writer, int indent_level) throws BrokerException, IOException
      Writes this server'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 host_name is null.

      Throws:
      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 String toString(int indent_level) throws BrokerException
      Converts this server's information into a string. The indent_level is the number of 4 character indents to use. 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.

      Throws:
      BrokerOutOfRangeException - If indent_level is less than 0.
      BrokerException
    • toString

      public String toString()
      Converts this server'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 class Object