Package com.connectplaza.eaf.pojo.impl
Class ConnectMessageImpl
java.lang.Object
com.connectplaza.eaf.pojo.impl.ConnectMessageImpl
- All Implemented Interfaces:
ConnectMessage
,Serializable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPart
(String id, ConnectMessagePart<?> part) CallsConnectMessage.addPart(String, ConnectMessagePart, boolean)
with boolean = truevoid
addPart
(String id, ConnectMessagePart<?> part, boolean overwrite) Adds a ConnectMessagePart to this ConnectMessage.void
addProperties
(Map<Object, Object> props) Adds all properties in a map to this ConnectMessage properties.void
addProperties
(Properties props) Adds all properties in props to this ConnectMessage properties.void
addProperty
(Object key, Object value) Adds a property to this ConnectMessage properties.boolean
Tests if the specified key is a property in this ConnectMessage.boolean
containsProperty
(Object key) Deprecated.void
Copies a ConnectMessagePart.Gets the first (oldest) ConnectMessagePart.Gets the last (newest) ConnectMessagePart.Gets the value of a property as an Object.int
Gets the number of ConnectMessageParts in this ConnectMessage.getPartById
(String id) Gets the ConnectMessagePart identified by id in this ConnectMessage.getPartByPartNumber
(int partNumber) Gets the ConnectMessagePart with a certain partNumber.getPropertyValue
(Object key) Deprecated.Gets the value of a property as a String.Deprecated.void
Moves a ConnectMessagePart to another partId.void
setProperties
(Properties properties) Sets (and replaces!) the Properties of this ConnectMessage.toString()
toXML()
Gets a simplified XML message of this ConnectMessage.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.connectplaza.eaf.pojo.interfaces.ConnectMessage
getParts, getProperties, setParts
-
Constructor Details
-
ConnectMessageImpl
public ConnectMessageImpl()
-
-
Method Details
-
setProperties
Description copied from interface:ConnectMessage
Sets (and replaces!) the Properties of this ConnectMessage.- Specified by:
setProperties
in interfaceConnectMessage
- Parameters:
properties
- The Properties object to insert into this ConnectMessage.
-
getPropertyValue
Deprecated.Description copied from interface:ConnectMessage
Gets the value of a property as an Object. Property key will be searched in ConnectMessage properties. When not found the search will be extended to the properties of the contained ConnectMessageParts.- Specified by:
getPropertyValue
in interfaceConnectMessage
- Parameters:
key
- Name of the property to find- Returns:
- The found value as an Object or null if not found
-
getMessagePropertyValue
Description copied from interface:ConnectMessage
Gets the value of a property as an Object. Property key will be searched in ConnectMessage properties only.- Specified by:
getMessagePropertyValue
in interfaceConnectMessage
- Parameters:
key
- Name of the property to find- Returns:
- The found value as an Object or null if not found
-
getStringPropertyValue
Deprecated.Description copied from interface:ConnectMessage
Gets the value of a property as a String.- Specified by:
getStringPropertyValue
in interfaceConnectMessage
- Parameters:
key
- Name of the property to find- Returns:
- The found value as a String or an empty String if not found or value cannot be cast to String
- See Also:
-
getStringMessagePropertyValue
Description copied from interface:ConnectMessage
Gets the value of a property as a String.- Specified by:
getStringMessagePropertyValue
in interfaceConnectMessage
- Parameters:
key
- Name of the property to find- Returns:
- The found value as a String or an empty String if not found or value cannot be cast to String
- See Also:
-
getPartById
Description copied from interface:ConnectMessage
Gets the ConnectMessagePart identified by id in this ConnectMessage.- Specified by:
getPartById
in interfaceConnectMessage
- Parameters:
id
- Name or id of the wanted ConnectMessagePart- Returns:
- The requested ConnectMessagePart or null if not found.
-
getFirstPart
Description copied from interface:ConnectMessage
Gets the first (oldest) ConnectMessagePart. The part with partnumber 0 is the first part that was added to this ConnectMessage. Because parts can be removed and partnumbers can not be changed on ConnectMessageParts the first part will not automatically be part with partnumber 0.- Specified by:
getFirstPart
in interfaceConnectMessage
- Returns:
- The ConnectMessagePart with the lowest partNumber
-
getLastPart
Description copied from interface:ConnectMessage
Gets the last (newest) ConnectMessagePart.- Specified by:
getLastPart
in interfaceConnectMessage
- Returns:
- The ConnectMessagePart with the highest partNumber
-
getPartByPartNumber
Description copied from interface:ConnectMessage
Gets the ConnectMessagePart with a certain partNumber. Each ConnectMessagePart gets a subsequent partNumber when it is stored in a ConnectMessage. PartNumbers start at 0 for the first ConnectMessagePart stored.- Specified by:
getPartByPartNumber
in interfaceConnectMessage
- Parameters:
partNumber
- The number of the part to retrieve.- Returns:
- The ConnectMessagePart with partNumer or null when not found
-
addPart
Description copied from interface:ConnectMessage
CallsConnectMessage.addPart(String, ConnectMessagePart, boolean)
with boolean = true- Specified by:
addPart
in interfaceConnectMessage
- Parameters:
id
- PartId to store this ConnectMessagePartpart
- The ConnectMessagePart to add.
-
addPart
Description copied from interface:ConnectMessage
Adds a ConnectMessagePart to this ConnectMessage. The ConnectMessagePart is mapped with the id into the ConnectMessage. The boolean defines if the ConnectMessagePart will be overwritten if it already exists.- Specified by:
addPart
in interfaceConnectMessage
- Parameters:
id
- PartId to store this ConnectMessagePartpart
- The ConnectMessagePart to add.overwrite
- Defines the overwrite mode.
-
movePart
Description copied from interface:ConnectMessage
Moves a ConnectMessagePart to another partId. The partId of a ConnectMessagePart is renamed. If the new partId already exists the overwrite boolean decides if the rename will actually occur.- Specified by:
movePart
in interfaceConnectMessage
- Parameters:
oldId
- partid of the existing ConnectMessagePartnewId
- new partId to rename the oldIdoverwrite
- Defines the overwrite mode.
-
copyPart
Description copied from interface:ConnectMessage
Copies a ConnectMessagePart. The new ConnectMessagePart is stored under the newId. The copy of the part is NOT a clone but just a reference copy. The boolean decides if the copy will overwrite an existing ConnectMessagePart.- Specified by:
copyPart
in interfaceConnectMessage
- Parameters:
oldId
- partid of the existing ConnectMessagePartnewId
- new partId to copy the exiting ConnectMessagePart to.clone
- Defines if the content of the ConnectMessagePart will be cloned.overwrite
- Defines the overwrite mode.
-
toString
-
toXML
Description copied from interface:ConnectMessage
Gets a simplified XML message of this ConnectMessage. Must only be used for logging purposes. The returned XML does not reflect the actual (JABX) XML reference of this ConnectMessage.- Specified by:
toXML
in interfaceConnectMessage
- Returns:
- The simplified XML message as a String
-
addProperty
Description copied from interface:ConnectMessage
Adds a property to this ConnectMessage properties. If the property key already exists the old value will be overwritten.- Specified by:
addProperty
in interfaceConnectMessage
- Parameters:
key
- Key name of the propertyvalue
- Value of the property to add
-
addProperties
Description copied from interface:ConnectMessage
Adds all properties in props to this ConnectMessage properties. Any existing properties in ConnectMessage will be kept unless overwritten by the new properties in props.- Specified by:
addProperties
in interfaceConnectMessage
- Parameters:
props
- Properties to add
-
addProperties
Description copied from interface:ConnectMessage
Adds all properties in a map to this ConnectMessage properties. Any existing properties in ConnectMessage will be kept unless overwritten by the new proprties in the map.- Specified by:
addProperties
in interfaceConnectMessage
- Parameters:
props
- Map of properties to add
-
getNumberOfParts
public int getNumberOfParts()Description copied from interface:ConnectMessage
Gets the number of ConnectMessageParts in this ConnectMessage.- Specified by:
getNumberOfParts
in interfaceConnectMessage
- Returns:
- The number of parts.
-
containsProperty
Deprecated.Description copied from interface:ConnectMessage
Tests if the specified key is a property in this ConnectMessage or any of its ConnectMessageParts.- Specified by:
containsProperty
in interfaceConnectMessage
- Parameters:
key
- The property key to test- Returns:
- True if the property is found, false otherwise
-
containsMessageProperty
Description copied from interface:ConnectMessage
Tests if the specified key is a property in this ConnectMessage.- Specified by:
containsMessageProperty
in interfaceConnectMessage
- Parameters:
key
- The property key to test- Returns:
- True if the property is found, false otherwise
-