Package COM.activesw.api.client
Class BrokerAdminTypeDef
java.lang.Object
COM.activesw.api.client.BrokerAdminTypeDef
This type is used to represent a type definition as used by admin clients.
-
Constructor Summary
ConstructorsConstructorDescriptionBrokerAdminTypeDef
(short type) Create a new type definition for a non-Event type.BrokerAdminTypeDef
(BrokerAdminTypeDef type_def) Copy constructor.BrokerAdminTypeDef
(BrokerTypeDef normal_def) Create from a normal type definition.BrokerAdminTypeDef
(String type_name, short type) Create a new type definition. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearField
(String field_name) Clear/delete a given field.void
Clear/delete all fields.void
Clear the modification flag for the type definition to false.Get the base name (name without scope qualifier) of this event type.Get the type's description.getFieldDef
(String field_name) Get the type of a field as a BrokerAdminTypeDef.String[]
getFieldNames
(String field_name) Get the list of field names in an event type.short
getFieldType
(String field_name) Get the type for a given field.Get the name of this event type's scope.int
Get the type's storage type.int
Get the type's time-to-live.Get the fully qualified name of this event type.int
Get the type's validation type.boolean
Get the modification flag for the type definition.void
insertFieldDef
(String field_name, int index, BrokerAdminTypeDef field_def) Insert the a field using a BrokerAdminTypeDef.boolean
Check if type is system defined.void
orderFields
(String field_name, String[] new_field_names) Set the order of fields in a type.void
renameField
(String old_field_name, String new_field_name) Rename or move a field.void
setDescription
(String description) Set the type's description.void
setFieldDef
(String field_name, BrokerAdminTypeDef field_def) Set the type of a field.void
setFieldType
(String field_name, short field_type, String type_name) Set the type for a given field.void
Set the modification flag for the type definition to true.void
setStorageType
(int storage_type) Set the type's storage type.void
setTimeToLive
(int time_to_live) Set the type's time-to-live.void
setTypeName
(String type_name) Set the fully qualified name of this event type.void
setValidationType
(int validation_type) Set the type's validation type.--- Used by test cases only --- Get a string representation of the type definition and of all related definitions.toString()
Get a string representation of the type definition.toString
(int indent_level) Get a string representation of the type definition.
-
Constructor Details
-
BrokerAdminTypeDef
Create a new type definition. The type may only be struct or event.- Throws:
BrokerInvalidEventTypeNameException
- If the type name is not valid.BrokerInvalidTypeException
- If type is not event or struct.BrokerNullParameterException
- If type_name is null and type is event.BrokerException
-
BrokerAdminTypeDef
Create a new type definition for a non-Event type.- Throws:
BrokerInvalidTypeException
- If type is not valid.BrokerException
-
BrokerAdminTypeDef
Copy constructor.- Throws:
BrokerNullParameterException
- If type_def is null.BrokerException
-
BrokerAdminTypeDef
Create from a normal type definition.- Throws:
BrokerNullParameterException
- If normal_def is null.BrokerException
-
-
Method Details
-
getTypeName
Get the fully qualified name of this event type. -
getBaseTypeName
Get the base name (name without scope qualifier) of this event type. -
getScopeTypeName
Get the name of this event type's scope. -
setTypeName
Set the fully qualified name of this event type.- Throws:
BrokerInvalidEventTypeNameException
- If the type_name is not valid.BrokerInvalidTypeException
- If the type is not a struct or event.BrokerNullParameterException
- If type_name is null.BrokerException
-
getTimeToLive
Get the type's time-to-live. Zero is 'forever'.- Throws:
BrokerInvalidTypeException
- If the type is not an event.BrokerException
-
setTimeToLive
Set the type's time-to-live. Zero is 'forever'.- Throws:
BrokerInvalidTypeException
- If the type is not an event.BrokerOutOfRangeException
- If time_to_live is less than zero.BrokerException
-
getStorageType
Get the type's storage type. Uses the BrokerTypeDef.STORAGE_* values.- Throws:
BrokerInvalidTypeException
- If the type is not an event.BrokerException
-
setStorageType
Set the type's storage type. Use the BrokerTypeDef.STORAGE_* values.- Throws:
BrokerInvalidTypeException
- If the type is not an event.BrokerOutOfRangeException
- If storage_type is not a valid type.BrokerException
-
getValidationType
Get the type's validation type. Uses the BrokerTypeDef.VALIDATION_* values.- Throws:
BrokerInvalidTypeException
- If the type is not an event.BrokerException
-
setValidationType
Set the type's validation type. Use the BrokerTypeDef.VALIDATION_* values.- Throws:
BrokerInvalidTypeException
- If the type is not an event.BrokerOutOfRangeException
- If validation_type is not a valid type.BrokerException
-
getDescription
Get the type's description.- Throws:
BrokerInvalidTypeException
- If the type is not an event.BrokerException
-
setDescription
Set the type's description.- Throws:
BrokerInvalidTypeException
- If the type is not an event.BrokerNullParameterException
- If description is null.BrokerException
-
isSystemDefined
public boolean isSystemDefined()Check if type is system defined. -
getFieldNames
Get the list of field names in an event type. If field_name is 'null' or "", it gets the fields a the top level of the event. Otherwise, the field_name should refer to a structure sub-field and it will return the names at that level. Non-structured type will return null.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event type.BrokerFieldTypeMismatchException
- If the field name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerException
-
getFieldType
Get the type for a given field. If field_name is 'null' or "", it gets the type for the top level of the event.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event type.BrokerFieldTypeMismatchException
- If the field name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerException
-
setFieldType
public void setFieldType(String field_name, short field_type, String type_name) throws BrokerException Set the type for a given field. Creates the field if it doesn't exist, and redefines fields as necessary. The 'type_name' field is currently not in use and should be null for future compatibility.- Throws:
BrokerFieldTypeMismatchException
- If this definition is not an event, struct, or sequence.BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If try to change a field's type to a sequence.BrokerNullParameterException
- If field_name is null.BrokerException
-
getFieldDef
Get the type of a field as a BrokerAdminTypeDef. If field_name is 'null' or "", it gets the type for the top level of the event.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event type.BrokerFieldTypeMismatchException
- If the field name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerException
-
setFieldDef
Set the type of a field. Creates the field if it doesn't exist, and redefines fields as necessary.- Throws:
BrokerFieldTypeMismatchException
- If this definition is not an event, struct, or sequence.BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If field_name or field_def are null.BrokerException
-
insertFieldDef
public void insertFieldDef(String field_name, int index, BrokerAdminTypeDef field_def) throws BrokerException Insert the a field using a BrokerAdminTypeDef. Creates the field if it does not exist, and redefines fields as necessary. Otherwise just reorders its position. The field is inserted before the index value, so that zero(0) puts it at the top of the list and any value larger than the list size will put it at the end.- Throws:
BrokerFieldTypeMismatchException
- If this definition is not an event, struct, or sequence.BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If the field is not a struct or event.BrokerNullParameterException
- If field_name or field_def are null.BrokerOutOfRangeException
- If index is less than zero.BrokerException
-
renameField
Rename or move a field.- Throws:
BrokerFieldNotFoundException
- If the old field name does not exist in the event type.BrokerFieldTypeMismatchException
- If the field name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If either field name is not valid.BrokerInvalidTypeException
- If either field name does not refer to a named field. For example, "x[]" is not a named field.BrokerNullParameterException
- If old_field_name or new_field_name are null.BrokerException
-
orderFields
Set the order of fields in a type. Specify all fields to be ordered. Any which are not listed will be placed at the end in their current order. If 'field_name' is null, the top level of the definition is manipulated. Only usable on struct and event type definitions.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event type.BrokerFieldTypeMismatchException
- If the field name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If the field is not a struct or event.BrokerNullParameterException
- If new_field_names is null, or if any entry in the array is null.BrokerException
-
clearField
Clear/delete a given field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event type.BrokerFieldTypeMismatchException
- If the field name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If the type is not a struct or event.BrokerNullParameterException
- If field_name is null.BrokerException
-
clearFields
Clear/delete all fields.- Throws:
BrokerInvalidTypeException
- If the type is not a struct or event.BrokerException
-
hasBeenModified
public boolean hasBeenModified()Get the modification flag for the type definition. -
setModificationFlag
public void setModificationFlag()Set the modification flag for the type definition to true. -
clearModificationFlag
public void clearModificationFlag()Clear the modification flag for the type definition to false. -
toString
Get a string representation of the type definition. -
toString
Get a string representation of the type definition. The "indent_level" is the number of 4-space indents that the output should be generated for. -
toExtendedString
--- Used by test cases only --- Get a string representation of the type definition and of all related definitions.
-