org.persvr.datasource
Interface NewObjectPersister

All Known Implementing Classes:
StartAsEmptyPersister

public interface NewObjectPersister

This provides the interface for a new object to persist its data to a data source

Author:
Kris Zyp

Method Summary
 void finished()
          This is called after all the initialization and recordProperty calls are finished
 java.lang.String getObjectId()
          This is called to determine the object id of the new object.
 ObjectId getParent()
          This is called to find out from the data source what parent should be used for this object now that it is persisted
 DataSource getSource()
          This is called to determine the data source of the new object.
 void initializeAsList(java.util.List<? extends java.lang.Object> values)
          If this is called it indicates that the object is an array/list.
 void recordProperty(java.lang.String name, java.lang.Object value)
          This is called for each of the properties of the new object that need to be persisted.
 boolean reloadFromSource()
          Indicates whether the object should be reloaded from the source after being persisted
 void start()
          This is called at the beginning of the persisting process
 

Method Detail

start

void start()
           throws java.lang.Exception
This is called at the beginning of the persisting process

Throws:
java.lang.Exception

initializeAsList

void initializeAsList(java.util.List<? extends java.lang.Object> values)
                      throws java.lang.Exception
If this is called it indicates that the object is an array/list.

Parameters:
The - values of the list
Throws:
java.lang.Exception

recordProperty

void recordProperty(java.lang.String name,
                    java.lang.Object value)
                    throws java.lang.Exception
This is called for each of the properties of the new object that need to be persisted.

Parameters:
name -
value - - This value can be
Throws:
java.lang.Exception

getParent

ObjectId getParent()
This is called to find out from the data source what parent should be used for this object now that it is persisted

Returns:
a java.security.Acl object directly or a org.persvr.data.ObjectId to indicate which object security should be inherited from

finished

void finished()
              throws java.lang.Exception
This is called after all the initialization and recordProperty calls are finished

Throws:
java.lang.Exception

reloadFromSource

boolean reloadFromSource()
Indicates whether the object should be reloaded from the source after being persisted

Returns:

getSource

DataSource getSource()
This is called to determine the data source of the new object. By default this is called at the end of the persistence (after the initialize and record methods are called)

Returns:

getObjectId

java.lang.String getObjectId()
This is called to determine the object id of the new object. By default this is called at the end of the persistence (after the initialize and record methods are called)

Returns: