gr.uoa.di.madgik.grs.record.field
Class ObjectField

java.lang.Object
  extended by gr.uoa.di.madgik.grs.record.field.Field
      extended by gr.uoa.di.madgik.grs.record.field.ObjectField
All Implemented Interfaces:
IPumpable

public class ObjectField
extends Field

Field holding the payload of an Object that extends IPumpable

Author:
gpapanikos

Constructor Summary
ObjectField()
          Creates a new instance
ObjectField(IPumpable payload)
          Creates a new instance
 
Method Summary
 void extendDeflate(java.io.DataOutput out)
          Method that needs to be implemented by the class extenders to deflate the information they keep
 void extendDispose()
          Method to be implemented by class extenders to dispose their internal state
 void extendFromXML(org.w3c.dom.Element element, boolean reset)
           
 void extendInflate(java.io.DataInput in, boolean reset)
          Method that needs to be implemented by the Field extenders to inflate their internal information
 void extendReceive(java.io.DataInput in, IBuffer.TransportOverride override)
          Method that needs to be implemented by the Field extenders to receive their priveously send information
 void extendReceiveFromXML(org.w3c.dom.Element element, IBuffer.TransportOverride override)
           
 void extendSend(java.io.DataOutput out, IBuffer.TransportOverride override)
          Method that needs to be implemented by the class extenders to send the information they keep
 void extendSendToXML(org.w3c.dom.Document doc, org.w3c.dom.Element element, IBuffer.TransportOverride override)
           
 void extendToXML(org.w3c.dom.Document doc, org.w3c.dom.Element element)
           
 ObjectFieldDefinition getFieldDefinition()
          Retrieves the FieldDefinition based on the definition index and the bound Record RecordDefinition
 java.io.InputStream getInputStream()
          Provides an InputStream over the locally available payload of the Field
 IPumpable getPayload()
          Retrieves the payload of the field
 boolean isAvailable()
          Method that needs to be implemented by class extenders to indicate in case of a remote field copy when the field is not expecting any more data from its original instance.
 void setPayload(IPumpable payload)
          Sets the payload of the field
 
Methods inherited from class gr.uoa.di.madgik.grs.record.field.Field
bind, deflate, dispose, fromXML, fromXML, getDefinitionIndex, getMediatingInputStream, inflate, inflate, isRemoteCopy, makeAvailable, makeAvailable, makeLocal, prebind, receive, receiveFromXML, resolveTransportDirective, send, sendToXML, setDefinitionIndex, setRemoteCopy, toXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectField

public ObjectField()
Creates a new instance


ObjectField

public ObjectField(IPumpable payload)
Creates a new instance

Parameters:
payload - the payload of the field
Method Detail

setPayload

public void setPayload(IPumpable payload)
Sets the payload of the field

Parameters:
payload -

getPayload

public IPumpable getPayload()
Retrieves the payload of the field

Returns:
the field payload
Throws:
GRS2RecordException

getFieldDefinition

public ObjectFieldDefinition getFieldDefinition()
                                         throws GRS2RecordDefinitionException
Retrieves the FieldDefinition based on the definition index and the bound Record RecordDefinition

Overrides:
getFieldDefinition in class Field
Returns:
the field definition
Throws:
GRS2RecordDefinitionException - if the Field is not bound to a Record or no usable definition has been found
See Also:
Field.getFieldDefinition()

isAvailable

public boolean isAvailable()
Method that needs to be implemented by class extenders to indicate in case of a remote field copy when the field is not expecting any more data from its original instance. For an instance that is not remote, the field is always available

Specified by:
isAvailable in class Field
Returns:
whether or not the remote copy is available
See Also:
Field.isAvailable()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Provides an InputStream over the locally available payload of the Field

The full payload serialization is transformed into a byte array. This is not a good method to use for large objects serialization. In general this method is left for homogeneity but should be avoided

Specified by:
getInputStream in class Field
Returns:
the input stream
Throws:
java.io.IOException - The input stream could not be created
See Also:
Field.getInputStream()

extendSend

public void extendSend(java.io.DataOutput out,
                       IBuffer.TransportOverride override)
                throws GRS2RecordSerializationException
Method that needs to be implemented by the class extenders to send the information they keep

Specified by:
extendSend in class Field
Parameters:
out - the stream to send information to
override - the IBuffer.TransportOverride directive
Throws:
GRS2RecordSerializationException - There was a problem in the serialization
See Also:
Field.extendSend(java.io.DataOutput, gr.uoa.di.madgik.grs.buffer.IBuffer.TransportOverride)

extendReceive

public void extendReceive(java.io.DataInput in,
                          IBuffer.TransportOverride override)
                   throws GRS2RecordSerializationException
Method that needs to be implemented by the Field extenders to receive their priveously send information

Specified by:
extendReceive in class Field
Parameters:
in - the stream to receive from
override - the IBuffer.TransportOverride to use
Throws:
GRS2RecordSerializationException - There was a problem in the deserialization
See Also:
Field.extendReceive(java.io.DataInput, gr.uoa.di.madgik.grs.buffer.IBuffer.TransportOverride)

extendDispose

public void extendDispose()
Method to be implemented by class extenders to dispose their internal state

Specified by:
extendDispose in class Field
See Also:
Field.extendDispose()

extendDeflate

public void extendDeflate(java.io.DataOutput out)
                   throws GRS2RecordSerializationException
Method that needs to be implemented by the class extenders to deflate the information they keep

Specified by:
extendDeflate in class Field
Parameters:
out - the stream to deflate to
Throws:
GRS2RecordSerializationException - There was a problem in the serialization
See Also:
Field.extendDeflate(java.io.DataOutput)

extendToXML

public void extendToXML(org.w3c.dom.Document doc,
                        org.w3c.dom.Element element)
                 throws GRS2RecordSerializationException
Specified by:
extendToXML in class Field
Throws:
GRS2RecordSerializationException

extendFromXML

public void extendFromXML(org.w3c.dom.Element element,
                          boolean reset)
                   throws GRS2RecordSerializationException
Specified by:
extendFromXML in class Field
Throws:
GRS2RecordSerializationException

extendInflate

public void extendInflate(java.io.DataInput in,
                          boolean reset)
                   throws GRS2RecordSerializationException
Method that needs to be implemented by the Field extenders to inflate their internal information

Specified by:
extendInflate in class Field
Parameters:
in - the stream to inflate from
reset - whether or not the inflated information needs to be reset to clear any indication of previous executed transfers
Throws:
GRS2RecordSerializationException - There was a problem in the deserialization
See Also:
Field.extendInflate(java.io.DataInput, boolean)

extendSendToXML

public void extendSendToXML(org.w3c.dom.Document doc,
                            org.w3c.dom.Element element,
                            IBuffer.TransportOverride override)
                     throws GRS2RecordSerializationException
Specified by:
extendSendToXML in class Field
Throws:
GRS2RecordSerializationException

extendReceiveFromXML

public void extendReceiveFromXML(org.w3c.dom.Element element,
                                 IBuffer.TransportOverride override)
                          throws GRS2RecordSerializationException
Specified by:
extendReceiveFromXML in class Field
Throws:
GRS2RecordSerializationException