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.AbstractEndpoint
definition, description, endpoint, interfaceName, logger, 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()
           
 String getUniqueFileName()
           
protected  String getUploadName(String name)
           
 String getUploadPrefix()
           
 String getUploadSuffix()
           
 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 setCheckDuplicates(boolean checkDuplicates)
           
 void setClientPool(FTPClientPool clientPool)
           
 void setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)
           
 void setOverwrite(boolean overwrite)
           
 void setUniqueFileName(String uniqueFileName)
          Sets the name used to make a unique name if no file name is available on the message.
 void setUploadPrefix(String uploadPrefix)
          Set the file name prefix used during upload.
 void setUploadSuffix(String uploadSuffix)
          Set the file name suffix used during upload.
 void setUri(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(URI uri)
Configures the endpoint from a URI


isCheckDuplicates

public boolean isCheckDuplicates()

setCheckDuplicates

public void setCheckDuplicates(boolean checkDuplicates)

start

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

getClientPool

public FTPClientPool getClientPool()

setClientPool

public void setClientPool(FTPClientPool clientPool)

getMarshaler

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

setMarshaler

public void setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)

getUniqueFileName

public String getUniqueFileName()

setUniqueFileName

public void setUniqueFileName(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)

getUploadPrefix

public String getUploadPrefix()

setUploadPrefix

public void setUploadPrefix(String uploadPrefix)
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

public String getUploadSuffix()

setUploadSuffix

public void setUploadSuffix(String uploadSuffix)
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 -

processInOnly

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

getUploadName

protected String getUploadName(String name)

createClientPool

protected FTPClientPool createClientPool()
                                  throws Exception
Throws:
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-2009 The Apache Software Foundation. All Rights Reserved.