gr.uoa.di.madgik.rr.element
Interface IRRElement

All Known Implementing Classes:
RRElement

public interface IRRElement


Method Summary
 void delete(boolean loadDetails)
           
 void delete(boolean loadDetails, RRContext.DatastoreType persistencyType)
           
 void delete(boolean deleteDetails, RRContext.WritePolicy policy)
           
 boolean exists()
          Checks if an RRElement exists using the default RRContext.ReadPolicy.
 boolean exists(RRContext.DatastoreType persistencyType)
           
 boolean exists(RRContext.ReadPolicy readPolicy)
           
 String getID()
          Returns the id of the item.
 RRContext getISContext()
          Returns the context associated with ResourceRegistry
 IDaoElement getItem()
          Returns the underlying DAO
 boolean isEqual(IRRElement f, boolean includeDetails)
           
 boolean load(boolean loadDetails)
          Loads an IRRElement using the default RRContext.ReadPolicy.
 boolean load(boolean loadDetails, RRContext.DatastoreType persistencyType)
          Loads an IRRElement from a specific RRContext.DatastoreType
 boolean load(boolean loadDetails, RRContext.ReadPolicy policy)
          Loads an IRRElement using a specific RRContext.ReadPolicy
 void setDirty()
          Marks the item dirty.
 void setID(String id)
          Sets the item id.
 void store(boolean storeDetails)
          Stores an IRRElement using the default RRContext.WritePolicy.
 void store(boolean storeDetails, RRContext.DatastoreType persistencyType)
           
 void store(boolean storeDetails, RRContext.WritePolicy policy)
           
 

Method Detail

getID

String getID()
Returns the id of the item.

Returns:
the id

setID

void setID(String id)
Sets the item id. Useful mainly for subsequent load operations.

Parameters:
id - The id to be set

setDirty

void setDirty()
Marks the item dirty. This will have the effect that store operations will take place regardless of equality.


exists

boolean exists()
               throws ResourceRegistryException
Checks if an RRElement exists using the default RRContext.ReadPolicy. The read policy used is selected as follows:

Returns:
Throws:
ResourceRegistryException

exists

boolean exists(RRContext.ReadPolicy readPolicy)
               throws ResourceRegistryException
Parameters:
readPolicy -
Returns:
Throws:
ResourceRegistryException

exists

boolean exists(RRContext.DatastoreType persistencyType)
               throws ResourceRegistryException
Parameters:
persistencyType -
Returns:
Throws:
ResourceRegistryException

load

boolean load(boolean loadDetails)
             throws ResourceRegistryException
Loads an IRRElement using the default RRContext.ReadPolicy. The read policy used is selected as follows: 1.The item is retrieved from the local datastore if RRContext.ReadPolicy.REFRESH_AHEAD is available. 2.If RRContext.ReadPolicy.READ_THROUGH is available, an attempt to load the item from the local datastore is made first by using RRContext.ReadPolicy.READ_LOCAL. If the latter fails, the item is retrieved from the remote datastore using RRContext.ReadPolicy.READ_THROUGH

Parameters:
loadDetails - true if the entire object graph should be loaded, false otherwise
Returns:
true if item was successfully loaded, false if load failed because item does not exist
Throws:
ResourceRegistryException - An error has occurred

load

boolean load(boolean loadDetails,
             RRContext.ReadPolicy policy)
             throws ResourceRegistryException
Loads an IRRElement using a specific RRContext.ReadPolicy

Parameters:
loadDetails - true if the entire object graph should be loaded, false otherwise
policy - the RRContext.ReadPolicy to be used
Returns:
true if item was successfully loaded, false if load failed because item does not exist
Throws:
ResourceRegistryException - An error has occurred

load

boolean load(boolean loadDetails,
             RRContext.DatastoreType persistencyType)
             throws ResourceRegistryException
Loads an IRRElement from a specific RRContext.DatastoreType

Parameters:
loadDetails - true if the entire object graph should be loaded, false otherwise
persistencyType - the RRContext.DatastoreType to be used
Returns:
true if item was successfully loaded, false if load failed because item does not exist
Throws:
ResourceRegistryException - An error has occurred

store

void store(boolean storeDetails)
           throws ResourceRegistryException
Stores an IRRElement using the default RRContext.WritePolicy. The write policy used is selected as follows: 1.If RRContext.WritePolicy.WRITE_BEHIND is available, the object is stored to the local datastore. 2.If RRContext.WritePolicy.WRITE_THROUGH is available, the object is stored directly to the remote datastore, through the local datastore. Note that this method does not provide the option to use the local datastore explicitly as a cache instead of the remote one. If such kind of optimization ism

Parameters:
storeDetails - true if the entire object graph should be stored, false otherwise
Throws:
ResourceRegistryException - if no RRContext.WritePolicy could be found

store

void store(boolean storeDetails,
           RRContext.WritePolicy policy)
           throws ResourceRegistryException
Parameters:
storeDetails -
policy -
Throws:
ResourceRegistryException

store

void store(boolean storeDetails,
           RRContext.DatastoreType persistencyType)
           throws ResourceRegistryException
Parameters:
storeDetails -
persistencyType -
Throws:
ResourceRegistryException

delete

void delete(boolean loadDetails)
            throws ResourceRegistryException
Parameters:
loadDetails -
Throws:
ResourceRegistryException

delete

void delete(boolean deleteDetails,
            RRContext.WritePolicy policy)
            throws ResourceRegistryException
Parameters:
deleteDetails -
policy -
Throws:
ResourceRegistryException

delete

void delete(boolean loadDetails,
            RRContext.DatastoreType persistencyType)
            throws ResourceRegistryException
Parameters:
loadDetails -
persistencyType -
Throws:
ResourceRegistryException

isEqual

boolean isEqual(IRRElement f,
                boolean includeDetails)
                throws ResourceRegistryException
Parameters:
f -
includeDetails -
Returns:
Throws:
ResourceRegistryException

getItem

IDaoElement getItem()
Returns the underlying DAO

Returns:
the underlying IDaoElement

getISContext

RRContext getISContext()
Returns the context associated with ResourceRegistry

Returns:
the context


Copyright © 2012. All Rights Reserved.