public class FtpPollerEndpoint extends PollingEndpoint implements FtpEndpointType
| Modifier and Type | Class and Description |
|---|---|
protected class |
FtpPollerEndpoint.FtpData |
loggerdefinition, description, endpoint, interfaceName, service, serviceUnit| Constructor and Description |
|---|
FtpPollerEndpoint() |
FtpPollerEndpoint(DefaultComponent component,
javax.jbi.servicedesc.ServiceEndpoint endpoint)
Bean defining the class implementing the JBI DefaultComponent.
|
FtpPollerEndpoint(ServiceUnit serviceUnit,
javax.xml.namespace.QName service,
java.lang.String endpoint) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
protected org.apache.commons.net.ftp.FTPClient |
borrowClient() |
protected FTPClientPool |
createClientPool() |
protected LockManager |
createLockManager() |
java.net.URI |
getArchive() |
FTPClientPool |
getClientPool() |
java.io.FileFilter |
getFilter() |
java.lang.String |
getLocationURI() |
LockManager |
getLockManager() |
org.apache.servicemix.components.util.FileMarshaler |
getMarshaler() |
javax.xml.namespace.QName |
getTargetOperation() |
java.net.URI |
getUri() |
boolean |
isAutoCreateDirectory() |
boolean |
isDeleteFile() |
boolean |
isRecursive() |
boolean |
isStateless() |
void |
poll() |
protected void |
pollFile(java.lang.String file) |
protected void |
pollFileOrDirectory(org.apache.commons.net.ftp.FTPClient ftp,
java.lang.String fileOrDirectory,
boolean processDir) |
protected void |
pollFileOrDirectory(java.lang.String fileOrDirectory) |
void |
process(javax.jbi.messaging.MessageExchange exchange) |
protected void |
processFile(org.apache.commons.net.ftp.FTPClient ftp,
java.lang.String file) |
protected void |
processFileNow(java.lang.String file) |
protected void |
returnClient(org.apache.commons.net.ftp.FTPClient client) |
void |
setArchive(java.net.URI archive)
Specifies a directory relative to the polling directory to which
processed files are archived.
|
void |
setAutoCreateDirectory(boolean autoCreateDirectory)
Specifies if the endpoint should create the target directory, if it does
not already exist.
|
void |
setChangeWorkingDirectory(boolean changeWorkingDirectory)
When set to
true, the poller will do an explicit cwd into the directory to be polled. |
void |
setClientPool(FTPClientPool clientPool)
Set a custom FTPClientPool.
|
void |
setDeleteFile(boolean deleteFile)
Delete the file after it has been succesfully processed? Defaults to
true |
void |
setFilter(java.io.FileFilter filter)
Sets the filter to select which files have to be processed.
|
void |
setLockManager(LockManager lockManager)
Set a custom LockManager implementation for keeping track of which files are already being processed.
|
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 |
setRecursive(boolean recursive)
Specifies whether subdirectories should be polled.
|
void |
setStateless(boolean stateless)
When set to
false |
void |
setTargetOperation(javax.xml.namespace.QName targetOperation)
Set the operation to be invoked on the target service.
|
void |
setUri(java.net.URI uri)
Configures the endpoint from a URI.
|
void |
start() |
void |
validate() |
getDelay, getExecutor, getFirstTime, getPeriod, getScheduler, handlePollException, isConcurrentPolling, setConcurrentPolling, setDelay, setFirstTime, setPeriod, setScheduler, stopconfigureExchangeTarget, deactivate, getRole, getTargetEndpoint, getTargetInterface, getTargetService, getTargetUri, setTargetEndpoint, setTargetInterface, setTargetService, setTargetUridone, fail, getChannel, getContext, getExchangeFactory, send, sendSyncgetDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toStringpublic FtpPollerEndpoint()
public FtpPollerEndpoint(ServiceUnit serviceUnit, javax.xml.namespace.QName service, java.lang.String endpoint)
public FtpPollerEndpoint(DefaultComponent component, javax.jbi.servicedesc.ServiceEndpoint endpoint)
org.apache.servicemix.common.DefaultComponent class.component - the component implementation to usepublic void poll()
throws java.lang.Exception
poll in class PollingEndpointjava.lang.Exceptionpublic void validate()
throws javax.jbi.management.DeploymentException
validate in interface Endpointvalidate in class ConsumerEndpointjavax.jbi.management.DeploymentExceptionpublic void activate()
throws java.lang.Exception
activate in interface Endpointactivate in class ConsumerEndpointjava.lang.Exceptionpublic void start()
throws java.lang.Exception
start in interface Endpointstart in class PollingEndpointjava.lang.Exceptionprotected LockManager createLockManager()
public FTPClientPool getClientPool()
public void setClientPool(FTPClientPool clientPool)
clientPool - the clientPool implementation to usepublic java.net.URI getUri()
public void setUri(java.net.URI uri)
public java.io.FileFilter getFilter()
public void setFilter(java.io.FileFilter filter)
public boolean isDeleteFile()
public void setDeleteFile(boolean deleteFile)
truedeleteFile - public boolean isRecursive()
public void setRecursive(boolean recursive)
truerecursive - is a boolean specifying whether subdirectories should be polled. Default value is true.
.public org.apache.servicemix.components.util.FileMarshaler getMarshaler()
public void setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)
marshaler - the marshaler implementation to usepublic javax.xml.namespace.QName getTargetOperation()
getTargetOperation in class ConsumerEndpointpublic void setTargetOperation(javax.xml.namespace.QName targetOperation)
setTargetOperation in class ConsumerEndpointtargetOperation - a QName specifiying the name of the target operationpublic void setChangeWorkingDirectory(boolean changeWorkingDirectory)
true, the poller will do an explicit cwd into the directory to be polled.
Default to false. Recursive polling will not be possible if this feature is enabled.changeWorkingDirectory - is a boolean specifying if the endpoint can change the working directory
.public boolean isStateless()
public void setStateless(boolean stateless)
falsestateless - is a boolean specifying whether the polled file should be sent asynchronous or synchronous to the nmr. Default value is true.
.public void setAutoCreateDirectory(boolean autoCreateDirectory)
false and the
directory does not exist, the endpoint will not do anything. Default
value is true.autoCreateDirectory - a boolean specifying if the endpoint creates
directories.public boolean isAutoCreateDirectory()
public void setArchive(java.net.URI archive)
archive - a URI object for the archive directorypublic java.net.URI getArchive()
public void setLockManager(LockManager lockManager)
lockManager - the LockManager implementation to usepublic LockManager getLockManager()
protected void pollFileOrDirectory(java.lang.String fileOrDirectory)
throws java.lang.Exception
java.lang.Exceptionprotected void pollFileOrDirectory(org.apache.commons.net.ftp.FTPClient ftp,
java.lang.String fileOrDirectory,
boolean processDir)
throws java.lang.Exception
java.lang.Exceptionprotected void pollFile(java.lang.String file)
protected void processFileNow(java.lang.String file)
protected void processFile(org.apache.commons.net.ftp.FTPClient ftp,
java.lang.String file)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getLocationURI()
getLocationURI in class ConsumerEndpointpublic void process(javax.jbi.messaging.MessageExchange exchange)
throws java.lang.Exception
process in interface Endpointprocess in class AbstractEndpointjava.lang.Exceptionprotected FTPClientPool createClientPool() throws java.lang.Exception
java.lang.Exceptionprotected org.apache.commons.net.ftp.FTPClient borrowClient()
throws javax.jbi.JBIException
javax.jbi.JBIExceptionprotected void returnClient(org.apache.commons.net.ftp.FTPClient client)
Copyright © 2005-2016 FuseSource. All Rights Reserved.