Package org.ametys.cms.helper
Class AmetysIdentifiers
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.helper.AmetysIdentifiers
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
Component for identifiers based on an incremental counter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
readCounter
(String categoryName, String counterName) Read counter value for a given category and countervoid
saveCounter
(String categoryName, String counterName, long counter) Save counter value for a given category and countervoid
service
(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The Avalon role
-
-
Constructor Details
-
AmetysIdentifiers
public AmetysIdentifiers()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
readCounter
Read counter value for a given category and counter- Parameters:
categoryName
- The plugin namecounterName
- The counter name- Returns:
- the counter value or 0 if no counter found
- Throws:
AmetysRepositoryException
- if failed to get counter
-
saveCounter
public void saveCounter(String categoryName, String counterName, long counter) throws AmetysRepositoryException Save counter value for a given category and counter- Parameters:
categoryName
- The plugin namecounterName
- The counter namecounter
- the counter value- Throws:
AmetysRepositoryException
- if failed to save counter
-