gr.uoa.di.madgik.rr.element
Class RRElement

java.lang.Object
  extended by gr.uoa.di.madgik.rr.element.RRElement
All Implemented Interfaces:
IRRElement

public abstract class RRElement
extends Object
implements IRRElement


Constructor Summary
RRElement()
           
 
Method Summary
 void delete(boolean deleteDetails)
          
 void delete(boolean deleteDetails, RRContext.WritePolicy policy)
           
 boolean exists()
          Checks if an RRElement exists using the default RRContext.ReadPolicy.
 boolean exists(RRContext.ReadPolicy policy)
          
 boolean load(boolean loadDetails)
          Loads an IRRElement using the default RRContext.ReadPolicy.
 boolean load(boolean loadDetails, RRContext.ReadPolicy policy)
          Loads an IRRElement using a specific RRContext.ReadPolicy
 void store(boolean storeDetails)
          Stores an IRRElement using the default RRContext.WritePolicy.
 void store(boolean storeDetails, RRContext.WritePolicy policy)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gr.uoa.di.madgik.rr.element.IRRElement
delete, exists, getID, getISContext, getItem, isEqual, load, setDirty, setID, store
 

Constructor Detail

RRElement

public RRElement()
Method Detail

exists

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

Specified by:
exists in interface IRRElement
Returns:
Throws:
ResourceRegistryException

exists

public boolean exists(RRContext.ReadPolicy policy)
               throws ResourceRegistryException

Specified by:
exists in interface IRRElement
Returns:
Throws:
ResourceRegistryException

load

public 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

Specified by:
load in interface IRRElement
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

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

Specified by:
load in interface IRRElement
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

store

public 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

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

store

public void store(boolean storeDetails,
                  RRContext.WritePolicy policy)
           throws ResourceRegistryException

Specified by:
store in interface IRRElement
Throws:
ResourceRegistryException

delete

public void delete(boolean deleteDetails)
            throws ResourceRegistryException

Specified by:
delete in interface IRRElement
Throws:
ResourceRegistryException

delete

public void delete(boolean deleteDetails,
                   RRContext.WritePolicy policy)
            throws ResourceRegistryException
Specified by:
delete in interface IRRElement
Throws:
ResourceRegistryException


Copyright © 2012. All Rights Reserved.