Class RepositoryManager
java.lang.Object
com.jalios.jcms.fileprocessor.repository.RepositoryManager
This singleton manages Repositories in the following way :
- allows checkin/checkout ;
- allows launching/stopping ;
- manages scheduling informations ;
- tells if a task from a scan of the repository is pending.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddRepository(Repository configuration) A new repository is added to the manager, except if : it is null; the id is alreadey used for another configuration; the conditions are not verified.booleanExecute now, in a specific thread (not in the current thread) the AlarmListener used to process postponed item.booleanExecute now, in a specific thread (not in the current thread) the AlarmListener used to trigger directory scanning.static RepositoryManagerThe first time, instanciate the RepositoryManager.Returns the date of the next call to the AlarmListener scheduled for postponed item processing.Returns the date of the next call to the AlarmListener scheduled for directory scanningGives the collection of RepositoryConfiguration registered in the manager.getRepository(String id) Gives the RepositoryConfiguration mapped with this id.booleanisLaunched(String id) We store in memory the information that a repository is stored.booleanLaunch a repository if not.Stops, removes and returns the repository mapped to this id off from the manager.booleanstopRepository(String id) Stops the treatment if needed and checkout the AlarmEntry.
-
Field Details
-
JCMS_UPLOAD_REPOSITORY
- See Also:
-
-
Method Details
-
getInstance
The first time, instanciate the RepositoryManager.- Returns:
- the only instance of RepositoryManager
-
addRepository
A new repository is added to the manager, except if :- it is null;
- the id is alreadey used for another configuration;
- the conditions are not verified.
launchRepository(String)- Parameters:
configuration- the Repository configuration to add to the manager- Returns:
- true if the repository was added, false otherwise
-
removeRepository
Stops, removes and returns the repository mapped to this id off from the manager.Returns null if no repository is mapped to this id.
- Parameters:
id- the id of the Repository- Returns:
- the repository that is no longer registered nor launched/running
-
getRepository
Gives the RepositoryConfiguration mapped with this id.- Parameters:
id- The id of the repository- Returns:
- RepositoryConfiguration mapped with this id, null if there is none
-
getRepositories
Gives the collection of RepositoryConfiguration registered in the manager.- Returns:
- the collection of repositories.
-
isLaunched
We store in memory the information that a repository is stored.- Parameters:
id- The id of the repository- Returns:
- true if there is a repository associated to this id and it is launched
-
launchRepository
Launch a repository if not.- Parameters:
id- The id of the repository- Returns:
- true if the repository is launched by the call to this method, false if it is already launched.
-
stopRepository
Stops the treatment if needed and checkout the AlarmEntry.- Parameters:
id- The id of the repository- Returns:
- true if the repository is not checked in.
-
executeNextScanAlarmNow
Execute now, in a specific thread (not in the current thread) the AlarmListener used to trigger directory scanning.- Parameters:
id- The id of the repository- Returns:
- true if the repository is not checked in.
-
executeNextPostponedAlarmNow
Execute now, in a specific thread (not in the current thread) the AlarmListener used to process postponed item. Execute now, in a specific thread (not in the current thread) the AlarmListener- Parameters:
id- The id of the repository- Returns:
- true if the repository is not checked in.
-
getNextScanDate
Returns the date of the next call to the AlarmListener scheduled for directory scanning- Parameters:
id- The id of the repository- Returns:
- the date of the next call to the scan of the repository.
-
getNextPostponedProcessingDate
Returns the date of the next call to the AlarmListener scheduled for postponed item processing.- Parameters:
id- The id of the repository- Returns:
- the date of the next call to the postponed items processing of the repository.
-