org.openanzo.serialization.handlers
Class HandlerAdapter

java.lang.Object
  extended by org.openanzo.serialization.handlers.HandlerAdapter
All Implemented Interfaces:
IRepositoryHandler
Direct Known Subclasses:
ClientHandler, ClientUpdatesHandler, IndexUpdateHandler.IndexerUpdateHandler, NotificationListenerAdapter, RevisionHandler, ServerUpdatesProcessor

public class HandlerAdapter
extends java.lang.Object
implements IRepositoryHandler

Adapter for IRepositoryHandler

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
HandlerAdapter()
           
 
Method Summary
 boolean handleAci(boolean addition, org.openrdf.model.URI namedGraphUri, org.openrdf.model.URI aclUri, org.openrdf.model.URI role, java.lang.Boolean canRead, java.lang.Boolean canUpdate, java.lang.Boolean canDelete, java.lang.Boolean canInsert, java.lang.Boolean canRemove, java.lang.Boolean canChangeAcl)
          Handle ACI message
 boolean handleAcl(boolean addition, org.openrdf.model.URI aclUri, boolean isTemplate)
          Handle ACL message
 boolean handleCommandEnd()
          Handle end of command message
 boolean handleCommandStart(java.lang.Long commandId, java.lang.String commandType, java.lang.String commadPreReq)
          Handle start of command message
 boolean handleEndDocument()
          Handle end of document message
 boolean handleError(int errorNumber, int erroSubNumber, java.lang.String... errorMessageArgs)
          Handle an error message
 boolean handleNamedGraph(boolean addition, org.openrdf.model.URI namedGraphUri, org.openrdf.model.URI metadataGraphUri, java.lang.Long revision, org.openrdf.model.URI aclUriTemplate, org.openrdf.model.URI createdBy, java.lang.Long modified, org.openrdf.model.URI lastModifiedBy)
          Handle NamedGraph message
 boolean handleNode(java.lang.Long id, org.openrdf.model.Value value)
          Handle Node message
 boolean handleReset()
          Handle reset message
 boolean handleRole(boolean addition, org.openrdf.model.URI role)
          Handle role message
 boolean handleStartDocument()
          Handle start of document message
 boolean handleStatement(boolean addition, org.openrdf.model.URI namedGraphUriId, org.openrdf.model.Resource subj, org.openrdf.model.URI prop, org.openrdf.model.Value obj)
          Handle statement message
 boolean handleSubRoleOf(boolean addition, org.openrdf.model.URI role, org.openrdf.model.URI parentRole)
          Handle Role subrole of another role message
 boolean handleTransactionEnd()
          Handle end of transaction message
 boolean handleTransactionStart(java.lang.Long transactionId, java.lang.Long timestamp)
          Handle start of transaction message
 boolean handleUser(boolean addition, org.openrdf.model.URI user, org.openrdf.model.URI defaultRole, org.openrdf.model.URI defaultAclTemplate, java.lang.String userId, java.lang.String password)
          Handle user message
 boolean handleUserInRole(boolean addition, org.openrdf.model.URI user, org.openrdf.model.URI role)
          Handle User in Role message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerAdapter

public HandlerAdapter()
Method Detail

handleReset

public boolean handleReset()
                    throws AnzoException
Description copied from interface: IRepositoryHandler
Handle reset message

Specified by:
handleReset in interface IRepositoryHandler
Returns:
Message handled successfully
Throws:
AnzoException

handleAci

public boolean handleAci(boolean addition,
                         org.openrdf.model.URI namedGraphUri,
                         org.openrdf.model.URI aclUri,
                         org.openrdf.model.URI role,
                         java.lang.Boolean canRead,
                         java.lang.Boolean canUpdate,
                         java.lang.Boolean canDelete,
                         java.lang.Boolean canInsert,
                         java.lang.Boolean canRemove,
                         java.lang.Boolean canChangeAcl)
                  throws AnzoException
Description copied from interface: IRepositoryHandler
Handle ACI message

Specified by:
handleAci in interface IRepositoryHandler
Parameters:
addition - Is this message an addition or deletion
namedGraphUri - URI of NamedGraph that this ACI belongs
aclUri - URI of ACL
role - Role that this ACI affects
canRead - Can this role read the graph
canUpdate - Can this role add to the graph
canDelete - Can this role remove from the graph
canInsert - Can this role insert a new NamedGraph
canRemove - Can this role remove a NamedGraph
canChangeAcl - Can this role change the ACL properties
Returns:
Message handled successfully
Throws:
AnzoException

handleAcl

public boolean handleAcl(boolean addition,
                         org.openrdf.model.URI aclUri,
                         boolean isTemplate)
                  throws AnzoException
Description copied from interface: IRepositoryHandler
Handle ACL message

Specified by:
handleAcl in interface IRepositoryHandler
Parameters:
addition - Is this message an addition or deletion
aclUri - URI of ACL
isTemplate - Is this acl a template
Returns:
Message handled successfully
Throws:
AnzoException

handleCommandStart

public boolean handleCommandStart(java.lang.Long commandId,
                                  java.lang.String commandType,
                                  java.lang.String commadPreReq)
                           throws AnzoException
Description copied from interface: IRepositoryHandler
Handle start of command message

Specified by:
handleCommandStart in interface IRepositoryHandler
Parameters:
commandId - Id of command
commandType - Type of command
commadPreReq - Serialized graph representation of precondition for command
Returns:
Message handled successfully
Throws:
AnzoException

handleCommandEnd

public boolean handleCommandEnd()
                         throws AnzoException
Description copied from interface: IRepositoryHandler
Handle end of command message

Specified by:
handleCommandEnd in interface IRepositoryHandler
Returns:
Message handled successfully
Throws:
AnzoException

handleEndDocument

public boolean handleEndDocument()
                          throws AnzoException
Description copied from interface: IRepositoryHandler
Handle end of document message

Specified by:
handleEndDocument in interface IRepositoryHandler
Returns:
Message handled successfully
Throws:
AnzoException

handleError

public boolean handleError(int errorNumber,
                           int erroSubNumber,
                           java.lang.String... errorMessageArgs)
                    throws AnzoException
Description copied from interface: IRepositoryHandler
Handle an error message

Specified by:
handleError in interface IRepositoryHandler
Parameters:
errorNumber - Major error code
erroSubNumber - Minor error code
errorMessageArgs - Arguments to error message
Returns:
Message handled successfully
Throws:
AnzoException

handleNamedGraph

public boolean handleNamedGraph(boolean addition,
                                org.openrdf.model.URI namedGraphUri,
                                org.openrdf.model.URI metadataGraphUri,
                                java.lang.Long revision,
                                org.openrdf.model.URI aclUriTemplate,
                                org.openrdf.model.URI createdBy,
                                java.lang.Long modified,
                                org.openrdf.model.URI lastModifiedBy)
                         throws AnzoException
Description copied from interface: IRepositoryHandler
Handle NamedGraph message

Specified by:
handleNamedGraph in interface IRepositoryHandler
Parameters:
addition - Is this message an addition or deletion
namedGraphUri - URI of NamedGraph
metadataGraphUri - URI of NamedGraph's metadata graph
revision - Revision value of NamedGraph
aclUriTemplate - URI of ACL that this NamedGraph uses
createdBy - User that created the NamedGraph
modified - When graph was last modified
lastModifiedBy - Who last modified graph
Returns:
Message handled successfully
Throws:
AnzoException

handleNode

public boolean handleNode(java.lang.Long id,
                          org.openrdf.model.Value value)
                   throws AnzoException
Description copied from interface: IRepositoryHandler
Handle Node message

Specified by:
handleNode in interface IRepositoryHandler
Parameters:
id - ID of node
value - Value of node
Returns:
Message handled successfully
Throws:
AnzoException

handleRole

public boolean handleRole(boolean addition,
                          org.openrdf.model.URI role)
                   throws AnzoException
Description copied from interface: IRepositoryHandler
Handle role message

Specified by:
handleRole in interface IRepositoryHandler
Parameters:
addition - Is this message an addition or deletion
role - Role added or deleted
Returns:
Message handled successfully
Throws:
AnzoException

handleStartDocument

public boolean handleStartDocument()
                            throws AnzoException
Description copied from interface: IRepositoryHandler
Handle start of document message

Specified by:
handleStartDocument in interface IRepositoryHandler
Returns:
Message handled successfully
Throws:
AnzoException

handleStatement

public boolean handleStatement(boolean addition,
                               org.openrdf.model.URI namedGraphUriId,
                               org.openrdf.model.Resource subj,
                               org.openrdf.model.URI prop,
                               org.openrdf.model.Value obj)
                        throws AnzoException
Description copied from interface: IRepositoryHandler
Handle statement message

Specified by:
handleStatement in interface IRepositoryHandler
Parameters:
addition - Is this a statement addition or deletion
namedGraphUriId - URI of NamedGraph that statement belongs to
subj - Subject value
prop - Predicate value
obj - Object value
Returns:
Message handled successfully
Throws:
AnzoException

handleSubRoleOf

public boolean handleSubRoleOf(boolean addition,
                               org.openrdf.model.URI role,
                               org.openrdf.model.URI parentRole)
                        throws AnzoException
Description copied from interface: IRepositoryHandler
Handle Role subrole of another role message

Specified by:
handleSubRoleOf in interface IRepositoryHandler
Parameters:
addition - Is this message an addition or deletion
role - Role value
parentRole - Parent role to which role is a subrole
Returns:
Message handled successfully
Throws:
AnzoException

handleTransactionStart

public boolean handleTransactionStart(java.lang.Long transactionId,
                                      java.lang.Long timestamp)
                               throws AnzoException
Description copied from interface: IRepositoryHandler
Handle start of transaction message

Specified by:
handleTransactionStart in interface IRepositoryHandler
Parameters:
transactionId - Id of transaction
timestamp - timestamp when transaction was committed
Returns:
Message handled successfully
Throws:
AnzoException

handleTransactionEnd

public boolean handleTransactionEnd()
                             throws AnzoException
Description copied from interface: IRepositoryHandler
Handle end of transaction message

Specified by:
handleTransactionEnd in interface IRepositoryHandler
Returns:
Message handled successfully
Throws:
AnzoException

handleUser

public boolean handleUser(boolean addition,
                          org.openrdf.model.URI user,
                          org.openrdf.model.URI defaultRole,
                          org.openrdf.model.URI defaultAclTemplate,
                          java.lang.String userId,
                          java.lang.String password)
                   throws AnzoException
Description copied from interface: IRepositoryHandler
Handle user message

Specified by:
handleUser in interface IRepositoryHandler
Parameters:
addition - Is this message an addition or deletion
user - User value
defaultRole - Default role for this user
defaultAclTemplate - URI for the default ACL template for this user
userId - UserId for this user
password - Password for this user
Returns:
Message handled successfully
Throws:
AnzoException

handleUserInRole

public boolean handleUserInRole(boolean addition,
                                org.openrdf.model.URI user,
                                org.openrdf.model.URI role)
                         throws AnzoException
Description copied from interface: IRepositoryHandler
Handle User in Role message

Specified by:
handleUserInRole in interface IRepositoryHandler
Parameters:
addition - Is this message an addition or deletion
user - User value
role - Role user is being added to or deleted from
Returns:
Message handled successfully
Throws:
AnzoException


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.