org.openanzo.model.transaction
Interface ITransactionCommand

All Known Implementing Classes:
RDBPersistedCommand, TransactionCommand

public interface ITransactionCommand

ICommand encapsulates an encapsulated unit of work within a transaction. Commands can have an optional name as well as a set of preconditions which must be met when the command is executed on the server.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Method Summary
 void addStatementAddition(org.openrdf.model.Statement... statements)
          Add statements to additions for the current command
 void addStatementRemoval(org.openrdf.model.Statement... statements)
          Add statements to deleted for the current command
 void delete()
          Delete the command from its store.
 void filter(java.util.Collection<org.openrdf.model.Statement> results, org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource... contexts)
          Use contents of this command to filter the statements contained within the results collection
 java.util.Collection<org.openrdf.model.URI> getAdditionContexts()
          Get the set of contexts affected by additions within this command
 java.util.Collection<org.openrdf.model.Statement> getAdditions()
          Get the set of additions within this command
 java.lang.String getCommandType()
          Get the type name for the command.
 java.util.Collection<org.openrdf.model.URI> getDeletionContexts()
          Get the set of contexts affected by deletions within this command
 java.util.Collection<org.openrdf.model.Statement> getDeletions()
          Get the set of deletions within this command
 ITransaction getParentTransaction()
          Get the parent transaction for this command.
 java.util.Set<IPrecondition> getPreconditions()
          Get the set of preconditions for this command.
 boolean isEmpty()
          Determine if this command has any additions or deletions
 void save()
          Save the command to its store.
 void setCommandType(java.lang.String commandType)
          Set the type name for this command.
 void setParentTransaction(ITransaction parentTransaction)
          Set the parent transaction for this command.
 void setPreconditions(java.util.Set<IPrecondition> preconditions)
          Set this commands preconditions to the given set.
 int sizeAdditions()
          Get the size of additions within this command
 int sizeAdditions(org.openrdf.model.Resource... context)
          Get the size of additions within this command for the given contexts
 int sizeDeletions()
          Get the size of deletions within this command
 int sizeDeletions(org.openrdf.model.Resource... context)
          Get the size of deletions for the given contexts
 

Method Detail

getCommandType

java.lang.String getCommandType()
Get the type name for the command.

Returns:
The command's type String.

setCommandType

void setCommandType(java.lang.String commandType)
Set the type name for this command.

Parameters:
commandType - Command's type String

getPreconditions

java.util.Set<IPrecondition> getPreconditions()
Get the set of preconditions for this command.

Returns:
the set of preconditions for this command.
See Also:
IPrecondition

setPreconditions

void setPreconditions(java.util.Set<IPrecondition> preconditions)
Set this commands preconditions to the given set.

Parameters:
preconditions - Set of preconditions that are evaluated on the server

addStatementAddition

void addStatementAddition(org.openrdf.model.Statement... statements)
Add statements to additions for the current command

Parameters:
statements - Added Statements to add to command

addStatementRemoval

void addStatementRemoval(org.openrdf.model.Statement... statements)
Add statements to deleted for the current command

Parameters:
statements - Deleted Statements to add to command

filter

void filter(java.util.Collection<org.openrdf.model.Statement> results,
            org.openrdf.model.Resource s,
            org.openrdf.model.URI p,
            org.openrdf.model.Value o,
            org.openrdf.model.Resource... contexts)
Use contents of this command to filter the statements contained within the results collection

Parameters:
results - The collection to overlay with the additions and deletions within this transaction.
s - The subject of the statement pattern being searched on.
p - The property of the statement pattern being searched on.
o - The object of the statement pattern being searched on.
contexts - The contexts of the statement pattern being searched on.

getParentTransaction

ITransaction getParentTransaction()
Get the parent transaction for this command.

Returns:
the parent transaction for this command.

setParentTransaction

void setParentTransaction(ITransaction parentTransaction)
Set the parent transaction for this command.

Parameters:
parentTransaction -

save

void save()
          throws AnzoException
Save the command to its store.

Throws:
AnzoException - if there is an error saving command

delete

void delete()
            throws AnzoException
Delete the command from its store.

Throws:
AnzoException - if there is an error deleting command

isEmpty

boolean isEmpty()
Determine if this command has any additions or deletions

Returns:
True if this command has any additions or deletions

sizeAdditions

int sizeAdditions(org.openrdf.model.Resource... context)
Get the size of additions within this command for the given contexts

Parameters:
context - Contexts to determine size
Returns:
the size of additions within this command for the given contexts

sizeDeletions

int sizeDeletions(org.openrdf.model.Resource... context)
Get the size of deletions for the given contexts

Parameters:
context - Contexts to determine size
Returns:
the size of deletions for the given contexts

sizeAdditions

int sizeAdditions()
Get the size of additions within this command

Returns:
the size of additions within this command

sizeDeletions

int sizeDeletions()
Get the size of deletions within this command

Returns:
the size of deletions within this command

getAdditions

java.util.Collection<org.openrdf.model.Statement> getAdditions()
Get the set of additions within this command

Returns:
the set of additions within this command

getDeletions

java.util.Collection<org.openrdf.model.Statement> getDeletions()
Get the set of deletions within this command

Returns:
the set of deletions within this command

getAdditionContexts

java.util.Collection<org.openrdf.model.URI> getAdditionContexts()
Get the set of contexts affected by additions within this command

Returns:
the set of contexts affected by additions within this command

getDeletionContexts

java.util.Collection<org.openrdf.model.URI> getDeletionContexts()
Get the set of contexts affected by deletions within this command

Returns:
the set of contexts affected by deletions within this command


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