com.gridsystems.nextgrid.api.pom.components
Class FileSystemGrounding

java.lang.Object
  extended by com.gridsystems.nextgrid.api.pom.AbstractGroundingImpl
      extended by com.gridsystems.nextgrid.api.pom.components.FileSystemGrounding
All Implemented Interfaces:
java.io.Serializable, nextgrid.api.pom.Grounding, nextgrid.api.pom.GroundingFactory

public class FileSystemGrounding
extends AbstractGroundingImpl
implements nextgrid.api.pom.GroundingFactory

Grounding providing standard operations on the local file-system.

Usage

This grounding requires the service to be defined with the following attributes:

Convenience constants are provided for the attribute names and valid values. For example, the following code creates and configures a Service for the "OP_DELETE_FILE" operation:


 ProcessFactory factory = ProcessFactoryFinder.getFactory();
 Service s = factory.newServiceProcess();
 s.setAttribute(new QName("urn:grounding", "type"), "urn:file-system");
 s.setAttribute(new QName("urn:grounding", "operation"), "DeleteFile");
 

Available Operations

OperationOperation NameConstant
Delete FileDeleteFileOP_DELETE_FILE
Create FileCreateFileFromTemplateOP_CREATE_FROM_TEMPLATE

DeleteFile

This operation deletes one or more files in the local file-system. The files can be regular files or directories, either empty or not.

All input parameters are processed by this operations. Any parameter that can be casted to a File instance will be deleted. For the rest, if their contents in string format matches a local file path to an existent file, it will be deleted.

CreateFileFromTemplate

This operation creates a file from an optional template. It uses the following inputs:

If no destination file is defined, a temporary file will be created.

If found, the resulting file will be returned in an output parameter called "file".

Author:
Rodrigo Ruiz
See Also:
Serialized Form

Field Summary
static java.lang.String OP_CREATE_FROM_TEMPLATE
          Operation that creates a file from a template.
static java.lang.String OP_DELETE_FILE
          Operation that deletes a file from the file system.
static java.lang.String TYPE
          Grounding type.
static java.net.URI TYPE_URI
          Grounding type.
 
Fields inherited from interface nextgrid.api.pom.Grounding
ATTR_GROUNDING_TYPE, ATTR_OPERATION, NS_GROUNDING
 
Constructor Summary
FileSystemGrounding()
          Creates a new instance.
 
Method Summary
 nextgrid.api.pom.Grounding createGrounding()
          
 void dispose()
          
 void invoke(nextgrid.api.env.ProcessEnvironment env, nextgrid.api.pom.Service service)
          
 void validate()
          
 
Methods inherited from class com.gridsystems.nextgrid.api.pom.AbstractGroundingImpl
attr, getSupportedAttribs, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nextgrid.api.pom.GroundingFactory
getType
 

Field Detail

OP_DELETE_FILE

public static final java.lang.String OP_DELETE_FILE
Operation that deletes a file from the file system.

See Also:
Constant Field Values

OP_CREATE_FROM_TEMPLATE

public static final java.lang.String OP_CREATE_FROM_TEMPLATE
Operation that creates a file from a template.

See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
Grounding type.

See Also:
Constant Field Values

TYPE_URI

public static final java.net.URI TYPE_URI
Grounding type.

Constructor Detail

FileSystemGrounding

public FileSystemGrounding()
Creates a new instance.

Method Detail

dispose

public void dispose()

Specified by:
dispose in interface nextgrid.api.pom.Grounding

invoke

public void invoke(nextgrid.api.env.ProcessEnvironment env,
                   nextgrid.api.pom.Service service)
            throws nextgrid.api.pom.ProcessException

Specified by:
invoke in interface nextgrid.api.pom.Grounding
Throws:
nextgrid.api.pom.ProcessException

validate

public void validate()
              throws nextgrid.api.pom.ProcessException

Specified by:
validate in interface nextgrid.api.pom.Grounding
Throws:
nextgrid.api.pom.ProcessException

createGrounding

public nextgrid.api.pom.Grounding createGrounding()

Specified by:
createGrounding in interface nextgrid.api.pom.GroundingFactory


Copyright © 2006-2008 Grid Systems, S.A.. All Rights Reserved.