Class BrokerCompleteCollection
- java.lang.Object
-
- COM.activesw.api.client.BrokerCompleteCollection
-
public class BrokerCompleteCollection extends java.lang.Object
This class is used as a container to collect various Broker objects. It is commonly used to hold the results of reading in from an export file, and can be used to create an export file as well.Note that several of the objects in this collection are also container objects. Including an object in one of them can result in that object being placed in an export file or used during an import as well.
-
-
Field Summary
Fields Modifier and Type Field Description BrokerAccessControlList[]
acls
BrokerCompleteBroker[]
brokers
BrokerCompleteClientGroup[]
client_groups
BrokerCompleteClient[]
clients
BrokerCompleteEventType[]
event_types
BrokerCompleteServer[]
servers
-
Constructor Summary
Constructors Constructor Description BrokerCompleteCollection()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BrokerCompleteCollection
read(java.io.Reader reader)
Creates a new BrokerCompleteCollection based upon textual input.static BrokerCompleteCollection
readFile(java.lang.String filename)
Creates a new BrokerCompleteCollection based upon textual input read from a file.java.lang.String
toString()
Converts this object's information into a string.java.lang.String
toString(int indent_level)
Converts this object's information into a string.void
write(java.io.Writer writer, int indent_level)
Writes this object's information out in a textual format.void
write(java.io.Writer writer, int indent_level, boolean escape_unicode)
Writes this object's information out in a textual format.static void
writeVersionNumber(java.io.Writer writer, int indent_level)
Writes a version number string.
-
-
-
Field Detail
-
servers
public BrokerCompleteServer[] servers
-
brokers
public BrokerCompleteBroker[] brokers
-
clients
public BrokerCompleteClient[] clients
-
client_groups
public BrokerCompleteClientGroup[] client_groups
-
event_types
public BrokerCompleteEventType[] event_types
-
acls
public BrokerAccessControlList[] acls
-
-
Method Detail
-
read
public static BrokerCompleteCollection read(java.io.Reader reader) throws BrokerException, java.io.IOException
Creates a new BrokerCompleteCollection based upon textual input. The input is usually read from a file but does not have to be.Because the the reader can only be read from once, this method does not handle the old export file formats like readFile can.
For best efficiency, do not pass in a BufferedReader, because the underlying parser already performs read buffering.
- Throws:
java.io.IOException
- If there is an error reading.BrokerInputParseException
- If there is a parse error in the text.BrokerNullParameterException
- If reader is null.BrokerException
-
readFile
public static BrokerCompleteCollection readFile(java.lang.String filename) throws BrokerException, java.io.IOException
Creates a new BrokerCompleteCollection based upon textual input read from a file.If the file does not use the most current file format, an attempt will be made to re-read the file using the old file format (from previous releases.) A BrokerInputParseException thrown when reading from a file using an old format does not provide the line number when there is an error.
- Throws:
java.io.IOException
- If there is an error reading.BrokerInputParseException
- If there is a parse error in the text.BrokerNullParameterException
- If filename is null.BrokerException
-
writeVersionNumber
public static void writeVersionNumber(java.io.Writer writer, int indent_level) throws BrokerException, java.io.IOException
Writes a version number string. This is usually done at the top of any file written out using the write method of this or any other BrokerComplete class. The inclusion of the file format version at the top of the exported file is not mandatory.This method is separated from the write functions so you may control which parts of a collection are written to the file and write the version number of the file format only once, at the top.
- Throws:
java.io.IOException
- If there is an error writing.BrokerNullParameterException
- If writer is null.BrokerOutOfRangeException
- If indent_level is less than 0.BrokerException
-
write
public void write(java.io.Writer writer, int indent_level, boolean escape_unicode) throws BrokerException, java.io.IOException
Writes this object'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. ӿ) if the escape_unicode arguement is true. Set the escape_unicode arguement to false only if you desire native format unicode characters that can be more easily edited in locale editors. Unescaped unicode characters cannot be read again on every platform and locale.
Does not write anything if all of the data members are null, or if all of them return empty strings when converted to strings.
You may call this function repeatedly with the same writer to write multiple collections into the same file.
Does not write the export file format version number to the file. Use writeVersionNumber once at the beginning of the file to do that.
- Throws:
java.io.IOException
- If there is an error writing to the file.BrokerNullParameterException
- If writer is null.BrokerOutOfRangeException
- If indent_level is less than 0.BrokerException
-
write
public void write(java.io.Writer writer, int indent_level) throws BrokerException, java.io.IOException
Writes this object'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 all of the data members are null, or if all of them return empty strings when converted to strings.
You may call this function repeatedly with the same writer to write multiple collections into the same file.
Does not write the export file format version number to the file. Use writeVersionNumber once at the beginning of the file to do that.
- Throws:
java.io.IOException
- If there is an error writing 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 object'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 object'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
-
-