it.eng.spago.cms.operations
Class ImportOperation

java.lang.Object
  extended by it.eng.spago.cms.operations.ImportOperation

public class ImportOperation
extends java.lang.Object

Models a repository import operation. The operation has three attributes:

The configuration of the operation is stored into a Spago SourceBean structured like below:
 <OPERATION name="IMPORT">
            <IMPORTOPERATION path="?" stream="?" uuidBehavior="?" />  
 </OPERATION>
 


Constructor Summary
ImportOperation()
          Constructor of the class useful to build an empty import operation.
ImportOperation(java.lang.String path, java.io.InputStream stream)
          Constructor of the class useful to build an import operation setting the path and stream.
ImportOperation(java.lang.String path, java.io.InputStream stream, int uuidBehavior)
          Constructor of the class useful to build an import operation setting the path, stream and uuidBehavior attributes.
 
Method Summary
 SourceBean getOperationDescriptor()
          Gets the Internal SourceBean which defines the internal structure of the operation
 void setInputStream(java.io.InputStream stream)
          Set the input stream for the nodes deserialization
 void setPath(java.lang.String path)
          Set the path of the cms node where importing nodes will be placed
 void setUuidBehavior(int uuidBehavior)
          Set the uuidBehavior int flag: see javax.jcr.ImportUUIDBehavior
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportOperation

public ImportOperation()
                throws BuildOperationException
Constructor of the class useful to build an empty import operation.

Throws:
BuildOperationException - Thrown if an error occurs during the creation

ImportOperation

public ImportOperation(java.lang.String path,
                       java.io.InputStream stream,
                       int uuidBehavior)
                throws BuildOperationException
Constructor of the class useful to build an import operation setting the path, stream and uuidBehavior attributes.

Parameters:
path - The path of the cms node where importing nodes will be placed
stream - The InputStream where importing nodes are deserialized from
uuidBehavior - Int flag that governs how the UUIDs of incoming nodes are handled: see javax.jcr.ImportUUIDBehavior
Throws:
BuildOperationException - Thrown if an error occurs during the creation

ImportOperation

public ImportOperation(java.lang.String path,
                       java.io.InputStream stream)
                throws BuildOperationException
Constructor of the class useful to build an import operation setting the path and stream. For uuidBehavior the default value is considered, that is: javax.jcr.ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW.

Parameters:
path - The path of the cms node where importing nodes will be placed
stream - The InputStream where importing nodes are deserialized from
uuidBehavior - Int flag that governs how the UUIDs of incoming nodes are handled: see javax.jcr.ImportUUIDBehavior
Throws:
BuildOperationException - Thrown if an error occurs during the creation
Method Detail

setPath

public void setPath(java.lang.String path)
             throws BuildOperationException
Set the path of the cms node where importing nodes will be placed

Parameters:
path - The path of the cms node where importing nodes will be placed
Throws:
BuildOperationException - Thrown if an error occurs during the setting

setUuidBehavior

public void setUuidBehavior(int uuidBehavior)
                     throws BuildOperationException
Set the uuidBehavior int flag: see javax.jcr.ImportUUIDBehavior

Parameters:
uuidBehavior - The uuidBehavior int flag to set
Throws:
BuildOperationException - Thrown if an error occurs during the setting

setInputStream

public void setInputStream(java.io.InputStream stream)
                    throws BuildOperationException
Set the input stream for the nodes deserialization

Parameters:
stream - InputStream for the cms nodes deserialization
Throws:
BuildOperationException - Thrown if an error occurs during the setting

getOperationDescriptor

public SourceBean getOperationDescriptor()
Gets the Internal SourceBean which defines the internal structure of the operation

Returns:
The Internal SourceBean of the operation which defines the internal structure of the operation