public class CachedData
- Object
- CachedData
ImplementsExternalizable
Cached data class for use with the cached data service
Constructors
public CachedData() |
Methods
public int getVersion() | Returns the version for the current persistance code, the version will be pased to internalized thus allowing the internalize method to recognize classes persisted in older revisions |
public void externalize(DataOutputStream out)
throws IOException | Allows us to store an object state, this method must be implemented in order to save the state of an object |
public void internalize(int version, DataInputStream in)
throws IOException | Loads the object from the input stream and allows deserialization |
public String getObjectId() | The object id must be unique, it is used to identify the object when loaded even when it is obfuscated. |
public byte[] getData() | |
public void setData(byte[] data) | |
public String getUrl() | |
public void setUrl(String url) |
Inherited methods
Constructor details
CachedData
public CachedData()Method details
getVersion
public int getVersion()Returns the version for the current persistance code, the version will be
pased to internalized thus allowing the internalize method to recognize
classes persisted in older revisions
Returns
version number for the persistant code
externalize
public void externalize(DataOutputStream out)
throws IOExceptionAllows us to store an object state, this method must be implemented
in order to save the state of an object
Parameters
outDataOutputStream- the stream into which the object must be serialized
Throws
java.io.IOException- the method may throw an exception
internalize
public void internalize(int version, DataInputStream in)
throws IOExceptionLoads the object from the input stream and allows deserialization
Parameters
versionint- the version the class returned during the externalization processs
inDataInputStream- the input stream used to load the class
Throws
java.io.IOException- the method may throw an exception
getObjectId
public String getObjectId()The object id must be unique, it is used to identify the object when loaded
even when it is obfuscated.
Returns
a unique id
getData
public byte[] getData()Returns
the data
setData
public void setData(byte[] data)Parameters
databyte[]- the data to set
getUrl
public String getUrl()Returns
the url
setUrl
public void setUrl(String url)Parameters
urlString- the url to set