se.kb.oai.pmh
Class ErrorResponseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by se.kb.oai.OAIException
              extended by se.kb.oai.pmh.ErrorResponseException
All Implemented Interfaces:
Serializable

public class ErrorResponseException
extends OAIException

Exception that is thrown when the response from the OAI-PMH server has <error> elements in it. There are eight different error codes that can be returned:

Author:
Oskar Grenholm, National Library of Sweden
See Also:
Serialized Form

Field Summary
static String BAD_ARGUMENT
           
static String BAD_RESUMPTION_TOKEN
           
static String BAD_VERB
           
static String CANNOT_DISSEMINATE_FORMAT
           
static String ID_DOES_NOT_EXIST
           
static String NO_METADATA_FORMATS
           
static String NO_RECORDS_MATCH
           
static String NO_SET_HIERARCHY
           
 
Constructor Summary
ErrorResponseException(Element error)
          Creates an ErrorResponseException with the returned error code and error message.
 
Method Summary
 String getCode()
          Get the error code.
 String getMessage()
          Get the error message.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BAD_ARGUMENT

public static final String BAD_ARGUMENT
See Also:
Constant Field Values

BAD_RESUMPTION_TOKEN

public static final String BAD_RESUMPTION_TOKEN
See Also:
Constant Field Values

BAD_VERB

public static final String BAD_VERB
See Also:
Constant Field Values

CANNOT_DISSEMINATE_FORMAT

public static final String CANNOT_DISSEMINATE_FORMAT
See Also:
Constant Field Values

ID_DOES_NOT_EXIST

public static final String ID_DOES_NOT_EXIST
See Also:
Constant Field Values

NO_RECORDS_MATCH

public static final String NO_RECORDS_MATCH
See Also:
Constant Field Values

NO_METADATA_FORMATS

public static final String NO_METADATA_FORMATS
See Also:
Constant Field Values

NO_SET_HIERARCHY

public static final String NO_SET_HIERARCHY
See Also:
Constant Field Values
Constructor Detail

ErrorResponseException

public ErrorResponseException(Element error)
Creates an ErrorResponseException with the returned error code and error message.

Parameters:
error - the <error> element
Method Detail

getCode

public String getCode()
Get the error code.

Returns:
the error code

getMessage

public String getMessage()
Get the error message.

Overrides:
getMessage in class Throwable
Returns:
the error message


Copyright © 2008. All Rights Reserved.