org.apache.slide.macro
Class MacroImpl

java.lang.Object
  extended byorg.apache.slide.macro.MacroImpl
All Implemented Interfaces:
Macro

public class MacroImpl
extends java.lang.Object
implements Macro

Macro helper class.

Version:
$Revision: 1.54 $

Field Summary
 
Fields inherited from interface org.apache.slide.macro.Macro
ALREADY_COPIED, DEFAULT_PARAMETERS, PARENT_BINDINGS, RECURSIVE_OVERWRITE_PARAMETERS
 
Constructor Summary
MacroImpl(Namespace namespace, NamespaceConfig namespaceConfig, Security securityHelper, Content contentHelper, Structure structureHelper, Lock lockHelper)
          Constructor.
 
Method Summary
 void copy(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri)
          Recursive copy with overwrite macro.
 void copy(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri, CopyRouteRedirector copyRedirector, CopyListener copyListener, DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener)
          Recursive copy with overwrite macro.
 void copy(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri, MacroParameters parameters)
          Copy macro.
 void copy(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri, MacroParameters parameters, CopyRouteRedirector copyRedirector, CopyListener copyListener, DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener)
          Copy macro.
 void delete(SlideToken token, java.lang.String targetUri)
          Recursive delete.
 void delete(SlideToken token, java.lang.String targetUri, DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener)
          Recursive delete.
 void delete(SlideToken token, java.lang.String targetUri, MacroParameters parameters)
          Delete macro.
 void delete(SlideToken token, java.lang.String targetUri, MacroParameters parameters, DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener)
          Delete macro.
 void move(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri)
          Recursive move with overwrite macro.
 void move(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri, CopyRouteRedirector copyRedirector, CopyListener copyListener, DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener)
          Recursive move with overwrite macro.
 void move(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri, MacroParameters parameters)
          Move macro.
 void move(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri, MacroParameters parameters, CopyRouteRedirector copyRedirector, CopyListener copyListener, DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener)
          Move macro.
 void rebind(SlideToken token, java.lang.String sourceUri, java.lang.String destinationUri, MacroParameters parameters, CopyRouteRedirector copyRedirector, CopyListener copyListener, DeleteTargetRedirector deleteRedirector, DeleteListener deleteListener)
           
protected  void recursiveAccessCheck(Uri uri, ActionNode action)
           
protected  void recursiveLockCheck(Uri uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacroImpl

public MacroImpl(Namespace namespace,
                 NamespaceConfig namespaceConfig,
                 Security securityHelper,
                 Content contentHelper,
                 Structure structureHelper,
                 Lock lockHelper)
Constructor.

Parameters:
namespace - Namespace
namespaceConfig - Namespace configuration
contentHelper - Access to content
structureHelper - Access to structure
Method Detail

copy

public void copy(SlideToken token,
                 java.lang.String sourceUri,
                 java.lang.String destinationUri)
          throws CopyMacroException,
                 DeleteMacroException
Recursive copy with overwrite macro.

Specified by:
copy in interface Macro
Parameters:
token - Credentials token
sourceUri - Uri of the source
destinationUri - Uri of the destination
Throws:
CopyMacroException - Generic Slide exception
DeleteMacroException

copy

public void copy(SlideToken token,
                 java.lang.String sourceUri,
                 java.lang.String destinationUri,
                 CopyRouteRedirector copyRedirector,
                 CopyListener copyListener,
                 DeleteTargetRedirector deleteRedirector,
                 DeleteListener deleteListener)
          throws CopyMacroException,
                 DeleteMacroException
Recursive copy with overwrite macro.

Specified by:
copy in interface Macro
Parameters:
token - Credentials token
sourceUri - Uri of the source
destinationUri - Uri of the destination
copyRedirector - the CopyRoutRedirector may be used to redirect the source and/or destination URI of the copy operation. (May be null.)
copyListener - the CopyListener that will be notified before and after copying a resource. (May be null)
deleteRedirector - the DeleteTargetRedirector may be used to redirect the delete operation to a different target. (May be null.)
deleteListener - the DeleteListener that will be notified before and after deleting a destination that will be overwritten by the copy. (May be null)
Throws:
CopyMacroException - Generic Slide exception
DeleteMacroException

copy

public void copy(SlideToken token,
                 java.lang.String sourceUri,
                 java.lang.String destinationUri,
                 MacroParameters parameters)
          throws CopyMacroException,
                 DeleteMacroException
Copy macro.

Specified by:
copy in interface Macro
Parameters:
token - Credentials token
sourceUri - Uri of the source
destinationUri - Uri of the destination
parameters - Macro parameters
Throws:
CopyMacroException - Generic Slide exception
DeleteMacroException

copy

public void copy(SlideToken token,
                 java.lang.String sourceUri,
                 java.lang.String destinationUri,
                 MacroParameters parameters,
                 CopyRouteRedirector copyRedirector,
                 CopyListener copyListener,
                 DeleteTargetRedirector deleteRedirector,
                 DeleteListener deleteListener)
          throws CopyMacroException,
                 DeleteMacroException
Copy macro.

Specified by:
copy in interface Macro
Parameters:
token - Credentials token
sourceUri - Uri of the source
destinationUri - Uri of the destination
parameters - Macro parameters
copyRedirector - the CopyRoutRedirector may be used to redirect the source and/or destination URI of the copy operation. (May be null.)
copyListener - the CopyListener that will be notified before and after copying a resource. (May be null)
deleteRedirector - the DeleteTargetRedirector may be used to redirect the delete operation to a different target. (May be null.)
deleteListener - the DeleteListener that will be notified before and after deleting a destination that will be overwritten by the copy. (May be null)
Throws:
CopyMacroException - Generic Slide exception
DeleteMacroException

recursiveAccessCheck

protected void recursiveAccessCheck(Uri uri,
                                    ActionNode action)
                             throws SlideException,
                                    AccessDeniedException
Throws:
SlideException
AccessDeniedException

recursiveLockCheck

protected void recursiveLockCheck(Uri uri)
                           throws SlideException,
                                  ObjectLockedException
Throws:
SlideException
ObjectLockedException

rebind

public void rebind(SlideToken token,
                   java.lang.String sourceUri,
                   java.lang.String destinationUri,
                   MacroParameters parameters,
                   CopyRouteRedirector copyRedirector,
                   CopyListener copyListener,
                   DeleteTargetRedirector deleteRedirector,
                   DeleteListener deleteListener)
            throws CopyMacroException,
                   DeleteMacroException
Throws:
CopyMacroException
DeleteMacroException

move

public void move(SlideToken token,
                 java.lang.String sourceUri,
                 java.lang.String destinationUri)
          throws CopyMacroException,
                 DeleteMacroException
Recursive move with overwrite macro.

Specified by:
move in interface Macro
Parameters:
token - Credentials token
sourceUri - Uri of the source
destinationUri - Uri of the destination
Throws:
CopyMacroException - Exception occured during copy
DeleteMacroException - Exception occured during deletion

move

public void move(SlideToken token,
                 java.lang.String sourceUri,
                 java.lang.String destinationUri,
                 CopyRouteRedirector copyRedirector,
                 CopyListener copyListener,
                 DeleteTargetRedirector deleteRedirector,
                 DeleteListener deleteListener)
          throws CopyMacroException,
                 DeleteMacroException
Recursive move with overwrite macro.

Specified by:
move in interface Macro
Parameters:
token - Credentials token
sourceUri - Uri of the source
destinationUri - Uri of the destination
copyRedirector - the CopyRoutRedirector may be used to redirect the source and/or destination URI of the copy operation. (May be null.)
copyListener - the CopyListener that will be notified before and after copying a resource. (May be null)
deleteRedirector - the DeleteTargetRedirector may be used to redirect the delete operation to a different target. (May be null.)
deleteListener - the DeleteListener that will be notified before and after deleting a resource. (May be null)
Throws:
CopyMacroException - Exception occured during copy
DeleteMacroException - Exception occured during deletion

move

public void move(SlideToken token,
                 java.lang.String sourceUri,
                 java.lang.String destinationUri,
                 MacroParameters parameters)
          throws CopyMacroException,
                 DeleteMacroException
Move macro.

Specified by:
move in interface Macro
Parameters:
token - Credentials token
sourceUri - Uri of the source
destinationUri - Uri of the destination
parameters - Macro parameters
Throws:
CopyMacroException - Exception occured during copy
DeleteMacroException - Exception occured during deletion

move

public void move(SlideToken token,
                 java.lang.String sourceUri,
                 java.lang.String destinationUri,
                 MacroParameters parameters,
                 CopyRouteRedirector copyRedirector,
                 CopyListener copyListener,
                 DeleteTargetRedirector deleteRedirector,
                 DeleteListener deleteListener)
          throws CopyMacroException,
                 DeleteMacroException
Move macro.

Specified by:
move in interface Macro
Parameters:
token - Credentials token
sourceUri - Uri of the source
destinationUri - Uri of the destination
parameters - Macro parameters
copyRedirector - the CopyRoutRedirector may be used to redirect the source and/or destination URI of the copy operation. (May be null.)
copyListener - the CopyListener that will be notified before and after copying a resource. (May be null)
deleteRedirector - the DeleteTargetRedirector may be used to redirect the delete operation to a different target. (May be null.)
deleteListener - the DeleteListener that will be notified before and after deleting a resource. (May be null)
Throws:
CopyMacroException - Exception occured during copy
DeleteMacroException - Exception occured during deletion

delete

public void delete(SlideToken token,
                   java.lang.String targetUri)
            throws DeleteMacroException
Recursive delete.

Specified by:
delete in interface Macro
Parameters:
token - Credentials token
targetUri - Uri of the object to delete
Throws:
DeleteMacroException - Generic Slide exception

delete

public void delete(SlideToken token,
                   java.lang.String targetUri,
                   DeleteTargetRedirector deleteRedirector,
                   DeleteListener deleteListener)
            throws DeleteMacroException
Recursive delete.

Specified by:
delete in interface Macro
Parameters:
token - Credentials token
targetUri - Uri of the object to delete
deleteRedirector - the DeleteTargetRedirector may be used to redirect the delete operation to a different target. (May be null.)
deleteListener - the DeleteListener that will be notified before and after deleting a resource. (May be null)
Throws:
DeleteMacroException - Generic Slide exception

delete

public void delete(SlideToken token,
                   java.lang.String targetUri,
                   MacroParameters parameters)
            throws DeleteMacroException
Delete macro.

Specified by:
delete in interface Macro
Parameters:
token - Credentials token
targetUri - Uri of the source
parameters - Macro parameters, not used right now, so it can be null
Throws:
DeleteMacroException - Generic Slide exception

delete

public void delete(SlideToken token,
                   java.lang.String targetUri,
                   MacroParameters parameters,
                   DeleteTargetRedirector deleteRedirector,
                   DeleteListener deleteListener)
            throws DeleteMacroException
Delete macro.

Specified by:
delete in interface Macro
Parameters:
token - Credentials token
targetUri - Uri of the source
parameters - Macro parameters, not used right now, so it can be null
deleteRedirector - the DeleteTargetRedirector may be used to redirect the delete operation to a different target. (May be null.)
deleteListener - the DeleteListener that will be notified before and after deleting a resource. (May be null)
Throws:
DeleteMacroException - Generic Slide exception