copyright The Portico Project 2008.

org.portico.shared.msg
Class RTI_RequestMessage

java.lang.Object
  extended by com.lbf.commons.messaging.RequestMessage
      extended by org.portico.shared.msg.RTI_RequestMessage
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EXT_Terminate, INT_NewSubscription, INT_ObjectRegistered, RTI_AssociateForUpdates, RTI_CreateFederation, RTI_CreateRegion, RTI_DeleteObject, RTI_DeleteRegion, RTI_DestroyFederation, RTI_DisableTimeConstrained, RTI_DisableTimeRegulation, RTI_EnableTimeConstrained, RTI_EnableTimeRegulation, RTI_JoinFederation, RTI_LocalDelete, RTI_ModifyLookahead, RTI_ModifyRegion, RTI_NextEventRequest, RTI_PublishInteractionClass, RTI_PublishObjectClass, RTI_QueryGALT, RTI_RegisterObject, RTI_RequestClassUpdate, RTI_RequestObjectUpdate, RTI_ResignFederation, RTI_SendInteraction, RTI_SubscribeInteractionClass, RTI_SubscribeObjectClass, RTI_SyncAchieved, RTI_SyncPointReg, RTI_TimeAdvanceRequest, RTI_UnassociateForUpdates, RTI_UnpublishInteractionClass, RTI_UnpublishObjectClass, RTI_UnsubscribeInteractionClass, RTI_UnsubscribeObjectClass, RTI_UpdateAttributes

public abstract class RTI_RequestMessage
extends com.lbf.commons.messaging.RequestMessage

This class should be the parent class of all request messages that start at the federate and are sent to the RTI. It contains a String member that identifies the federate where the request originated.

IMPLEMENTATION NOTE: Although this class *doesn't* implement java.io.Externalizable , it does provide implementations of the required methods so that subclasses can call them if they want to (thus removing the need to handle the parent class data). It also implements private writeObject and readObject methods for faster serialization where a child class is not Externalizable.

See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
protected  String targetFederate
           
protected  double timestamp
           
 
Constructor Summary
protected RTI_RequestMessage()
           
 
Method Summary
protected  String bytesToString(byte[] bytes)
           
 String getTargetFederate()
           
 double getTimestamp()
          This method will return the current timestamp value for this message.
 boolean isTimestamped()
          This method will return true if the current timestamp is not equal to PorticoConstants.NULL_TIME.
 void readExternal(ObjectInput input)
           
private  void readObject(ObjectInputStream ois)
           
 void setTargetFederate(String targetFederate)
           
 void setTimestamp(double timestamp)
           
protected  byte[] stringToBytes(String string)
           
 void writeExternal(ObjectOutput output)
           
private  void writeObject(ObjectOutputStream oos)
           
 
Methods inherited from class com.lbf.commons.messaging.RequestMessage
getIdentifier, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

targetFederate

protected String targetFederate

timestamp

protected double timestamp
Constructor Detail

RTI_RequestMessage

protected RTI_RequestMessage()
Method Detail

getTargetFederate

public String getTargetFederate()

setTargetFederate

public void setTargetFederate(String targetFederate)

isTimestamped

public boolean isTimestamped()
This method will return true if the current timestamp is not equal to PorticoConstants.NULL_TIME. If it is equal to that value, the message is not meant to be timestamped (thus, false will be returned).


getTimestamp

public double getTimestamp()
This method will return the current timestamp value for this message. By default it will return PorticoConstants.NULL_TIME. If you want a message to no longer have a timestamp, you should call setTimestamp(PorticoConstants.NULL_TIME).


setTimestamp

public void setTimestamp(double timestamp)

writeObject

private void writeObject(ObjectOutputStream oos)
                  throws IOException
Throws:
IOException

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Overrides:
readExternal in class com.lbf.commons.messaging.RequestMessage
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Overrides:
writeExternal in class com.lbf.commons.messaging.RequestMessage
Throws:
IOException

bytesToString

protected String bytesToString(byte[] bytes)

stringToBytes

protected byte[] stringToBytes(String string)

copyright The Portico Project 2008.