org.apache.servicemix.ftp
Class FtpSenderEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
      extended by org.apache.servicemix.common.endpoints.SimpleEndpoint
          extended by org.apache.servicemix.common.endpoints.ProviderEndpoint
              extended by org.apache.servicemix.ftp.FtpSenderEndpoint
All Implemented Interfaces:
Endpoint, FtpEndpointType

public class FtpSenderEndpoint
extends ProviderEndpoint
implements FtpEndpointType

An FTP endpoint

Version:
$Revision: $

Field Summary
 
Fields inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
logger
 
Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
definition, description, endpoint, interfaceName, service, serviceUnit
 
Constructor Summary
FtpSenderEndpoint()
           
FtpSenderEndpoint(FtpComponent component, javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
 
Method Summary
protected  org.apache.commons.net.ftp.FTPClient borrowClient()
           
protected  FTPClientPool createClientPool()
           
 FTPClientPool getClientPool()
           
 org.apache.servicemix.components.util.FileMarshaler getMarshaler()
           
 java.lang.String getUniqueFileName()
           
protected  java.lang.String getUploadName(java.lang.String name)
          Deprecated. 
 java.lang.String getUploadPrefix()
          Deprecated. 
 java.lang.String getUploadSuffix()
          Deprecated. 
 boolean isAutoCreateDirectory()
           
 boolean isCheckDuplicates()
           
 boolean isOverwrite()
           
protected  void processInOnly(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage message)
           
protected  void returnClient(org.apache.commons.net.ftp.FTPClient client)
           
 void setAutoCreateDirectory(boolean autoCreateDirectory)
          Specifies if the endpoint should create the target directory, if it does not already exist.
 void setCheckDuplicates(boolean checkDuplicates)
          Specifies whether duplicates should be checked.
 void setClientPool(FTPClientPool clientPool)
          Set a custom FTPClientPool.
 void setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)
          Set a custom FileMarshaler implementation to control how the file contents is being translated into a JBI message.
 void setOverwrite(boolean overwrite)
          Specifies if a file with the same name already exists on the FTP server, the file should be overwritten.
 void setUniqueFileName(java.lang.String uniqueFileName)
          Sets the name used to make a unique name if no file name is available on the message.
 void setUploadPrefix(java.lang.String uploadPrefix)
          Deprecated. 
 void setUploadSuffix(java.lang.String uploadSuffix)
          Deprecated. 
 void setUri(java.net.URI uri)
          Configures the endpoint from a URI
 void start()
           
 void validate()
           
 
Methods inherited from class org.apache.servicemix.common.endpoints.ProviderEndpoint
activate, deactivate, getRole, process, processInOut
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
done, fail, getChannel, getContext, getExchangeFactory, send, sendSync, stop
 
Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
getDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FtpSenderEndpoint

public FtpSenderEndpoint()

FtpSenderEndpoint

public FtpSenderEndpoint(FtpComponent component,
                         javax.jbi.servicedesc.ServiceEndpoint endpoint)
Method Detail

validate

public void validate()
              throws javax.jbi.management.DeploymentException
Specified by:
validate in interface Endpoint
Overrides:
validate in class AbstractEndpoint
Throws:
javax.jbi.management.DeploymentException

setUri

public void setUri(java.net.URI uri)
Configures the endpoint from a URI


isCheckDuplicates

public boolean isCheckDuplicates()

setCheckDuplicates

public void setCheckDuplicates(boolean checkDuplicates)
Specifies whether duplicates should be checked. Defaults to true.

Parameters:
checkDuplicates - is a boolean specifying whether duplicate should be checked. Default value is true. .

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Endpoint
Overrides:
start in class SimpleEndpoint
Throws:
java.lang.Exception

getClientPool

public FTPClientPool getClientPool()

setClientPool

public void setClientPool(FTPClientPool clientPool)
Set a custom FTPClientPool. If this property has not been set, the FTP client pool will be created based on the information provided in the URI.

Parameters:
clientPool - the clientPool implementation to use

getMarshaler

public org.apache.servicemix.components.util.FileMarshaler getMarshaler()

setMarshaler

public void setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)
Set a custom FileMarshaler implementation to control how the file contents is being translated into a JBI message. The default implementation reads XML contents from the file.

Parameters:
marshaler - the marshaler implementation to use

getUniqueFileName

public java.lang.String getUniqueFileName()

setUniqueFileName

public void setUniqueFileName(java.lang.String uniqueFileName)
Sets the name used to make a unique name if no file name is available on the message.

Parameters:
uniqueFileName - the new value of the unique name to use for generating unique names

isOverwrite

public boolean isOverwrite()

setOverwrite

public void setOverwrite(boolean overwrite)
Specifies if a file with the same name already exists on the FTP server, the file should be overwritten. Defaults to false.

Parameters:
overwrite - if a file with the same name already exists on the FTP server, the file should be overwritten.

getUploadPrefix

@Deprecated
public java.lang.String getUploadPrefix()
Deprecated. 


setUploadPrefix

@Deprecated
public void setUploadPrefix(java.lang.String uploadPrefix)
Deprecated. 

Set the file name prefix used during upload. The prefix will be automatically removed as soon as the upload has completed. This allows other processes to discern completed files from files that are being uploaded.

Parameters:
uploadPrefix -

getUploadSuffix

@Deprecated
public java.lang.String getUploadSuffix()
Deprecated. 


setUploadSuffix

@Deprecated
public void setUploadSuffix(java.lang.String uploadSuffix)
Deprecated. 

Set the file name suffix used during upload. The suffix will be automatically removed as soon as the upload has completed. This allows other processes to discern completed files from files that are being uploaded.

Parameters:
uploadSuffix -

setAutoCreateDirectory

public void setAutoCreateDirectory(boolean autoCreateDirectory)
Specifies if the endpoint should create the target directory, if it does not already exist. If you set this to false and the directory does not exist, the endpoint will not do anything. Default value is true.

Parameters:
autoCreateDirectory - a boolean specifying if the endpoint creates directories.

isAutoCreateDirectory

public boolean isAutoCreateDirectory()

processInOnly

protected void processInOnly(javax.jbi.messaging.MessageExchange exchange,
                             javax.jbi.messaging.NormalizedMessage message)
                      throws java.lang.Exception
Overrides:
processInOnly in class ProviderEndpoint
Throws:
java.lang.Exception

getUploadName

@Deprecated
protected java.lang.String getUploadName(java.lang.String name)
Deprecated. 


createClientPool

protected FTPClientPool createClientPool()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

borrowClient

protected org.apache.commons.net.ftp.FTPClient borrowClient()
                                                     throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

returnClient

protected void returnClient(org.apache.commons.net.ftp.FTPClient client)


Copyright © 2005-2012 FuseSource. All Rights Reserved.