public class VFSPollingEndpoint extends PollingEndpoint implements VFSEndpointType
org.apache.servicemix.components.util.BinaryFileMarshalerdefinition, description, endpoint, interfaceName, service, serviceUnit| Constructor and Description |
|---|
VFSPollingEndpoint()
default constructor
|
VFSPollingEndpoint(DefaultComponent component,
javax.jbi.servicedesc.ServiceEndpoint endpoint)
creates a VFS polling endpoint
|
VFSPollingEndpoint(ServiceUnit serviceUnit,
javax.xml.namespace.QName service,
java.lang.String endpoint)
creates a VFS polling endpoint
|
| Modifier and Type | Method and Description |
|---|---|
protected LockManager |
createLockManager()
returns the lock manager
|
java.util.Comparator<org.apache.commons.vfs.FileObject> |
getComparator() |
org.apache.commons.vfs.FileSystemManager |
getFileSystemManager() |
java.lang.String |
getLocationURI() |
LockManager |
getLockManager() |
org.apache.servicemix.components.util.FileMarshaler |
getMarshaler() |
java.lang.String |
getPath() |
org.apache.commons.vfs.FileSelector |
getSelector() |
java.util.Set<org.apache.commons.vfs.FileObject> |
getWorkingSet()
The set of FTPFiles that this component is currently working on
|
boolean |
isConcurrentExchange() |
boolean |
isDeleteFile() |
boolean |
isRecursive() |
void |
poll() |
protected void |
pollFile(org.apache.commons.vfs.FileObject aFile)
polls a file object
|
protected void |
pollFileOrDirectory(org.apache.commons.vfs.FileObject fileOrDirectory)
polls a file which is not clear to be a file or folder
|
protected void |
pollFileOrDirectory(org.apache.commons.vfs.FileObject fileOrDirectory,
boolean processDir)
recursive method for processing a file or a folder
|
void |
process(javax.jbi.messaging.MessageExchange exchange) |
protected void |
processFile(org.apache.commons.vfs.FileObject file)
does the real processing logic
|
protected void |
processFileNow(org.apache.commons.vfs.FileObject aFile)
processes a file
|
void |
setComparator(java.util.Comparator<org.apache.commons.vfs.FileObject> comparator)
Specifies a
Comparator object. |
void |
setConcurrentExchange(boolean concurrentExchange) |
void |
setDeleteFile(boolean deleteFile)
Specifies if files should be deleted after they are processed.
|
void |
setFileSystemManager(org.apache.commons.vfs.FileSystemManager fileSystemManager)
sets the file system manager
|
void |
setLockManager(LockManager lockManager)
Bean defining the class implementing the file locking strategy.
|
void |
setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)
Specifies a
FileMarshaler object that will marshal file data
into the NMR. |
void |
setPath(java.lang.String path)
Specifies a
String object representing the path of the
file/folder to be polled.Examples: file:///home/lhein/pollFolder zip:file:///home/lhein/pollFolder/myFile.zip jar:http://www.myhost.com/files/Examples.jar jar:../lib/classes.jar!/META-INF/manifest.mf tar:gz:http://anyhost/dir/mytar.tar.gz!/mytar.tar!/path/in/tar/README.txt tgz:file://anyhost/dir/mytar.tgz!/somepath/somefile gz:/my/gz/file.gz http://myusername@somehost/index.html webdav://somehost:8080/dist ftp://myusername:mypassword@somehost/pub/downloads/somefile.tgz sftp://myusername:mypassword@somehost/pub/downloads/somefile.tgz smb://somehost/home tmp://dir/somefile.txt res:path/in/classpath/image.png ram:///any/path/to/file.txt mime:file:///your/path/mail/anymail.mime!/filename.pdf For further details have a look at http://commons.apache.org/vfs/filesystems.html. |
void |
setRecursive(boolean recursive) |
void |
setSelector(org.apache.commons.vfs.FileSelector selector)
Specifies a
FileSelector object. |
void |
start() |
getDelay, getExecutor, getFirstTime, getPeriod, getScheduler, handlePollException, isConcurrentPolling, setConcurrentPolling, setDelay, setFirstTime, setPeriod, setScheduler, stopactivate, configureExchangeTarget, deactivate, getRole, getTargetEndpoint, getTargetInterface, getTargetOperation, getTargetService, getTargetUri, setTargetEndpoint, setTargetInterface, setTargetOperation, setTargetService, setTargetUri, validatedone, fail, getChannel, getContext, getExchangeFactory, send, sendSyncgetDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toStringpublic VFSPollingEndpoint()
public VFSPollingEndpoint(ServiceUnit serviceUnit, javax.xml.namespace.QName service, java.lang.String endpoint)
serviceUnit - the service unitservice - the service nameendpoint - the endpoint namepublic VFSPollingEndpoint(DefaultComponent component, javax.jbi.servicedesc.ServiceEndpoint endpoint)
component - the default componentendpoint - the endpointpublic void start()
throws java.lang.Exception
start in interface Endpointstart in class PollingEndpointjava.lang.Exceptionprotected LockManager createLockManager()
public 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.Exceptionpublic void poll()
throws java.lang.Exception
poll in class PollingEndpointjava.lang.Exceptionprotected void pollFileOrDirectory(org.apache.commons.vfs.FileObject fileOrDirectory)
throws java.lang.Exception
fileOrDirectory - the file or folder objectjava.lang.Exception - on IO errorsprotected void pollFileOrDirectory(org.apache.commons.vfs.FileObject fileOrDirectory,
boolean processDir)
throws java.lang.Exception
fileOrDirectory - the file or folder objectprocessDir - flag if processing should act recursivejava.lang.Exception - on IO errorsprotected void pollFile(org.apache.commons.vfs.FileObject aFile)
throws java.lang.Exception
aFile - the file objectjava.lang.Exception - on IO errorsprotected void processFileNow(org.apache.commons.vfs.FileObject aFile)
aFile - the file to processprotected void processFile(org.apache.commons.vfs.FileObject file)
throws java.lang.Exception
file - the file to processjava.lang.Exception - on processing errorspublic void setDeleteFile(boolean deleteFile)
true.deleteFile - a boolean specifying if the file should be deletedpublic boolean isDeleteFile()
public void setLockManager(LockManager lockManager)
org.apache.servicemix.locks.LockManager interface. By
default, this will be set to an instances of
org.apache.servicemix.common.locks.impl.SimpleLockManager.lockManager - the LockManager implementation to usepublic LockManager getLockManager()
public void setMarshaler(org.apache.servicemix.components.util.FileMarshaler marshaler)
FileMarshaler object that will marshal file data
into the NMR. The default file marshaller can read valid XML data.
FileMarshaler objects are implementations of
org.apache.servicemix.components.util.FileMarshaler.marshaler - a FileMarshaler object that can read data
from the file system.public org.apache.servicemix.components.util.FileMarshaler getMarshaler()
public void setComparator(java.util.Comparator<org.apache.commons.vfs.FileObject> comparator)
Comparator object.comparator - a Comparator object.public java.util.Comparator<org.apache.commons.vfs.FileObject> getComparator()
public void setSelector(org.apache.commons.vfs.FileSelector selector)
FileSelector object.selector - a FileSelector objectpublic org.apache.commons.vfs.FileSelector getSelector()
public void setPath(java.lang.String path)
String object representing the path of the
file/folder to be polled.http://commons.apache.org/vfs/filesystems.html.
path - a String object that represents a file/folder/vfspublic java.lang.String getPath()
public void setFileSystemManager(org.apache.commons.vfs.FileSystemManager fileSystemManager)
fileSystemManager - the file system managerpublic org.apache.commons.vfs.FileSystemManager getFileSystemManager()
public java.util.Set<org.apache.commons.vfs.FileObject> getWorkingSet()
public boolean isRecursive()
public void setRecursive(boolean recursive)
recursive - The recursive to set.public boolean isConcurrentExchange()
public void setConcurrentExchange(boolean concurrentExchange)
concurrentExchange - the concurrentExchange to setCopyright © 2005-2015 FuseSource. All Rights Reserved.