it.geosolutions.geobatch.flow.event.consumer.file
Class FileBasedEventConsumer
java.lang.Object
it.geosolutions.geobatch.catalog.impl.BaseIdentifiable
it.geosolutions.geobatch.catalog.impl.BaseResource
it.geosolutions.geobatch.flow.event.consumer.BaseEventConsumer<FileSystemEvent,FileBasedEventConsumerConfiguration>
it.geosolutions.geobatch.flow.event.consumer.file.FileBasedEventConsumer
- All Implemented Interfaces:
- Identifiable, Resource, EventConsumer<FileSystemEvent,FileBasedEventConsumerConfiguration>, Job, ListenerRegistry<EventConsumerListener>, java.lang.Cloneable, java.util.concurrent.Callable<java.util.Queue<FileSystemEvent>>
public class FileBasedEventConsumer
- extends BaseEventConsumer<FileSystemEvent,FileBasedEventConsumerConfiguration>
- Author:
- Simone Giannecchini, GeoSolutions S.A.S., (r2)Carlo Cancellieri - carlo.cancellieri@geo-solutions.it
| Methods inherited from class it.geosolutions.geobatch.flow.event.consumer.BaseEventConsumer |
addActions, addListener, applyActions, getActions, getCreationTimestamp, getCurrentAction, getListenerForwarder, getProgressListener, getRunningContext, getStatus, isPaused, pause, pause, removeListener, resume, setRunningContext |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FileBasedEventConsumer
public FileBasedEventConsumer(FileBasedEventConsumerConfiguration configuration)
throws java.lang.InterruptedException,
java.io.IOException
- Throws:
java.lang.InterruptedException
java.io.IOException
call
public java.util.Queue<FileSystemEvent> call()
throws java.lang.Exception
- Main Thread cycle.
- Create needed dirs
- Optionally backup files
- Move files into a job-specific working dir
- Run the actions
- Throws:
java.lang.Exception
setConfiguration
public void setConfiguration(FileBasedEventConsumerConfiguration configuration)
- Parameters:
configuration -
getWorkingDir
public java.io.File getWorkingDir()
- Returns:
- the workingDirectory
getConfiguration
public FileBasedEventConsumerConfiguration getConfiguration()
- Returns:
dispose
public void dispose()
- Specified by:
dispose in interface Resource- Specified by:
dispose in interface EventConsumer<FileSystemEvent,FileBasedEventConsumerConfiguration>- Overrides:
dispose in class BaseEventConsumer<FileSystemEvent,FileBasedEventConsumerConfiguration>
clear
public void clear()
- remove all Cumulating progress listener from the Consumer and containing action(s)
remove all the actions from the action list
remove contextRunningDir
consume
public boolean consume(FileSystemEvent event)
- Specified by:
consume in interface EventConsumer<FileSystemEvent,FileBasedEventConsumerConfiguration>- Overrides:
consume in class BaseEventConsumer<FileSystemEvent,FileBasedEventConsumerConfiguration>
cancel
public void cancel()
isCanceled
public boolean isCanceled()
- Returns:
setStatus
protected void setStatus(EventConsumerStatus eventConsumerStatus)
- Overrides:
setStatus in class BaseEventConsumer<FileSystemEvent,FileBasedEventConsumerConfiguration>
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2008-2012 GeoSolutions. All Rights Reserved.