com.cloudtran.api.persist
Interface ICloudTranPersistable

All Superinterfaces:
Comparable, Externalizable, Serializable

public interface ICloudTranPersistable
extends Serializable, Comparable, Externalizable

If an object implements this interface, it will be persisted by CloudTran.


Nested Class Summary
static class ICloudTranPersistable.PersistenceStyle
           
 
Method Summary
 String dump()
          dumps all attribute values for an instance in a multi-line, indented format, suitable for a report.
 Integer getCloudTran_RoutingValue()
          This is the globally unique, for this app, Integer identifying the persistable object.
 String getCloudTran_SpaceName()
          This is the name of the space the object goes into.
 Object getDeleteProcessor()
          Returns the pu delete processor object.
 String getEntityName()
           
 Object getEntityProcessor()
          Returns the entity group processor object.
 Object getFullyQualifiedStorer()
          This returns per-data-object configuration information.
 String getObjectPersistorClassName()
          N.B.
 ICloudTranPersistable.PersistenceStyle getPersistenceStyle()
          Get the PersistenceStyle for this data object
 String getTenant()
           
 Object getThePrimaryKey()
          This provides a reference to the primary key of the implementer of ICloudPersistable.
 boolean isInMemoryAndPersistentStore()
          return true if this is an 'IN_MEMORY_AND_PERSISTENT_STORE' data object
 boolean isInMemoryOnly()
          return true if this is an 'IN_MEMORY_ONLY' data object
 boolean isInPersistentStoreOnly()
          return true if this is an 'IN_PERSISTENT_STORE_ONLY' data object
 void readExternal(DeserializationHelper deserializationHelper)
           
 void writeExternal(SerializationHelper serializationHelper)
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getCloudTran_RoutingValue

Integer getCloudTran_RoutingValue()
This is the globally unique, for this app, Integer identifying the persistable object.


getThePrimaryKey

Object getThePrimaryKey()
This provides a reference to the primary key of the implementer of ICloudPersistable.


getObjectPersistorClassName

String getObjectPersistorClassName()
N.B. This is currently ignored - it should return the standard "com.cloudtran.api.persist.JDBCPersistor". This returns the class name for the object persister class, such as "com.cloudtran.api.persist.JDBCPersistor" Why have a separate class rather than putting this into the generated XData object? (a) So we don't have to pollute the space/grid with persister classes using Strings here means that we don't have to ... (b) Separation of concerns. This can write to a database; or it could write to a queue (could do this rather than having it done by an event handler on the space).


getFullyQualifiedStorer

Object getFullyQualifiedStorer()
This returns per-data-object configuration information. In the case of a DBMS-type persister, this is the datasource name, like "jdbcplugintest1".


getCloudTran_SpaceName

String getCloudTran_SpaceName()
This is the name of the space the object goes into.


getDeleteProcessor

Object getDeleteProcessor()
Returns the pu delete processor object. This actually returns an IDeleteProcessor object. However, because the IDeleteProcessor depends on Cohort code and we want to be able to run the TxB layer without the Cohort layer being present, the return value is typed as "Object". The design is that this is a singleton object, so the same value is returned for any given table. As this is a callback method, that works as long as there is no state.


getEntityProcessor

Object getEntityProcessor()
Returns the entity group processor object. This actually returns an IEntityGroupProcessor object. However, because the IEntityGroupProcessor depends on Cohort code and we want to be able to run the TxB layer without the Cohort layer being present, the return value is typed as "Object". The design is that this is a singleton object, so the same value is returned for any given table. As this is a callback method, that works as long as there is no state. Currently an EntityGroupProcessor just does the delete, but the entity group processor is the place for any other group-wide actions.


dump

String dump()
dumps all attribute values for an instance in a multi-line, indented format, suitable for a report.


getPersistenceStyle

ICloudTranPersistable.PersistenceStyle getPersistenceStyle()
Get the PersistenceStyle for this data object


isInPersistentStoreOnly

boolean isInPersistentStoreOnly()
return true if this is an 'IN_PERSISTENT_STORE_ONLY' data object


isInMemoryOnly

boolean isInMemoryOnly()
return true if this is an 'IN_MEMORY_ONLY' data object


isInMemoryAndPersistentStore

boolean isInMemoryAndPersistentStore()
return true if this is an 'IN_MEMORY_AND_PERSISTENT_STORE' data object


writeExternal

void writeExternal(SerializationHelper serializationHelper)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

void readExternal(DeserializationHelper deserializationHelper)
                  throws IOException
Specified by:
readExternal in interface Externalizable
Throws:
IOException

getTenant

String getTenant()
Returns:
For SaaS applications, this returns the companyId (i.e. the 'tenant' ID). For non-SaaS applications, it returns the application name.

getEntityName

String getEntityName()