org.electrocodeogram.cpc.core.api.data.special
Interface IStoreCloneObject

All Superinterfaces:
java.lang.Cloneable, org.eclipse.core.runtime.IAdaptable, ICloneDataElement, ICloneObject, IStatefulObject, java.io.Serializable
All Known Subinterfaces:
ICloneFileInterfaces, ICloneGroupInterfaces, ICloneInterfaces, ICloneObjectInterfaces

public interface IStoreCloneObject
extends ICloneObject, IStatefulObject

Extension interface for ICloneObject which contains additional internal methods for use only by an IStoreProvider.

All ICloneObject implementations have to implement this interface.

Rationale:

These methods should not be accessed by other plugins besides the IStoreProvider. They are therefore "hidden" by this extra interface. The fact that an ICloneObject object will need to be cast to this interface before any of the methods can be accessed is meant to work as a deterrent for accidental access to these methods.
The ICloneObjectExtension mechanism is not used by most CPC plugins for performance reasons.

Author:
vw
See Also:
IStoreProvider, ICloneObject

Field Summary
 
Fields inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneObject
PERSISTENCE_OBJECT_IDENTIFIER
 
Method Summary
 java.util.List<ICloneObjectExtension> getDeletedExtensions()
          Retrieves a list of deleted ICloneObjectExtensions for this clone object.
 boolean isDirty()
          Whether this clone was modified and will need to be written to persistent storage.
 boolean isPersisted()
          Whether this clone was already stored in persistent storage at some point.
 void purgeDeletedExtensions()
          Purges all currently deleted extensions from the ICloneObject.
 void setDirty(boolean dirty)
          Sets this clone objects dirty flag.
 void setPersisted(boolean persisted)
          Sets this clone objects persisted flag.
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneObject
addExtension, clone, equals, equalsAll, getExtension, getExtensions, getUuid, hasExtensions, hashCode, isMarked, removeExtension, removeExtension, setMarked, toString
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.ICloneDataElement
isSealed, seal
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.electrocodeogram.cpc.core.api.data.special.IStatefulObject
getPersistenceClassIdentifier, getPersistenceObjectIdentifier, getState, getStateTypes, setState
 

Method Detail

isDirty

boolean isDirty()
Whether this clone was modified and will need to be written to persistent storage.

Returns:
true if this instance was modified

setDirty

void setDirty(boolean dirty)
Sets this clone objects dirty flag.

See Also:
isDirty()

isPersisted

boolean isPersisted()
Whether this clone was already stored in persistent storage at some point.
This does not mean that it can't be dirty dirty.
This is interesting for storage provider implementations which require different actions for addition and update of data (i.e. SQL INSERT and UPDATE).

Returns:
true if this instance was persisted in the past

setPersisted

void setPersisted(boolean persisted)
Sets this clone objects persisted flag.

See Also:
isPersisted()

getDeletedExtensions

java.util.List<ICloneObjectExtension> getDeletedExtensions()
Retrieves a list of deleted ICloneObjectExtensions for this clone object.

Returns:
list of deleted ICloneObjectExtensions, never null.
See Also:
purgeDeletedExtensions(), ICloneObject.removeExtension(Class), ICloneObject.removeExtension(ICloneObjectExtension)

purgeDeletedExtensions

void purgeDeletedExtensions()
Purges all currently deleted extensions from the ICloneObject.
After this method was called, the return value of getDeletedExtensions() will be an empty list.

A store provider will typically call this method each time an ICloneObject was persisted successfully (and there is thus no need to retain any information about deleted extensions any longer).

See Also:
getDeletedExtensions()