com.sun.emp.cci.eci
Class GenericRecord

java.lang.Object
  |
  +--com.sun.emp.cci.eci.GenericRecord
All Implemented Interfaces:
Cloneable, Record, Serializable, Streamable

public class GenericRecord
extends Object
implements Record, Streamable

A generic record that can be used as input to an ECI interaction and is returned as an output of an interaction.

This record inplements the Streamable interface to allow its use by the ECI interaction. Access to the data in the record is provided via the getBytes() and toString() methods.

See Also:
ECIInteraction

Constructor Summary
GenericRecord()
          Constructor.
GenericRecord(byte[] ba)
          Constructor providing initial data.
 
Method Summary
 Object clone()
           
 boolean equals(Object o)
           
 byte[] getBytes()
          Get the bytes of this record.
 String getRecordName()
           
 String getRecordShortDescription()
           
 void read(InputStream is)
           
 void setRecordName(String n)
           
 void setRecordShortDescription(String n)
           
 String toString()
           
 void write(OutputStream os)
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.resource.cci.Record
hashCode
 

Constructor Detail

GenericRecord

public GenericRecord()
Constructor.


GenericRecord

public GenericRecord(byte[] ba)
Constructor providing initial data.

Parameters:
ba - The initial data in the form of a byte array. It is valid to call this constructor with null.
Method Detail

getRecordName

public String getRecordName()
Specified by:
getRecordName in interface Record

setRecordName

public void setRecordName(String n)
Specified by:
setRecordName in interface Record

getRecordShortDescription

public String getRecordShortDescription()
Specified by:
getRecordShortDescription in interface Record

setRecordShortDescription

public void setRecordShortDescription(String n)
Specified by:
setRecordShortDescription in interface Record

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface Record
Overrides:
clone in class Object
CloneNotSupportedException

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Specified by:
equals in interface Record
Overrides:
equals in class Object

getBytes

public byte[] getBytes()
Get the bytes of this record.

This returns the actual bytes, not a copy of them. Thus changes to the returned array will result in the record actually changing.

Returns:
The bytes. This may be null.

read

public void read(InputStream is)
          throws IOException
Specified by:
read in interface Streamable
IOException

write

public void write(OutputStream os)
           throws IOException
Specified by:
write in interface Streamable
IOException