au.com.prunge.jgenfile.impl
Class ConstantCanSetMetadataOperation

java.lang.Object
  |
  +--au.com.prunge.jgenfile.impl.AbstractOperation
        |
        +--au.com.prunge.jgenfile.impl.AbstractItemOperation
              |
              +--au.com.prunge.jgenfile.impl.ConstantCanSetMetadataOperation
All Implemented Interfaces:
CanSetMetadataOperation, ConstantOperation, ItemOperation, Operation

public class ConstantCanSetMetadataOperation
extends AbstractItemOperation
implements CanSetMetadataOperation, ConstantOperation

A can set metadata operation that always returns the same set of keys.

Version:
1.0
Author:
Peter Runge

Constructor Summary
ConstantCanSetMetadataOperation(au.com.prunge.jgenfile.Item item, Set metadataKeySet, Set modifiableKeySet)
          Constructs a ConstantCanSetMetadataOperation.
 
Method Summary
 Set getMetadataKeySet()
          Returns the set of metadata keys this operation is checking for modification for the item.
 Set getModifiableMetadataSet()
          Returns the set of metadata keys that can be set for this item.
 Set getNonModifiableMetadataSet()
          Returns the set of metadata keys that cannot be set for this item.
 void runImpl()
          The actual run() implementation goes in this method.
 
Methods inherited from class au.com.prunge.jgenfile.impl.AbstractItemOperation
getItem
 
Methods inherited from class au.com.prunge.jgenfile.impl.AbstractOperation
abort, addOperationHints, checkRun, getLastRunException, getOperationHint, getOperationHints, hasRun, run, setLastRunException, setOperationHint, setOperationHints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface au.com.prunge.jgenfile.ItemOperation
getItem
 
Methods inherited from interface au.com.prunge.jgenfile.Operation
abort, addOperationHints, getLastRunException, getOperationHint, getOperationHints, hasRun, run, setOperationHint, setOperationHints
 

Constructor Detail

ConstantCanSetMetadataOperation

public ConstantCanSetMetadataOperation(au.com.prunge.jgenfile.Item item,
                                       Set metadataKeySet,
                                       Set modifiableKeySet)
                                throws NullPointerException
Constructs a ConstantCanSetMetadataOperation.

Parameters:
item - the item this operation is for.
metadataKeySet - the set of metadata keys to use to check for metadata modification.
modifiableKeySet - a complete set of keys for metadata that can be modified.
Throws:
NullPointerException - if any parameter is null.
Method Detail

getMetadataKeySet

public Set getMetadataKeySet()
Description copied from interface: CanSetMetadataOperation
Returns the set of metadata keys this operation is checking for modification for the item.

Specified by:
getMetadataKeySet in interface CanSetMetadataOperation
Returns:
a set of MetadataKey objects.
See Also:
CanSetMetadataOperation.getMetadataKeySet()

getModifiableMetadataSet

public Set getModifiableMetadataSet()
                             throws OperationNotFinishedException,
                                    JGenFileException
Description copied from interface: CanSetMetadataOperation
Returns the set of metadata keys that can be set for this item.

Specified by:
getModifiableMetadataSet in interface CanSetMetadataOperation
Returns:
a set of MetadataKey objects.
Throws:
OperationNotFinishedException - if this method was called and the run() method has not finished or has not been called.
JGenFileException - if another error occurs.
See Also:
CanSetMetadataOperation.getModifiableMetadataSet()

getNonModifiableMetadataSet

public Set getNonModifiableMetadataSet()
                                throws OperationNotFinishedException,
                                       JGenFileException
Description copied from interface: CanSetMetadataOperation
Returns the set of metadata keys that cannot be set for this item.

Specified by:
getNonModifiableMetadataSet in interface CanSetMetadataOperation
Returns:
a set of MetadataKey objects.
Throws:
OperationNotFinishedException - if this method was called and the run() method has not finished or has not been called.
JGenFileException - if another error occurs.
See Also:
CanSetMetadataOperation.getNonModifiableMetadataSet()

runImpl

public void runImpl()
             throws JGenFileException
Description copied from class: AbstractOperation
The actual run() implementation goes in this method. Setting the last run exception and setting hasRun to true is not required by this method as it is handled by the run() method in this class.

If this method completes successfully (i.e. without throwing an exception), the last run exception is set to null indicating no exception occurred and subsequent calls to hasRun() will return true.

If this method throws an exception, the last run exception is filled in and hasRun() subsequent calls to hasRun() will return false.

Specified by:
runImpl in class AbstractOperation
Throws:
JGenFileException - if an error occurs.
See Also:
au.com.prunge.jgenfile.AbstractOperation#runImpl()