gr.uoa.di.madgik.grs.bridge.xml
Class GCubeXMLRecord

java.lang.Object
  extended by gr.uoa.di.madgik.grs.record.Record
      extended by gr.uoa.di.madgik.grs.bridge.GCubeRecord
          extended by gr.uoa.di.madgik.grs.bridge.xml.GCubeXMLRecord
All Implemented Interfaces:
gr.uoa.di.madgik.grs.record.IPumpable, Serializable

public class GCubeXMLRecord
extends GCubeRecord

GCubeRecord implementation targeting a ResultSet Element that carries only an XML payload

Author:
gpapanikos
See Also:
Serialized Form

Field Summary
static String DefaultValue
          Default value for id, collection and rank
static String RECORD_COLLECTION_NAME
           
static String RECORD_ID_NAME
           
static String RECORD_RANK_NAME
           
 
Constructor Summary
GCubeXMLRecord()
          Create a new instance
GCubeXMLRecord(String payload)
          Create a new instance
GCubeXMLRecord(String id, String collection)
          Create a new instance
GCubeXMLRecord(String id, String collection, String payload)
          Create a new instance
GCubeXMLRecord(String id, String collection, String rank, String payload)
          Create a new instance
 
Method Summary
 String downgrade()
          Downgrade the record to a string serialization that is compatible to the serialization of an "old style" ResultSet record
 void extendDeflate(DataOutput out)
          
 void extendDispose()
          
 void extendInflate(DataInput in, boolean reset)
          
protected  void extendMakeLocal()
          
 void extendReceive(DataInput in)
          
 void extendReceiveFromXML(Element element)
           
 void extendSend(DataOutput out)
          
 void extendSendToXML(Document doc, Element element)
           
 String getCollection()
          Collection ID value
 gr.uoa.di.madgik.grs.record.field.StringField getField(String name)
          
 String getId()
          Object ID value
 String getPayload()
          Utility function returning the Field payload without the client needing to locate it and get it from there
 String getRank()
          Rank value
 void setCollection(String collection)
          Collection ID value
 void setId(String id)
          Object ID value
 void setPayload(String payload)
          Utility function setting the Field payload without the client needing to locate it and set it there
 void setRank(String rank)
          Rank value
 void upgrade(String record)
          Upgrade from the provided "old style" ResultSet record serialization to the provided record
 
Methods inherited from class gr.uoa.di.madgik.grs.record.Record
bind, deflate, dispose, fromXML, getDefinition, getDefinitionIndex, getField, getFields, getID, hide, inflate, inflate, isBoundTo, isRemoteCopy, makeAvailable, makeAvailable, makeAvailable, makeLocal, markActivity, prebind, receive, receiveFromXML, requestPartial, resolveTransportDirective, send, sendToXML, setDefinitionIndex, setFields, setID, setRemoteCopy, show, toXML, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultValue

public static final String DefaultValue
Default value for id, collection and rank

See Also:
Constant Field Values

RECORD_ID_NAME

public static String RECORD_ID_NAME

RECORD_COLLECTION_NAME

public static String RECORD_COLLECTION_NAME

RECORD_RANK_NAME

public static String RECORD_RANK_NAME
Constructor Detail

GCubeXMLRecord

public GCubeXMLRecord()
Create a new instance


GCubeXMLRecord

public GCubeXMLRecord(String payload)
Create a new instance

Parameters:
payload - the payload

GCubeXMLRecord

public GCubeXMLRecord(String id,
                      String collection)
Create a new instance

Parameters:
id - the object id
collection - the collection id

GCubeXMLRecord

public GCubeXMLRecord(String id,
                      String collection,
                      String payload)
Create a new instance

Parameters:
id - the object id
collection - the collection id
payload - the payload

GCubeXMLRecord

public GCubeXMLRecord(String id,
                      String collection,
                      String rank,
                      String payload)
Create a new instance

Parameters:
id - the object id
collection - the collection id
rank - the rank
payload - the payload
Method Detail

setId

public void setId(String id)
Object ID value

Parameters:
id - Object ID value

getId

public String getId()
Object ID value

Returns:
Object ID value

setCollection

public void setCollection(String collection)
Collection ID value

Parameters:
collection - Collection ID value

getCollection

public String getCollection()
Collection ID value

Returns:
Collection ID value

setRank

public void setRank(String rank)
Rank value

Parameters:
rank - rank value

getRank

public String getRank()
Rank value

Returns:
rank value

setPayload

public void setPayload(String payload)
                throws GCubeBridgeException
Utility function setting the Field payload without the client needing to locate it and set it there

Parameters:
payload - the payload to set
Throws:
GCubeBridgeException - the payload field could not be located

getPayload

public String getPayload()
                  throws GCubeBridgeException
Utility function returning the Field payload without the client needing to locate it and get it from there

Returns:
the string payload
Throws:
GCubeBridgeException - the payload field could not be located

downgrade

public String downgrade()
                 throws GCubeBridgeException
Downgrade the record to a string serialization that is compatible to the serialization of an "old style" ResultSet record

Specified by:
downgrade in class GCubeRecord
Returns:
the serialization
Throws:
GCubeBridgeException - the downgrade could not be performed
See Also:
GCubeRecord.downgrade()

upgrade

public void upgrade(String record)
             throws GCubeBridgeException
Upgrade from the provided "old style" ResultSet record serialization to the provided record

Specified by:
upgrade in class GCubeRecord
Parameters:
record - the ResultSet record serialization
Throws:
GCubeBridgeException - the upgrade could not be performed
See Also:
GCubeRecord.upgrade(java.lang.String)

getField

public gr.uoa.di.madgik.grs.record.field.StringField getField(String name)
                                                       throws gr.uoa.di.madgik.grs.record.GRS2RecordDefinitionException,
                                                              gr.uoa.di.madgik.grs.buffer.GRS2BufferException

Overrides:
getField in class gr.uoa.di.madgik.grs.record.Record
Throws:
gr.uoa.di.madgik.grs.record.GRS2RecordDefinitionException
gr.uoa.di.madgik.grs.buffer.GRS2BufferException
See Also:
Record.getField(java.lang.String)

extendSend

public void extendSend(DataOutput out)
                throws gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException

Specified by:
extendSend in class gr.uoa.di.madgik.grs.record.Record
Throws:
gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException
See Also:
Record.extendSend(java.io.DataOutput)

extendReceive

public void extendReceive(DataInput in)
                   throws gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException

Specified by:
extendReceive in class gr.uoa.di.madgik.grs.record.Record
Throws:
gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException
See Also:
Record.extendReceive(java.io.DataInput)

extendSendToXML

public void extendSendToXML(Document doc,
                            Element element)
                     throws gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException
Throws:
gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException

extendReceiveFromXML

public void extendReceiveFromXML(Element element)
                          throws gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException
Throws:
gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException

extendDeflate

public void extendDeflate(DataOutput out)
                   throws gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException

Specified by:
extendDeflate in class gr.uoa.di.madgik.grs.record.Record
Throws:
gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException
See Also:
Record.extendDeflate(java.io.DataOutput)

extendInflate

public void extendInflate(DataInput in,
                          boolean reset)
                   throws gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException

Specified by:
extendInflate in class gr.uoa.di.madgik.grs.record.Record
Throws:
gr.uoa.di.madgik.grs.record.GRS2RecordSerializationException
See Also:
Record.extendInflate(java.io.DataInput, boolean)

extendMakeLocal

protected void extendMakeLocal()

Specified by:
extendMakeLocal in class gr.uoa.di.madgik.grs.record.Record
See Also:
Record.extendMakeLocal()

extendDispose

public void extendDispose()

Specified by:
extendDispose in class gr.uoa.di.madgik.grs.record.Record
See Also:
Record.extendDispose()


Copyright © 2014. All Rights Reserved.