org.pfsw.db.util
Interface MultiCategoryIdentifierGenerator

All Known Implementing Classes:
DefaultMultiCategoryIdentifierGenerator

public interface MultiCategoryIdentifierGenerator

An ID generator that supports different ID sequences for different categories.


Method Summary
 java.lang.String newIdentifier(java.lang.String category)
          Returns a new identifier for the given category.
 long nextIdentifier(java.lang.String category)
          Returns a new identifier which is different to the last one for the given category.
 

Method Detail

newIdentifier

java.lang.String newIdentifier(java.lang.String category)
Returns a new identifier for the given category.

Parameters:
category - An arbitrary but unique name for the ID sequence (must not be null).
Throws:
org.pfsw.bif.identifier.IdentifierGenerationException - if the category cannot be found of ID generation fails for any reason.

nextIdentifier

long nextIdentifier(java.lang.String category)
Returns a new identifier which is different to the last one for the given category.

Parameters:
category - An arbitrary but unique name for the ID sequence (must not be null).
Returns:
The next ID value.
Throws:
org.pfsw.bif.identifier.IdentifierGenerationException - if the category cannot be found of ID generation fails for any reason.