|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgr.uoa.di.madgik.grs.record.Record
public abstract class Record
This class is the base class for all Records that are handled by the gRS2 set of components. All implementations
of this abstract class must define a default constructor without arguments as instances of these classes will be instantiated
using reflection based on the existence of a default no arguments constructor. One thing that distinguishes the records
belonging to one IBuffer, is the id. This id is set from within the framework once the record is bound to an
IBuffer as described in bind(IBuffer). This means that the id of each Record represents the
index of the Record within the virtually infinite array of Records managed by the IBuffer
| Constructor Summary | |
|---|---|
Record()
|
|
| Method Summary | |
|---|---|
void |
bind(IBuffer buffer)
Binds the Record to the provided IBuffer. |
void |
deflate(java.io.DataOutput out)
Deflates the state and data of the implementor in a from capable of reconstructing the exact same instance |
void |
dispose()
Disposes all internally kept state, calls extendDispose() and then for every hosted Field, calls
Field.dispose() |
abstract void |
extendDeflate(java.io.DataOutput out)
The method all Record implementations should implement to add any information they keep during deflate |
abstract void |
extendDispose()
Method to be implemented by Record extenders to dispose any internally kept state |
abstract void |
extendInflate(java.io.DataInput in,
boolean reset)
The method all Record implementations should implement to read any information they deflated |
abstract void |
extendReceive(java.io.DataInput in)
The method all Record implementations should implement to read any information they send during transfer |
abstract void |
extendReceiveFromXML(org.w3c.dom.Element element)
|
abstract void |
extendSend(java.io.DataOutput out)
The method all Record implementations should implement to add any information they keep during transfer |
abstract void |
extendSendToXML(org.w3c.dom.Document doc,
org.w3c.dom.Element element)
|
void |
fromXML(org.w3c.dom.Element element)
|
RecordDefinition |
getDefinition()
Retrieves the RecordDefinition associated with this Record. |
int |
getDefinitionIndex()
Gets the index of the definition of this Record in the record definitions array provided to the IBuffer |
Field |
getField(int index)
Retrieve the Field with the specified index in the fields array |
Field |
getField(java.lang.String name)
Retrieve the Field with the specified name |
Field[] |
getFields()
Retrieves the Fields this Record hosts |
long |
getID()
Retrieves the id of the Record |
void |
hide()
Hides the Record from the IBuffer it is currectly bound to so that it won't be disposed by the former. |
void |
inflate(java.io.DataInput in)
Inflate the state and data of the implementor as was previously deflated using IPumpable.deflate(DataOutput) |
void |
inflate(java.io.DataInput in,
boolean reset)
Inflate the state and data of the implementor as was previously deflated using IPumpable.deflate(DataOutput) |
boolean |
isBoundTo(IBuffer buffer)
Determines whether this Record is bound to a specific instance of IBuffer |
boolean |
isRemoteCopy()
Retrieves if this is the remote copy of the record |
void |
makeAvailable()
For all hosted Fields, the method makeAvailable(int) |
void |
makeAvailable(int fieldIndex)
For the specified Field with the set index, the method Record#makeAvailable(TransportOverride, int) with a
value of IBuffer.TransportOverride.Override |
void |
makeAvailable(java.lang.String fieldName)
For the specified Field with the set name, the method Record#makeAvailable(TransportOverride, int) with a
value of IBuffer.TransportOverride.Override |
void |
makeLocal()
Called by RecordWriter.importRecord(T). |
void |
markActivity()
Notifies the IBuffer associated with this Record that some activity has taken place |
void |
prebind(IBuffer buffer)
This method performs a pre-bind of the Record to the provided IBuffer to enable the invocation of some
other method that needs to have the IBuffer of the record available but before adding the record to the IBuffer
properly |
void |
receive(java.io.DataInput in)
Receives the state and payload of the Record from a remote sender. |
void |
receiveFromXML(org.w3c.dom.Element element)
|
void |
requestPartial(IBuffer.TransportOverride override,
int fieldIndex)
if the associated IBuffer has a IMirror set, then the IMirror#requestPartial(long, int, TransportOverride, Object)
method is used to request additional payload for the specific Field of the Record. |
IBuffer.TransportDirective |
resolveTransportDirective()
Resolves the IBuffer.TransportDirective that should be used fir this record. |
void |
send(java.io.DataOutput out)
Sends the state and payload of the Record to a remote requester. |
org.w3c.dom.Element |
sendToXML(org.w3c.dom.Document doc)
|
void |
setDefinitionIndex(int index)
Sets the index of the definition of this Record in the record definitions array provided to the IBuffer |
void |
setFields(Field[] fields)
Sets the Fields this Record hosts |
void |
setRemoteCopy(boolean remoteCopy)
Set if the current instance of the Record is a remote copy of the original instance of the Record |
void |
show()
Reveals a hidden Record to the IBuffer, making available all functionality related to the former. |
org.w3c.dom.Element |
toXML(org.w3c.dom.Document doc)
|
void |
unbind()
Unbinds the Record from the IBuffer. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Record()
| Method Detail |
|---|
public long getID()
Record
public RecordDefinition getDefinition()
throws GRS2RecordDefinitionException,
GRS2BufferException
RecordDefinition associated with this Record. This operation is only available
after the bind(IBuffer) method is invoked. This method is typically invoked when a Record
is added to an IBuffer
GRS2RecordDefinitionException - if the Record was not properly bind to a IBuffer
GRS2BufferException - the available definitions could not be retrieved from the IBufferpublic int getDefinitionIndex()
Record in the record definitions array provided to the IBuffer
public void setDefinitionIndex(int index)
Record in the record definitions array provided to the IBuffer
index - the indexpublic void setFields(Field[] fields)
Fields this Record hosts
fields - the fieldspublic Field[] getFields()
Fields this Record hosts
public Field getField(java.lang.String name)
throws GRS2RecordDefinitionException,
GRS2BufferException
Field with the specified name
name - the name of the field as is defined in the Field's FieldDefinition
GRS2RecordDefinitionException - If there was a problem retrieving the available fields definitions
GRS2BufferException - If there was a problem retrieving the definitions from the IBufferpublic Field getField(int index)
Field with the specified index in the fields array
index - the field index
public void bind(IBuffer buffer)
throws GRS2BufferException,
GRS2RecordDefinitionException
Record to the provided IBuffer. If the record has no definition index defined and the buffer's
record definitions only contain a single definition, the only available definition is used by default. The id of the record
is set as IBuffer.totalRecords()-1. Therefore the id always coincides with the virtual index of the Record
if one considers the Record as being available in an unbounded array of Records. For every Field
available in the Record, the Field.setDefinitionIndex(int) as well as Field.bind(Record) method
is invoked.
buffer - the IBuffer to bind this record to
GRS2BufferException - the IBuffer state does not permit this operation to be completed
GRS2RecordDefinitionException - no usable definition could be found and associated with the Recordpublic void unbind()
Record from the IBuffer. The id of the record, its definition index are reset and any information pertaining to
partial transfers are reset. The Fields are not unbound from the Record
public void hide()
Record from the IBuffer it is currectly bound to so that it won't be disposed by the former. All buffer related functionality will
not be available until the record is revealed again to the IBuffer
public void show()
Record to the IBuffer, making available all functionality related to the former.
The record still won't be explicitly disposed by the IBuffer
public boolean isBoundTo(IBuffer buffer)
Record is bound to a specific instance of IBuffer
buffer - the IBuffer which this record will be tested against
Record is bound to the IBuffer, false otherwise regardless if the record is bound to another
buffer or not bound to any bufferpublic void prebind(IBuffer buffer)
Record to the provided IBuffer to enable the invocation of some
other method that needs to have the IBuffer of the record available but before adding the record to the IBuffer
properly
buffer - the IBuffer to pre-bind topublic void markActivity()
IBuffer associated with this Record that some activity has taken place
public void setRemoteCopy(boolean remoteCopy)
Record is a remote copy of the original instance of the Record
remoteCopy - whether or not this is the remote copypublic boolean isRemoteCopy()
public IBuffer.TransportDirective resolveTransportDirective()
throws GRS2RecordDefinitionException,
GRS2BufferException
IBuffer.TransportDirective that should be used fir this record. In case the defined IBuffer.TransportDirective
is set to IBuffer.TransportDirective.Inherit, a call to the bound IBuffer's IBuffer.resolveTransportDirective()
IBuffer.TransportDirective
GRS2RecordDefinitionException - the record definition is not available
GRS2BufferException - the buffer is unavailable
public final void deflate(java.io.DataOutput out)
throws GRS2RecordSerializationException
Record to the provided stream. After deflating the internally kept
information, a call to extendDeflate(DataOutput) is made and then for each field hosted, a call to
Field.deflate(DataOutput) is made
deflate in interface IPumpableout - the stream to deflate to
GRS2RecordSerializationException - there was a problem serializing the information
public final void send(java.io.DataOutput out)
throws GRS2RecordSerializationException
Record to a remote requester. After writing the internally managed information,
a call to extendSend(DataOutput) is made, and for every Field hosted, a call to Field.send(DataOutput)
is made
out - the stream to send to
GRS2RecordSerializationException - there was a problem serializing the information
public final org.w3c.dom.Element sendToXML(org.w3c.dom.Document doc)
throws GRS2RecordSerializationException
GRS2RecordSerializationException
public final void inflate(java.io.DataInput in)
throws GRS2RecordSerializationException
IPumpable.deflate(DataOutput)
Similar as calling inflate(DataInput, boolean) with a reset parameter of false
inflate in interface IPumpablein - the stream to inflate from
GRS2RecordSerializationException - the inflate could not be completedinflate(DataInput, boolean),
IPumpable.inflate(java.io.DataInput)
public final void inflate(java.io.DataInput in,
boolean reset)
throws GRS2RecordSerializationException
IPumpable.deflate(DataOutput)
Inflates the Record from the provided stream as it was previously deflated using the method deflate(DataOutput).
After deflating the internally kept information, the stream is passed to extendDeflate(DataOutput) and then the
serializations of the hosted Fields are read by the respective Field.inflate(DataInput, boolean)
inflate in interface IPumpablein - the stream to inflate fromreset - whether or not the inflated information should be reset to drop any information previously stored concerning transfers
performed by the Record
GRS2RecordSerializationException - there was a problem deserializing the information
public final void receive(java.io.DataInput in)
throws GRS2RecordSerializationException
Record from a remote sender. After reading the internally managed information,
a call to extendReceive(DataInput) is made, and for every Field hosted, a call to Field.receive(DataInput)
is made
in - the stream to receive from
GRS2RecordSerializationException - there was a problem deserializing the informationpublic final void makeLocal()
RecordWriter.importRecord(T). External usage is unnecessary and discouraged.
Resets all internally kept information concerning transfers performed by the Record and makes it behave as it were local.
For all Fields, Field.makeLocal() is invoked, therefore if partial transfers are involved Field.makeAvailable()
should be invoked beforehand in case the full payload is needed.
Field.makeLocal()
public abstract void extendSend(java.io.DataOutput out)
throws GRS2RecordSerializationException
Record implementations should implement to add any information they keep during transfer
out - the stream to transfer through
GRS2RecordSerializationException - Information serialization problem
public abstract void extendSendToXML(org.w3c.dom.Document doc,
org.w3c.dom.Element element)
throws GRS2RecordSerializationException
GRS2RecordSerializationException
public abstract void extendReceiveFromXML(org.w3c.dom.Element element)
throws GRS2RecordSerializationException
GRS2RecordSerializationException
public abstract void extendReceive(java.io.DataInput in)
throws GRS2RecordSerializationException
Record implementations should implement to read any information they send during transfer
in - the stream to read from
GRS2RecordSerializationException - Information deserialization error
public abstract void extendDeflate(java.io.DataOutput out)
throws GRS2RecordSerializationException
Record implementations should implement to add any information they keep during deflate
out - the stream to deflate to
GRS2RecordSerializationException - Information serialization problem
public abstract void extendInflate(java.io.DataInput in,
boolean reset)
throws GRS2RecordSerializationException
Record implementations should implement to read any information they deflated
in - the stream to inflate fromreset - whether or not the inflated information should be reset to drop any information previously stored concerning transfers
performed by the Field
GRS2RecordSerializationException - Information deserialization errorpublic void dispose()
extendDispose() and then for every hosted Field, calls
Field.dispose()
public abstract void extendDispose()
Record extenders to dispose any internally kept state
public void requestPartial(IBuffer.TransportOverride override,
int fieldIndex)
throws GRS2ProxyMirrorException
IBuffer has a IMirror set, then the IMirror#requestPartial(long, int, TransportOverride, Object)
method is used to request additional payload for the specific Field of the Record. Requests for more of partial
content can only be issued against Fields of a Record and not for Records themselves
override - the IBuffer.TransportOverride directivefieldIndex - the field index to request data for
GRS2ProxyMirrorException - The state of the IMirror does not allow for this operation to be completed
public void makeAvailable()
throws GRS2RecordDefinitionException,
GRS2ProxyMirrorException,
GRS2BufferException
Fields, the method makeAvailable(int)
GRS2RecordDefinitionException - the record definition could not be retrieved
GRS2ProxyMirrorException - There was an error during the mirroring process
GRS2BufferException - the IBuffer state does not allow for this operation to be completed
public void makeAvailable(java.lang.String fieldName)
throws GRS2RecordDefinitionException,
GRS2ProxyMirrorException,
GRS2BufferException
Field with the set name, the method Record#makeAvailable(TransportOverride, int) with a
value of IBuffer.TransportOverride.Override
fieldName - the name of the field to make available
GRS2RecordDefinitionException - the record definition could not be retrieved
GRS2ProxyMirrorException - There was an error during the mirroring process
GRS2BufferException - the IBuffer state does not allow for this operation to be completed
public void makeAvailable(int fieldIndex)
throws GRS2RecordDefinitionException,
GRS2ProxyMirrorException,
GRS2BufferException
Field with the set index, the method Record#makeAvailable(TransportOverride, int) with a
value of IBuffer.TransportOverride.Override
fieldIndex - the index of the field
GRS2RecordDefinitionException - the record definition could not be retrieved
GRS2ProxyMirrorException - There was an error during the mirroring process
GRS2BufferException - the IBuffer state does not allow for this operation to be completed
public final org.w3c.dom.Element toXML(org.w3c.dom.Document doc)
throws GRS2RecordSerializationException
toXML in interface IPumpableGRS2RecordSerializationException
public final void receiveFromXML(org.w3c.dom.Element element)
throws GRS2RecordSerializationException
GRS2RecordSerializationException
public final void fromXML(org.w3c.dom.Element element)
throws GRS2RecordSerializationException
fromXML in interface IPumpableGRS2RecordSerializationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||