org.eaglei.repository.model
Class WritableObjectModel

java.lang.Object
  extended by org.eaglei.repository.model.ImmutableObjectModel
      extended by org.eaglei.repository.model.WritableObjectModel
Direct Known Subclasses:
NamedGraph, Role, User, WorkflowTransition

public abstract class WritableObjectModel
extends ImmutableObjectModel

Outline of all *writable* "Object Model" classes, in which instances can be added and changed. Object Models are Java objects that represent an instance or layer -- i.e. a body of properties on an instance -- in the RDF database. They exist to cache the information and make it easier to manipulate in Java. This class describes a common interface to be implemented by all object models.

Author:
Larry Stone Started March 2011
See Also:
ImmutableObjectModel

Field Summary
protected  boolean dirty
          flag saying the Java instance has been modified and needs to be uploaded to RDF database
 
Constructor Summary
WritableObjectModel()
           
 
Method Summary
 void commit(javax.servlet.http.HttpServletRequest request)
          commit - commit any changes made to this object (and any others).
 void decacheInstance()
          Invalidate local cache after changes.
protected  void setDirty(boolean truth)
          Change the "dirty" flag to reflect when local change was made.
 void update(javax.servlet.http.HttpServletRequest request)
          Copy local changes to the RDF database.
 
Methods inherited from class org.eaglei.repository.model.ImmutableObjectModel
find, findAll, getLabel, getURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dirty

protected boolean dirty
flag saying the Java instance has been modified and needs to be uploaded to RDF database

Constructor Detail

WritableObjectModel

public WritableObjectModel()
Method Detail

update

public void update(javax.servlet.http.HttpServletRequest request)
            throws javax.servlet.ServletException
Copy local changes to the RDF database. Default implementation has nothing to do for cases where RDF is updated synchronously

Parameters:
request - the HTTP request object from the servlet
Throws:
javax.servlet.ServletException

decacheInstance

public void decacheInstance()
Invalidate local cache after changes. Default implementation has nothing to do for cases where RDF is updated synchronously


setDirty

protected void setDirty(boolean truth)
Change the "dirty" flag to reflect when local change was made.

Parameters:
truth - boolean value where true means there ARE local cahnges

commit

public void commit(javax.servlet.http.HttpServletRequest request)
            throws javax.servlet.ServletException

commit - commit any changes made to this object (and any others).

Note that this includes any other modifications made to RDF database.

Parameters:
request - a HttpServletRequest object.
Throws:
javax.servlet.ServletException - if any.


Copyright © 2009-2011 Eagle-I. All Rights Reserved.