Class SCMessage

java.lang.Object
org.serviceconnector.api.SCMessage
Direct Known Subclasses:
SCManagedMessage, SCPublishMessage, SCSubscribeMessage

public class SCMessage extends Object
The Class SCMessage. A SCMessage is the basic transport unit to communicate with a Service Connector.
Author:
JTraber
  • Constructor Details

    • SCMessage

      public SCMessage()
      Instantiates a new SCMessage.
    • SCMessage

      public SCMessage(byte[] data)
      Instantiates a new SC message with byte[] data.
      Parameters:
      data - the data
    • SCMessage

      public SCMessage(String data)
      Instantiates a new SC message with String data.
      Parameters:
      data - the data
  • Method Details

    • setMessageInfo

      public void setMessageInfo(String messageInfo)
      Sets the message info.
      Parameters:
      messageInfo - Optional information passed together with the message body that helps to identify the message content without investigating the body.
      Any printable character, length > 0 and < 256 Byte
      Example: SECURITY_MARKET_QUERY
    • getSessionInfo

      public String getSessionInfo()
      Gets the session info.
      Returns:
      the session info
    • setSessionInfo

      public void setSessionInfo(String sessionInfo)
      Sets the session info.
      Parameters:
      sessionInfo - Optional information passed together with the message body Any printable character, length > 0 and < 256 Byte
    • getMessageInfo

      public String getMessageInfo()
      Gets the message info.
      Returns:
      the message info
    • isCompressed

      public boolean isCompressed()
      Checks if is compressed.
      Returns:
      the boolean
    • setCompressed

      public void setCompressed(boolean compressed)
      Sets the compressed. Default is true.
      Parameters:
      compressed - Regards the data part of the message.
    • setData

      public void setData(Object data)
      Sets the data.
      Parameters:
      data - the new data
    • getData

      public Object getData()
      Gets the data.
      Returns:
      the data
    • setDataLength

      public void setDataLength(int dataLength)
      Sets the data length.
      Parameters:
      dataLength - the new data length
    • getDataLength

      public int getDataLength()
      Gets the data length.
      Returns:
      the data length
    • getSessionId

      public String getSessionId()
      Gets the session id.
      Returns:
      the session id
    • setSessionId

      public void setSessionId(String sessionId)
      Sets the session id.
      Parameters:
      sessionId - the new session id
    • getCacheId

      public String getCacheId()
      Gets the cache id.
      Returns:
      the cache id
    • getCachePartNr

      public String getCachePartNr()
      Gets the cache part nr.
      Returns:
      the cache part nr
    • isCached

      public boolean isCached()
      Checks if message has been cached and comes from a cache.
      Returns:
      true, if message has been cached
    • setCached

      public void setCached(boolean cached)
      Marks the message as a cached message.
      Parameters:
      cached - the new caching state
    • getServiceName

      public String getServiceName()
      Gets the service name.
      Returns:
      the service name
    • setServiceName

      public void setServiceName(String serviceName)
      Sets the service name. Needs to be the same service which is used to send the message. The name will be overwritten at the time the message is sent.
      Parameters:
      serviceName - the new service name
    • setCacheId

      public void setCacheId(String cacheId)
      Sets the cache id.
      Parameters:
      cacheId - the new cache id
    • setCachePartNr

      public void setCachePartNr(String cachePartNr)
      Sets the cache part nr.
      Parameters:
      cachePartNr - the new cache part nr
    • getAppErrorCode

      public int getAppErrorCode()
      Gets the application error code.
      Returns:
      the application error code
    • setAppErrorText

      public void setAppErrorText(String appErrorText)
      Sets the application error text.
      Parameters:
      appErrorText - the new application error text
    • getAppErrorText

      public String getAppErrorText()
      Gets the application error text.
      Returns:
      the application error text
    • setAppErrorCode

      public void setAppErrorCode(Integer appErrorCode)
      Sets the application error code.
      Parameters:
      appErrorCode - the new application error code
    • isReject

      public boolean isReject()
      Checks if is reject.
      Returns:
      true, if is reject
    • setReject

      public void setReject(boolean reject)
      Sets the reject.
      Parameters:
      reject - the new reject
    • getPartSize

      public int getPartSize()
      Gets the part size.
      Returns:
      the size of the parts in which message will be broken when it is large
    • setPartSize

      public void setPartSize(int partSize)
      Sets the part size.
      Parameters:
      partSize - the size in which message will be broken when it is large
    • getCacheExpirationDateTime

      public Date getCacheExpirationDateTime()
      Gets the cache expiration date time.
      Returns:
      the cache expiration date time
    • setCacheExpirationDateTime

      public void setCacheExpirationDateTime(Date cacheExpirationDateTime)
      Sets the cache expiration date time.
      Parameters:
      cacheExpirationDateTime - the new cache expiration date time
    • setCachingMethod

      public void setCachingMethod(SC_CACHING_METHOD cachingMethod)
      Sets the caching method.
      Parameters:
      cachingMethod - the new caching method
    • getCachingMethod

      public SC_CACHING_METHOD getCachingMethod()
      Gets the caching method.
      Returns:
      the caching method
    • isManaged

      public boolean isManaged()
      Checks if message is managed.
      Returns:
      true, if message is managed
    • toString

      public String toString()
      Overrides:
      toString in class Object