Class BrokerCompleteCollection
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
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BrokerCompleteCollection
Creates a new BrokerCompleteCollection based upon textual input.static BrokerCompleteCollection
Creates a new BrokerCompleteCollection based upon textual input read from a file.toString()
Converts this object's information into a string.toString
(int indent_level) Converts this object's information into a string.void
Writes this object's information out in a textual format.void
Writes this object's information out in a textual format.static void
writeVersionNumber
(Writer writer, int indent_level) Writes a version number string.
-
Field Details
-
servers
-
brokers
-
clients
-
client_groups
-
event_types
-
acls
-
-
Constructor Details
-
BrokerCompleteCollection
public BrokerCompleteCollection()Constructor.
-
-
Method Details
-
read
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:
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(String filename) throws BrokerException, 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:
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(Writer writer, int indent_level) throws BrokerException, 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:
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(Writer writer, int indent_level, boolean escape_unicode) throws BrokerException, 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:
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
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:
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
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
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.
-