SMILA 1.0 API documentation

org.eclipse.smila.objectstore.filesystem
Class SimpleObjectInfo

java.lang.Object
  extended by org.eclipse.smila.objectstore.filesystem.SimpleObjectInfo
All Implemented Interfaces:
StoreObject

public class SimpleObjectInfo
extends java.lang.Object
implements StoreObject

Represents basic information for an object in SimpleObjectStoreService.


Field Summary
 
Fields inherited from interface org.eclipse.smila.objectstore.StoreObject
KEY_ID, KEY_SIZE, KEY_TIMESTAMP
 
Constructor Summary
SimpleObjectInfo(java.io.File file, java.lang.String id)
          constructor.
 
Method Summary
 java.lang.String getId()
          
 long getSize()
          
 java.util.Date getTimestamp()
          
 AnyMap toAny()
          Create an AnyMap with the contents of this StoreObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleObjectInfo

public SimpleObjectInfo(java.io.File file,
                        java.lang.String id)
constructor.

Method Detail

getId

public java.lang.String getId()

Specified by:
getId in interface StoreObject
Returns:
ID of object.

getSize

public long getSize()

Specified by:
getSize in interface StoreObject
Returns:
size of object in bytes.

getTimestamp

public java.util.Date getTimestamp()

Specified by:
getTimestamp in interface StoreObject
Returns:
timestamp of last modification of object.

toAny

public AnyMap toAny()
Create an AnyMap with the contents of this StoreObject. In JSON, it should look like this:
 {
   "id" : "name-of-object",
   "size" : 42,
   "timestamp" : "2011-06-20T09:22:42.123+0100"
 }
 
Service implementations that extend the ObjectInfo should still use this structure as a base and add specific information as they like.

Specified by:
toAny in interface StoreObject
Returns:

SMILA 1.0 API documentation