Project

General

Profile

« Previous | Next » 

Revision d26709a1

Added by Andreas Kohlbecker over 6 years ago

ref #7137 improvements to the RegistrationIdentifierMinter:

  • addin getters
  • logging a warning when configuration incomplete

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/idminter/IdentifierMinter.java
17 17

  
18 18
    public class Identifier<T>{
19 19
        T localId;
20

  
20 21
        String identifier;
22
        /**
23
         * @return the localId
24
         */
25
        public T getLocalId() {
26
            return localId;
27
        }
28
        /**
29
         * @return the identifier
30
         */
31
        public String getIdentifier() {
32
            return identifier;
33
        }
34

  
35

  
21 36
    }
22 37

  
23 38
    public void setMinLocalId(T min);
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/idminter/RegistrationIdentifierMinter.java
8 8
*/
9 9
package eu.etaxonomy.cdm.api.service.idminter;
10 10

  
11
import org.apache.log4j.Logger;
11 12
import org.hibernate.Query;
12 13
import org.hibernate.SessionFactory;
13 14
import org.hibernate.StatelessSession;
......
20 21
 */
21 22
public class RegistrationIdentifierMinter implements IdentifierMinter<String> {
22 23

  
24
    private static final Logger logger = Logger.getLogger(RegistrationIdentifierMinter.class);
25

  
23 26
    enum Method {
24 27
        naturalNumberIncrement
25 28
    }
......
60 63
    @Override
61 64
    synchronized public Identifier<String> mint() throws OutOfIdentifiersException {
62 65

  
66
        if(identifierFormatString == null){
67
            logger.warn("identifierFormatString missing");
68
        }
69

  
63 70
        switch(method){
64 71
            case naturalNumberIncrement:
65 72
                return mintByNaturalNumberIncrement();

Also available in: Unified diff