Package org.mycore.pi.urn
Class MCRCountingDNBURNGenerator
java.lang.Object
org.mycore.pi.MCRPIGenerator<MCRDNBURN>
org.mycore.pi.urn.MCRDNBURNGenerator
org.mycore.pi.urn.MCRCountingDNBURNGenerator
A Generator which helps to generate a URN with a counter inside.
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
Gets the count for a specific pattern and increase the internal counter.protected AtomicInteger
readCountFromDatabase
(String countPattern) Methods inherited from class org.mycore.pi.urn.MCRDNBURNGenerator
buildNISS, generate, generate, getNamespace
Methods inherited from class org.mycore.pi.MCRPIGenerator
checkPropertyExists, getGeneratorID, getProperties, init, setProperties
-
Method Details
-
readCountFromDatabase
-
getCount
Gets the count for a specific pattern and increase the internal counter. If there is no internal counter it will look into the Database and detect the highest count with the pattern.- Parameters:
pattern
- a reg exp pattern which will be used to detect the highest count. The first group is the count. e.G. [0-9]+-mods-2017-([0-9][0-9][0-9][0-9])-[0-9] will match 31-mods-2017-0003-3 and the returned count will be 4 (3+1).- Returns:
- the next count
-