AdventNet Web NMS 4 DMS API Specification

com.adventnet.nms.extranet.remote.communication.fw
Class DataObject
java.lang.Object
  |
  +--com.adventnet.nms.extranet.remote.communication.fw.DataObject
All Implemented Interfaces:
java.io.Serializable

public class DataObject
extends java.lang.Object
implements java.io.Serializable

For smooth data transfer between the DMS and Central Server, the data is sent as a modeled object called DataObject. This object holds all the required information on the data. The DataObject currently supports XML Element (vastly used data representation) and any Serializable Object as inputs to construct the DataObject. Moreover the XML element need not be parsed to construct the DataObject. To get an instance of this object, the default constructor of this class can be used. Required fields and data can be set for the DataObject instance, to be sent to DMS or the Central Server.

See Also:
Serialized Form

Field Summary
static int ELEMENT
          Identifies the type of data given as input data to construct DataObject.
static int OBJECT
          Identifies the type of data given as input data to construct DataObject.
 
Constructor Summary
DataObject()
           
 
Method Summary
 java.lang.String getDataID()
          Returns the Data ID of the DataObject.
 int getDataPriority()
          Returns the priority set to send the DataObject.
 int getDataType()
          Returns DataObject.OBJECT or DataObject.ELEMENT according to the data type set.
 org.w3c.dom.Element getElementData()
          This method returns the Element with which this DataObject is constructed.
 int getNotificationType()
          Returns the Notification Type of the DataObject.
 java.lang.Object getObjectData()
          This method returns the Object with which this DataObject is constructed.
 java.lang.String getRegionID()
          Returns the Region ID of the DMS to which the data belongs.
 java.util.Properties getUserProperties()
          Returns the user property of the DataObject.
 boolean isDataAvailable()
          Checks for the availability of data in the DataObject.
 void setDataID(java.lang.String dataID)
          Sets the Data ID of the DataObject.
 void setDataPriority(int dataPriority)
          Sets the priority to send the DataObject from DMS to Central Server.
 void setDataType(int dataType)
          Sets the data type to the DataObject as either Element or Object.
 void setElementData(org.w3c.dom.Element ele)
          Sets the Element as data to the created DataObject instance.
 void setNotificationType(int notificationType)
          Sets the Notification Type of the DataObject.
 void setObjectData(java.lang.Object obj)
          To transfer a serializable Object from or to DMS or Central Server, the Object is given as a parameter to this method for the created DataObject instance.
 void setRegionID(java.lang.String regionID)
          Sets the Region ID of the DMS to which the data belongs.
 void setUserProperties(java.util.Properties userProps)
          Sets the user property for the DataObject.Users can set their own property set to the DataObject before sending it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT

public static final int OBJECT
Identifies the type of data given as input data to construct DataObject. This field denotes Object as the input data

ELEMENT

public static final int ELEMENT
Identifies the type of data given as input data to construct DataObject. This field denotes Element as the input data
Constructor Detail

DataObject

public DataObject()
Method Detail

getDataID

public java.lang.String getDataID()
Returns the Data ID of the DataObject. The Data ID contains the buffer from which the DataObject is recieved and a number specific to the DataObject.
Returns:
Data ID of the DataObject.
See Also:
setDataID(String)

setDataID

public void setDataID(java.lang.String dataID)
Sets the Data ID of the DataObject. The Data ID contains the buffer from which the DataObject is recieved and a number specific to the DataObject.
Parameters:
dataID - Data ID of the DataObject.
See Also:
getDataID()

getDataType

public int getDataType()
Returns DataObject.OBJECT or DataObject.ELEMENT according to the data type set. If the DataObject is constructed using an Element as data type, then this method returns DataObject.ELEMENT as the value.
Returns:
data type of the DataObject.
See Also:
setDataType(int)

setDataType

public void setDataType(int dataType)
Sets the data type to the DataObject as either Element or Object. This is to identify the type of data from which DataObject is constructed.
Parameters:
dataType - data type of the DataObject.
See Also:
getDataType()

getRegionID

public java.lang.String getRegionID()
Returns the Region ID of the DMS to which the data belongs.
Returns:
RegionID of the DMS.
See Also:
setRegionID(String)

setRegionID

public void setRegionID(java.lang.String regionID)
Sets the Region ID of the DMS to which the data belongs.
Parameters:
regionID - RegionID of the DMS.
See Also:
getRegionID()

getDataPriority

public int getDataPriority()
Returns the priority set to send the DataObject.
Returns:
priority of the DataObject.
See Also:
setDataPriority(int)

setDataPriority

public void setDataPriority(int dataPriority)
Sets the priority to send the DataObject from DMS to Central Server. Valid values for this field are DataPriorityID.SEND_IMMEDIATE_WITHOUT_STORE, DataPriorityID.HIGHPRIORITY_SEND_IMMEDIATE, DataPriorityID.HIGHPRIORITY,DataPriorityID.LOWPRIORITY.
Parameters:
dataPriority - priority to send the DataObject.
See Also:
getDataPriority()

getNotificationType

public int getNotificationType()
Returns the Notification Type of the DataObject. The notification type indicates the module from which the DataObject is recieved.
Returns:
Notification Type of the DataObject.
See Also:
setNotificationType(int)

setNotificationType

public void setNotificationType(int notificationType)
Sets the Notification Type of the DataObject. The notification type indicates the module from which the DataObject is received.
Parameters:
notificationType - Notification Type of the DataObject.
See Also:
getNotificationType()

getUserProperties

public java.util.Properties getUserProperties()
Returns the user property of the DataObject.
Returns:
User Property of the DataObject.
See Also:
setUserProperties(Properties)

setUserProperties

public void setUserProperties(java.util.Properties userProps)
Sets the user property for the DataObject.Users can set their own property set to the DataObject before sending it.
Parameters:
userProps - User Property of the DataObject.
See Also:
getUserProperties()

isDataAvailable

public boolean isDataAvailable()
Checks for the availability of data in the DataObject. Returns true if the DataObject contains any data.
Returns:
a boolean indicating whether the DataObject contains any data.

setElementData

public void setElementData(org.w3c.dom.Element ele)
Sets the Element as data to the created DataObject instance. The instance of the DataObject created by default constructor does not have any data. To send an XML Element from or to DMS or Central Server, DataObject instance is created first and then this method is called to set the Element as the data for the created instance. Alternatively, DataObjectUtil.getDataObject method can be used.
See Also:
setObjectData(java.lang.Object)

setObjectData

public void setObjectData(java.lang.Object obj)
                   throws java.io.NotSerializableException
To transfer a serializable Object from or to DMS or Central Server, the Object is given as a parameter to this method for the created DataObject instance. Alternatively DataObjectUtil.getDataObject method can be used. setElementData(Element)
Throws:
java.io.NotSerializableException -  

getElementData

public org.w3c.dom.Element getElementData()
This method returns the Element with which this DataObject is constructed.
Returns:
The Element contained within this DataObject.

getObjectData

public java.lang.Object getObjectData()
This method returns the Object with which this DataObject is constructed.
Returns:
The Object contained within this DataObject.

AdventNet Web NMS 4 DMS API Specification