org.lsst.ccs.bus
Class DataStatus

java.lang.Object
  extended by org.lsst.ccs.bus.BusMessage
      extended by org.lsst.ccs.bus.Status
          extended by org.lsst.ccs.bus.DataStatus
All Implemented Interfaces:
Serializable, BusPayload
Direct Known Subclasses:
TrendingStatus

public class DataStatus
extends Status

Status with additional information.

This class can used instead of subclassing Status: if the receiver does not have the needed classes in its classPath the code won't crash .

Author:
bamade
See Also:
Serialized Form

Field Summary
protected  Object value
           
 
Fields inherited from class org.lsst.ccs.bus.Status
state
 
Fields inherited from class org.lsst.ccs.bus.BusMessage
detailLevel, origin, priorityLevel, summary, timeStamp
 
Constructor Summary
protected DataStatus()
          for use by subclasses only
  DataStatus(char charValue)
           
  DataStatus(Class clazz, Serializable serializable)
          to be mostly used when primitive types are to be used.
  DataStatus(double doubleValue)
           
  DataStatus(float floatValue)
           
  DataStatus(int intValue)
           
  DataStatus(Serializable serializable)
          any Object including null values.
 
Method Summary
protected  String contentString()
           
 Object getData()
          gets the data content but throws an Excepton if the object cannot be deserialized
 String getDataClassName()
          what is the class of the contained data? Developers of subclasses should override this method.
 boolean isOfPrimitiveType()
          is the content to be considered of a primitive type? Developers of subclasses should override this method.
 boolean isOfWellKnownType()
          is the content of a "Well known type" as defined in ObjectNType.
 String toString()
           
 
Methods inherited from class org.lsst.ccs.bus.Status
getMessageType, getState, setState
 
Methods inherited from class org.lsst.ccs.bus.BusMessage
getDetailLevel, getOrigin, getPriorityLevel, getSummary, getTimeStamp, setDetailLevel, setOrigin, setPriorityLevel, setSummary, setTimeStamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected Object value
Constructor Detail

DataStatus

protected DataStatus()
for use by subclasses only


DataStatus

public DataStatus(Serializable serializable)
any Object including null values.

Parameters:
serializable -

DataStatus

public DataStatus(Class clazz,
                  Serializable serializable)
to be mostly used when primitive types are to be used. (the real type such as Integer.TYPE is kept)

Parameters:
clazz -
serializable -

DataStatus

public DataStatus(int intValue)

DataStatus

public DataStatus(double doubleValue)

DataStatus

public DataStatus(float floatValue)

DataStatus

public DataStatus(char charValue)
Method Detail

isOfWellKnownType

public boolean isOfWellKnownType()
is the content of a "Well known type" as defined in ObjectNType. Developers of subclasses should override this method.

Returns:

isOfPrimitiveType

public boolean isOfPrimitiveType()
is the content to be considered of a primitive type? Developers of subclasses should override this method.

Returns:

getDataClassName

public String getDataClassName()
what is the class of the contained data? Developers of subclasses should override this method.

Beware: having the corresponding class in the ClassPath does not guarantee that the object will be deserialized properly (depends on class version)

Returns:

getData

public Object getData()
               throws ClassNotFoundException
gets the data content but throws an Excepton if the object cannot be deserialized

Returns:
Throws:
ClassNotFoundException

contentString

protected String contentString()

toString

public String toString()
Overrides:
toString in class Status


Copyright © 2013 LSST. All Rights Reserved.