Interface ConnectMessagePart<T>

Type Parameters:
T - The type of the content of this ConnectMessagePart
All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractConnectMessagePart, ConnectMessagePartByteArrayImpl, ConnectMessagePartDocumentImpl, ConnectMessagePartFileImpl, ConnectMessagePartLargeFileImpl, ConnectMessagePartObjectImpl, ConnectMessagePartStringImpl

public interface ConnectMessagePart<T> extends Serializable
ConnectMessageParts are stored within a ConnectMessage. Each ConnectMessagePart contains properties and a specific part data type.
Author:
kgarstman
  • Method Details

    • getProperties

      Properties getProperties()
      Gets the properties of this ConnectMessagePart
      Returns:
      The properties of this ConnectMessagePart
    • setProperties

      void setProperties(Properties properties)
      Sets (and replaces!) the Properties of this ConnectMessagePart.
      Parameters:
      properties - The Properties object to insert into this ConnectMessagePart.
    • getType

      Gets the ConnectMessagePartContentType of this ConnectMessagePart.
      Returns:
      One of the types defined in ConnectMessagePartContentType
    • getId

      String getId()
      Gets the partId of this ConnectMessagePart. The partId is the same as the partId used to store the ConnectMessagePart in the ConnectMessage.
      Returns:
      The partId
    • setId

      void setId(String id)
      Set the partId of this ConnectMessagePart.
      Parameters:
      id - The partId to set
    • getPartNumber

      int getPartNumber()
      Gets the part number of this ConnectMessagePart. The part number is set when adding a ConnectMessagePart to the ConnectMessage.
      Returns:
      the partnumber
    • setPartNumber

      void setPartNumber(int partNumber)
      Sets the partNumber of this ConnectMessagePart. The partNumber is automatically set when adding the ConnectMessagePart to the ConnectMessage. Once set, a partNumber cannot be changed.
      Parameters:
      partNumber - The partnumber to set
    • getContent

      T getContent()
      Gets the data content of this ConnectMessagePart. The returned type is the Object type stored in this ConnectMessagePart.
      Returns:
      Object stored in this ConnectMessagePart
    • setContent

      void setContent(T content)
      Sets the content of this ConnectMessagePart. The type of the content should reflect the type of the ConnectMessagePart. Depending on the isCloneContent() the content will be stored as a reference or as a clone.
      Parameters:
      content - the content to store in this ConnectMessagePart
    • getPropertyValue

      Object getPropertyValue(Object key)
      Gets the value of a property as an Object. Property key will be searched in ConnectMessagePart properties.
      Parameters:
      key - Name of the property to find
      Returns:
      The found value as an Object or null if not found
    • addProperty

      void addProperty(Object key, Object value)
      Adds a property to this ConnectMessagePart properties. If the property key already exists the old value will be overwritten.
      Parameters:
      key - Key name of the property
      value - Value of the property to add. If null the property will be emptied.
    • addProperties

      void addProperties(Properties properties)
      Adds all properties in props to this ConnectMessagePart properties. Any existing properties in ConnectMessagePart will be kept unless overwritten by the new properties in props.
      Parameters:
      properties - Properties to add
    • getStringContent

      String getStringContent()
      Gets the String representation of the content of this ConnectMessagePart. Each ConnectMessagePart type implementation will have its own implementation of this method.
      Returns:
      The string implementation of the content
    • setStringContent

      void setStringContent(String content)
      Sets this string as the content of this ConnectMessagePart. Each ConnectMessagePart type implementation will convert the String content to the type of this ConnectMessagePart
      Parameters:
      content - The string content to set
    • containsProperty

      boolean containsProperty(Object key)
      Tests if the specified key is a property in this ConnectMessagePart.
      Parameters:
      key - The property key to test
      Returns:
      True if the property is found, false otherwise
    • toXML

      String toXML()
      Gets a simplified XML message of this ConnectMessagePart. Must only be used for logging purposes. The returned XML does not reflect the actual (JABX) XML reference of this ConnectMessagePart.
      Returns:
      The simplified XML message as a String
    • isCloneContent

      boolean isCloneContent()
      Tests if the setContent(Object) will store a reference to the content or make a clone copy of it.
      Returns:
      True if the setContent(Object) method will clone the content, false otherwise
    • setCloneContent

      void setCloneContent(boolean cloneContent)
      Sets or resets the clone functionality of the setContent(Object) method.
      Parameters:
      cloneContent - True to set the clone functionality of the setContent(Object) method, false otherwise