Class ConnectMessageImpl

java.lang.Object
com.connectplaza.eaf.pojo.impl.ConnectMessageImpl
All Implemented Interfaces:
ConnectMessage, Serializable

public class ConnectMessageImpl extends Object implements ConnectMessage
See Also:
  • Constructor Details

    • ConnectMessageImpl

      public ConnectMessageImpl()
  • Method Details

    • setProperties

      public void setProperties(Properties properties)
      Description copied from interface: ConnectMessage
      Sets (and replaces!) the Properties of this ConnectMessage.
      Specified by:
      setProperties in interface ConnectMessage
      Parameters:
      properties - The Properties object to insert into this ConnectMessage.
    • getPropertyValue

      @Deprecated public Object getPropertyValue(Object key)
      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 interface ConnectMessage
      Parameters:
      key - Name of the property to find
      Returns:
      The found value as an Object or null if not found
    • getMessagePropertyValue

      public Object getMessagePropertyValue(Object key)
      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 interface ConnectMessage
      Parameters:
      key - Name of the property to find
      Returns:
      The found value as an Object or null if not found
    • getStringPropertyValue

      @Deprecated public String getStringPropertyValue(Object key)
      Deprecated.
      Description copied from interface: ConnectMessage
      Gets the value of a property as a String.
      Specified by:
      getStringPropertyValue in interface ConnectMessage
      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

      public String getStringMessagePropertyValue(Object key)
      Description copied from interface: ConnectMessage
      Gets the value of a property as a String.
      Specified by:
      getStringMessagePropertyValue in interface ConnectMessage
      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

      public ConnectMessagePart<?> getPartById(String id)
      Description copied from interface: ConnectMessage
      Gets the ConnectMessagePart identified by id in this ConnectMessage.
      Specified by:
      getPartById in interface ConnectMessage
      Parameters:
      id - Name or id of the wanted ConnectMessagePart
      Returns:
      The requested ConnectMessagePart or null if not found.
    • getFirstPart

      public ConnectMessagePart<?> 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 interface ConnectMessage
      Returns:
      The ConnectMessagePart with the lowest partNumber
    • getLastPart

      public ConnectMessagePart<?> getLastPart()
      Description copied from interface: ConnectMessage
      Gets the last (newest) ConnectMessagePart.
      Specified by:
      getLastPart in interface ConnectMessage
      Returns:
      The ConnectMessagePart with the highest partNumber
    • getPartByPartNumber

      public ConnectMessagePart<?> getPartByPartNumber(int partNumber)
      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 interface ConnectMessage
      Parameters:
      partNumber - The number of the part to retrieve.
      Returns:
      The ConnectMessagePart with partNumer or null when not found
    • addPart

      public void addPart(String id, ConnectMessagePart<?> part)
      Description copied from interface: ConnectMessage
      Specified by:
      addPart in interface ConnectMessage
      Parameters:
      id - PartId to store this ConnectMessagePart
      part - The ConnectMessagePart to add.
    • addPart

      public void addPart(String id, ConnectMessagePart<?> part, boolean overwrite)
      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 interface ConnectMessage
      Parameters:
      id - PartId to store this ConnectMessagePart
      part - The ConnectMessagePart to add.
      overwrite - Defines the overwrite mode.
    • movePart

      public void movePart(String oldId, String newId, boolean overwrite)
      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 interface ConnectMessage
      Parameters:
      oldId - partid of the existing ConnectMessagePart
      newId - new partId to rename the oldId
      overwrite - Defines the overwrite mode.
    • copyPart

      public void copyPart(String oldId, String newId, boolean clone, boolean overwrite)
      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 interface ConnectMessage
      Parameters:
      oldId - partid of the existing ConnectMessagePart
      newId - 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

      public String toString()
      Overrides:
      toString in class Object
    • toXML

      public String 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 interface ConnectMessage
      Returns:
      The simplified XML message as a String
    • addProperty

      public void addProperty(Object key, Object value)
      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 interface ConnectMessage
      Parameters:
      key - Key name of the property
      value - Value of the property to add
    • addProperties

      public void addProperties(Properties props)
      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 interface ConnectMessage
      Parameters:
      props - Properties to add
    • addProperties

      public void addProperties(Map<Object,Object> props)
      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 interface ConnectMessage
      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 interface ConnectMessage
      Returns:
      The number of parts.
    • containsProperty

      @Deprecated public boolean containsProperty(Object key)
      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 interface ConnectMessage
      Parameters:
      key - The property key to test
      Returns:
      True if the property is found, false otherwise
    • containsMessageProperty

      public boolean containsMessageProperty(Object key)
      Description copied from interface: ConnectMessage
      Tests if the specified key is a property in this ConnectMessage.
      Specified by:
      containsMessageProperty in interface ConnectMessage
      Parameters:
      key - The property key to test
      Returns:
      True if the property is found, false otherwise