org.objectweb.proactive.core.process.filetransfer
Class FileTransferWorkShop

java.lang.Object
  extended byorg.objectweb.proactive.core.process.filetransfer.FileTransferWorkShop
All Implemented Interfaces:
java.io.Serializable

public class FileTransferWorkShop
extends java.lang.Object
implements java.io.Serializable

This class stores the FileTransfer arquitecture specific information. It also has a reference on the abstract FileTransfer definitions. The tools for mergin the abstract and specific information are also provided through this class.

Since:
ProActive 2.3
Version:
1.0, 2005/08/26
Author:
ProActive Team
See Also:
Serialized Form

Nested Class Summary
 class FileTransferWorkShop.StructureInformation
           
 
Field Summary
static java.lang.String[] ALLOWED_COPY_PROTOCOLS
           
 FileTransferWorkShop.StructureInformation dstInfoParams
           
static java.lang.String IMPLICIT_KEYWORD
           
protected static org.apache.log4j.Logger logger
           
static java.lang.String PROCESSDEFAULT_KEYWORD
           
 FileTransferWorkShop.StructureInformation srcInfoParams
           
static java.lang.String[] URLPROTOCOLS
           
 
Constructor Summary
FileTransferWorkShop(java.lang.String processDefault)
           
 
Method Summary
 void addFileTransfer(FileTransfer ft)
           
static boolean begginsWithProtocol(java.lang.String s)
           
 java.lang.String buildDstFilePathString(java.lang.String filename)
           
static java.lang.String buildFilePathString(FileTransferWorkShop.StructureInformation infoParam, java.lang.String filename)
           
static java.lang.String buildFilePathString(java.lang.String prefix, java.lang.String fileSep, java.lang.String filename)
           
 java.lang.String buildSrcFilePathString(java.lang.String filename)
           
 boolean check()
          Checks different things.
 boolean checkLocalFileExistance(FileTransfer ft)
           
 CopyProtocol copyProtocolFactory(java.lang.String protocolname)
          This methods creates a CopyProtocol instance, given by it's name as a parameter.
 FileTransfer[] getAllFileTransferDefinitions()
           
 CopyProtocol[] getCopyProtocols()
          This method returns an array of CopyProtocol instances.
 boolean isAllowedProtocol(java.lang.String protocol)
           
 boolean isImplicit()
           
static boolean isLocalReadable(java.lang.String filenamepath)
           
static boolean isRemote(java.lang.String filenamepath)
           
 void setFileTransferCopyProtocol(java.lang.String copyProtocolString)
           
 void setFileTransferStructureDstInfo(java.lang.String name, java.lang.String value)
          Sets the destination information for a given Queue (Deploy, Retrieve).
 void setFileTransferStructureSrcInfo(java.lang.String name, java.lang.String value)
          Sets the source information for a given Queue (Deploy, Retrieve).
 void setImplicit(boolean implicit)
           
static java.lang.String stripProtocol(java.lang.String filename)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROCESSDEFAULT_KEYWORD

public static final java.lang.String PROCESSDEFAULT_KEYWORD
See Also:
Constant Field Values

IMPLICIT_KEYWORD

public static final java.lang.String IMPLICIT_KEYWORD
See Also:
Constant Field Values

ALLOWED_COPY_PROTOCOLS

public static final java.lang.String[] ALLOWED_COPY_PROTOCOLS

URLPROTOCOLS

public static final java.lang.String[] URLPROTOCOLS

logger

protected static org.apache.log4j.Logger logger

srcInfoParams

public FileTransferWorkShop.StructureInformation srcInfoParams

dstInfoParams

public FileTransferWorkShop.StructureInformation dstInfoParams
Constructor Detail

FileTransferWorkShop

public FileTransferWorkShop(java.lang.String processDefault)
Method Detail

toString

public java.lang.String toString()

addFileTransfer

public void addFileTransfer(FileTransfer ft)

setFileTransferCopyProtocol

public void setFileTransferCopyProtocol(java.lang.String copyProtocolString)

getCopyProtocols

public CopyProtocol[] getCopyProtocols()
This method returns an array of CopyProtocol instances. This instances are based on the value configured through the FileTransferStructure.setCopyProtocols()

Returns:
An array of CopyProtocol[].

copyProtocolFactory

public CopyProtocol copyProtocolFactory(java.lang.String protocolname)
This methods creates a CopyProtocol instance, given by it's name as a parameter. If the name is unknown, then a DummyCopyProtocol is returned. If the name of the protocol is "processDefault" then a corresponding instance will be returned with the flag: CopyProtocol.isDefaultProtocol() set to true. Note that in this last case it is possible to have a DummyProtocol with the flag set to true if the factory doesn't know how to make the default protocol.

Parameters:
protocolname - The name of the desired transfer protocol
Returns:
An instance of a class that implements CopyProtocol.

getAllFileTransferDefinitions

public FileTransfer[] getAllFileTransferDefinitions()

setFileTransferStructureSrcInfo

public void setFileTransferStructureSrcInfo(java.lang.String name,
                                            java.lang.String value)
Sets the source information for a given Queue (Deploy, Retrieve).

Parameters:
name - The name of the parameter from: prefix, hostname, username, password
value - The value of the parameter.

setFileTransferStructureDstInfo

public void setFileTransferStructureDstInfo(java.lang.String name,
                                            java.lang.String value)
Sets the destination information for a given Queue (Deploy, Retrieve).

Parameters:
name - The name of the parameter from: prefix, hostname, username, password
value - The value of the parameter.

check

public boolean check()
Checks different things. For now, it prints a warning when an empty FileTransfer definition is found.

Returns:
true if everything is OK, false if there is a problem.

isImplicit

public boolean isImplicit()

setImplicit

public void setImplicit(boolean implicit)

isAllowedProtocol

public boolean isAllowedProtocol(java.lang.String protocol)

buildSrcFilePathString

public java.lang.String buildSrcFilePathString(java.lang.String filename)

buildFilePathString

public static java.lang.String buildFilePathString(FileTransferWorkShop.StructureInformation infoParam,
                                                   java.lang.String filename)

buildDstFilePathString

public java.lang.String buildDstFilePathString(java.lang.String filename)

buildFilePathString

public static java.lang.String buildFilePathString(java.lang.String prefix,
                                                   java.lang.String fileSep,
                                                   java.lang.String filename)

begginsWithProtocol

public static boolean begginsWithProtocol(java.lang.String s)

checkLocalFileExistance

public boolean checkLocalFileExistance(FileTransfer ft)

isLocalReadable

public static boolean isLocalReadable(java.lang.String filenamepath)

isRemote

public static boolean isRemote(java.lang.String filenamepath)

stripProtocol

public static java.lang.String stripProtocol(java.lang.String filename)


Copyright 2001-2005 INRIA All Rights Reserved.