public class ContentDirectoryMonitor extends Object implements DirectoryMonitor
Modifier and Type | Class and Description |
---|---|
static class |
ContentDirectoryMonitor.SystemSubjectBinder |
Modifier and Type | Field and Description |
---|---|
static String |
DELETE |
static String |
IN_PLACE |
static String |
MOVE |
Constructor and Description |
---|
ContentDirectoryMonitor(org.apache.camel.CamelContext camelContext)
Constructs a monitor for a specific directory that will ingest files into the Content
Framework.
|
ContentDirectoryMonitor(org.apache.camel.CamelContext camelContext,
int maxRetries,
int delayBetweenRetries,
Executor configurationExecutor)
Constructs a monitor that uses the given RetryPolicy while waiting for the content scheme, and
the given Executor to run the setup and Camel configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy(int code)
Invoked when a configuration is destroyed from the container.
|
Integer |
getNumThreads() |
Integer |
getReadLockIntervalMilliseconds() |
List<org.apache.camel.model.RouteDefinition> |
getRouteDefinitions() |
void |
init()
This method will stop and remove any existing Camel routes in this context, and then configure
a new Camel route using the properties set in the setter methods.
|
void |
setAttributeOverrides(List<String> attributeOverrides) |
void |
setMonitoredDirectoryPath(String monitoredDirectoryPath) |
void |
setNumThreads(Integer numThreads)
Set the thread pool size with the given argument.
|
void |
setProcessingMechanism(String processingMechanism) |
void |
setReadLockIntervalMilliseconds(Integer readLockIntervalMilliseconds)
Set the read lock interval for the Camel Route with the given argument.
|
void |
updateCallback(Map<String,Object> properties)
Invoked when updates are made to the configuration of existing directory monitors.
|
public static final String DELETE
public static final String MOVE
public static final String IN_PLACE
public ContentDirectoryMonitor(org.apache.camel.CamelContext camelContext)
camelContext
- the Camel context to use across all Content Directory Monitors. Note that
if Apache changes this ModelCamelContext interface there is no guarantee that whatever DM
is being used (Blueprint in this case) will be updated accordingly.public ContentDirectoryMonitor(org.apache.camel.CamelContext camelContext, int maxRetries, int delayBetweenRetries, Executor configurationExecutor)
camelContext
- the Camel context to use across all Content directory monitors.maxRetries
- Policy for polling the 'content' CamelComponent. Specifies, for any content
directory monitor, the number of times it will poll.delayBetweenRetries
- Policy for polling the 'content' CamelComponent. Specifies, for any
content directory monitor, the number of seconds it will wait between consecutive polls.configurationExecutor
- the executor used to run configuration and updates.public void setNumThreads(Integer numThreads)
numThreads
- - the specified size to make the thread poolpublic Integer getNumThreads()
public void setReadLockIntervalMilliseconds(Integer readLockIntervalMilliseconds)
readLockIntervalMilliseconds
- public Integer getReadLockIntervalMilliseconds()
public void init()
Invoked after all of the setter methods have been called (for initial route creation), and also called whenever an existing route is updated.
public void destroy(int code)
Only remove routes that this Content Directory Monitor created since the same CamelContext is shared across all Content Directory Monitors.
public void updateCallback(Map<String,Object> properties)
properties
- - properties map for the configurationpublic void setMonitoredDirectoryPath(String monitoredDirectoryPath)
monitoredDirectoryPath
- - directory path for the monitored directorypublic void setProcessingMechanism(String processingMechanism)
processingMechanism
- - what to do with the files after ingestpublic void setAttributeOverrides(List<String> attributeOverrides)
attributeOverrides
- - a list of attributes to overridepublic List<org.apache.camel.model.RouteDefinition> getRouteDefinitions()
This work is licensed under a Creative Commons Attribution 4.0 International License.