org.nbnResolving.common
Class DnbUrnValidator

java.lang.Object
  extended by org.nbnResolving.common.Rfc3188Validator
      extended by org.nbnResolving.common.DnbUrnValidator

public class DnbUrnValidator
extends Rfc3188Validator

Class extending the validation of an URN from RFC level to the German National Library URN policy level (more strict). "http://urn.dnb.de"

Author:
Kadir Karaca Kocer

Field Summary
static int CHECKSUM_NOT_A_NUMBER
          Checksum must be a number
static int INVALID_CHECKSUM
          Wrong checksum
static int MAX_NAMESPACE_LENGTH
          Max NAMESPACE length
static int MAX_UNIQUE_PART_LENGTH
          Max UNIQUE PART length
static int MAX_URN_LENGTH
          Max URN length
static int MIN_URN_LENGTH
          Min URN length
static int NAMESPACE_TOO_LONG
          Namespace must be shorter than 52 characters
static int NO_SEPERATOR
          Parts of an URN must be separated by a - character
static int UNIQUE_PART_TOO_LONG
          Unique ID part can be max 200 characters + checksum digit
static int UNKNOWN_NAMESPACE
          Namespace not registered
static int URN_TOO_LONG
          URNs must be shorter than 254 characters
static int URN_TOO_SHORT
          URNs must be longer than 15 characters
 
Fields inherited from class org.nbnResolving.common.Rfc3188Validator
BAD_COUNTRY_CODE, EMPTY_NBN_STRING, EMPTY_SUBNAMESPACE, INVALID_CHAR_NBN, INVALID_CHAR_NID, iso3106Codes, MUST_START_WITH_URN, NID_TOO_SHORT, NOT_A_NBN, NOT_TWO_DIGIT_CODE, PART_COUNT_TOO_LOW, URN_EQUALS_NULL, URN_IS_EMPTY, URN_IS_VALID, VALID_CHARS
 
Constructor Summary
DnbUrnValidator()
           
 
Method Summary
static int validateUrn(String urn)
          Validates if the given URN is compliant German National Library URN policy.
 
Methods inherited from class org.nbnResolving.common.Rfc3188Validator
charsValid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_URN_LENGTH

public static final int MIN_URN_LENGTH
Min URN length

See Also:
Constant Field Values

MAX_URN_LENGTH

public static final int MAX_URN_LENGTH
Max URN length

See Also:
Constant Field Values

MAX_NAMESPACE_LENGTH

public static final int MAX_NAMESPACE_LENGTH
Max NAMESPACE length

See Also:
Constant Field Values

MAX_UNIQUE_PART_LENGTH

public static final int MAX_UNIQUE_PART_LENGTH
Max UNIQUE PART length

See Also:
Constant Field Values

URN_TOO_SHORT

public static final int URN_TOO_SHORT
URNs must be longer than 15 characters

See Also:
Constant Field Values

URN_TOO_LONG

public static final int URN_TOO_LONG
URNs must be shorter than 254 characters

See Also:
Constant Field Values

NO_SEPERATOR

public static final int NO_SEPERATOR
Parts of an URN must be separated by a - character

See Also:
Constant Field Values

NAMESPACE_TOO_LONG

public static final int NAMESPACE_TOO_LONG
Namespace must be shorter than 52 characters

See Also:
Constant Field Values

UNIQUE_PART_TOO_LONG

public static final int UNIQUE_PART_TOO_LONG
Unique ID part can be max 200 characters + checksum digit

See Also:
Constant Field Values

CHECKSUM_NOT_A_NUMBER

public static final int CHECKSUM_NOT_A_NUMBER
Checksum must be a number

See Also:
Constant Field Values

INVALID_CHECKSUM

public static final int INVALID_CHECKSUM
Wrong checksum

See Also:
Constant Field Values

UNKNOWN_NAMESPACE

public static final int UNKNOWN_NAMESPACE
Namespace not registered

See Also:
Constant Field Values
Constructor Detail

DnbUrnValidator

public DnbUrnValidator()
Method Detail

validateUrn

public static int validateUrn(String urn)
Validates if the given URN is compliant German National Library URN policy.

Parameters:
urn - A National Bibliography Number as Uniform Resource Name according to RFC 3188.
Returns:
0 for a valid URN. An integer in case of a violation against RFC 3188 or German National Library URN:NBN Policy. See the predefined constants.


Copyright © 2013 Deutsche Nationalbibliothek / German National Library. All Rights Reserved.