de.esprit.netsuite.netdata

## Class NetMessage

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.common.util.TransferableObject
    - - de.esprit.netsuite.netdata.NetMessage

- All Implemented Interfaces:
    DeepCloneable, Dumpable, DeliverableMessage, java.io.Serializable, java.lang.Cloneable

      public class NetMessage
      extends TransferableObject
      implements DeliverableMessage

  This class encapsulates message data which clients may receive asynchronously from the server.
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetMessage(NetMessageType type)`
    `NetMessage(NetMessageType type, java.lang.Object arg)`
    `NetMessage(java.lang.Object arg)`
    `NetMessage(ServerStatusEvent event)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `NetMessage` | `deepClone()` Returns a deep clone of this object
    `java.lang.Object` | `getArgument()`
    `SessionId` | `getFromSession()`
    `SessionId` | `getTargetSession()` Setting a target session indicates that the message is being sent to this session only.
    `java.lang.String[]` | `getTargetUsers()` Only set if setTargetUser(String) was explicitly called
    `NetMessageType` | `getType()`
    `boolean` | `hasFromSession()`
    `boolean` | `hasTargetSession()`
    `boolean` | `hasTargetUser()`
    `boolean` | `isAgentMessage()`
    `boolean` | `isClientCommand()`
    `boolean` | `isPing()`
    `boolean` | `isRemoteTaskEvent()`
    `boolean` | `isServerShutdown()`
    `boolean` | `isServerStatusMessage()` Tells whether this message is caused by the server itself.
    `boolean` | `isSkipSender()` If this flag is set, then the message is sent to all sessions except the session of the sender himself.
    `boolean` | `isSystemEvent()`
    `void` | `setFromSession(SessionId fromSessId)`
    `void` | `setSkipSender(boolean isSkipSender)`
    `void` | `setTargetSession(SessionId toSessId)`
    `void` | `setTargetUser(java.lang.String userName)` Setting a userName indicates that the message is being sent to this users sessions only.
    `void` | `setTargetUsers(java.util.List<java.lang.String> userNames)`
    `void` | `setTargetUsers(java.lang.String[] userNames)`
    `DumpString` | `toDumpString(DumpString s)` This method allows subclasses to add values to the existing DumpString of the superclass.
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.

    - ### Methods inherited from class de.esprit.common.util.TransferableObject

      `clone`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NetMessage

          public NetMessage(NetMessageType type)

    - #### NetMessage

          public NetMessage(java.lang.Object arg)

    - #### NetMessage

          public NetMessage(ServerStatusEvent event)

    - #### NetMessage

          public NetMessage(NetMessageType type,
                    java.lang.Object arg)

  - ### Method Detail

    - #### getType

          public NetMessageType getType()

    - #### getArgument

          public java.lang.Object getArgument()

    - #### deepClone

          public NetMessage deepClone()

      Description copied from interface: `DeepCloneable`
      Returns a deep clone of this object
      Specified by:
        `deepClone` in interface `DeepCloneable`
      Overrides:
        `deepClone` in class `TransferableObject`

    - #### getTargetSession

          public SessionId getTargetSession()

      Setting a target session indicates that the message is being sent to this session only.
      Specified by:
        `getTargetSession` in interface `DeliverableMessage`

    - #### setTargetSession

          public void setTargetSession(SessionId toSessId)

      Specified by:
        `setTargetSession` in interface `DeliverableMessage`

    - #### hasTargetSession

          public boolean hasTargetSession()

      Specified by:
        `hasTargetSession` in interface `DeliverableMessage`

    - #### getFromSession

          public SessionId getFromSession()

      Specified by:
        `getFromSession` in interface `DeliverableMessage`

    - #### setFromSession

          public void setFromSession(SessionId fromSessId)

      Specified by:
        `setFromSession` in interface `DeliverableMessage`

    - #### hasFromSession

          public boolean hasFromSession()

      Specified by:
        `hasFromSession` in interface `DeliverableMessage`

    - #### isSkipSender

          public boolean isSkipSender()

      Description copied from interface: `DeliverableMessage`
      If this flag is set, then the message is sent to all sessions except the session of the sender himself.
      Specified by:
        `isSkipSender` in interface `DeliverableMessage`

    - #### setSkipSender

          public void setSkipSender(boolean isSkipSender)

      Specified by:
        `setSkipSender` in interface `DeliverableMessage`

    - #### hasTargetUser

          public boolean hasTargetUser()

      Specified by:
        `hasTargetUser` in interface `DeliverableMessage`

    - #### getTargetUsers

          public java.lang.String[] getTargetUsers()

      Only set if setTargetUser(String) was explicitly called
      Specified by:
        `getTargetUsers` in interface `DeliverableMessage`

    - #### setTargetUser

          public void setTargetUser(java.lang.String userName)

      Setting a userName indicates that the message is being sent to this users sessions only.
      Specified by:
        `setTargetUser` in interface `DeliverableMessage`

    - #### setTargetUsers

          public void setTargetUsers(java.lang.String[] userNames)

      Specified by:
        `setTargetUsers` in interface `DeliverableMessage`

    - #### setTargetUsers

          public void setTargetUsers(java.util.List<java.lang.String> userNames)

    - #### isPing

          public boolean isPing()

    - #### isClientCommand

          public boolean isClientCommand()

    - #### isRemoteTaskEvent

          public boolean isRemoteTaskEvent()

    - #### isAgentMessage

          public boolean isAgentMessage()

    - #### isSystemEvent

          public boolean isSystemEvent()

    - #### isServerShutdown

          public boolean isServerShutdown()

    - #### isServerStatusMessage

          public boolean isServerStatusMessage()

      Tells whether this message is caused by the server itself. The client needs a registration in order to receive this type of message.

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing DumpString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.