org.purl.sword.server
Class DummyServer

java.lang.Object
  extended by org.purl.sword.server.DummyServer
All Implemented Interfaces:
SWORDServer

public class DummyServer
extends Object
implements SWORDServer

A 'dummy server' which acts as dumb repository which implements the SWORD ServerInterface. It accepts any type of deposit, and tries to return appropriate responses. It supports authentication: if the username and password match (case sensitive) it authenticates the user, if not, the authentication fails.

Author:
Stuart Lewis

Constructor Summary
DummyServer()
           
 
Method Summary
 AtomDocumentResponse doAtomDocument(AtomDocumentRequest adr)
          Answer a request for an entry document
 DepositResponse doDeposit(Deposit deposit)
          Answer a SWORD deposit
 ServiceDocument doServiceDocument(ServiceDocumentRequest sdr)
          Provides a dumb but plausible service document - it contains an anonymous workspace and collection, and one personalised for the onBehalfOf user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyServer

public DummyServer()
Method Detail

doServiceDocument

public ServiceDocument doServiceDocument(ServiceDocumentRequest sdr)
                                  throws SWORDAuthenticationException,
                                         SWORDErrorException,
                                         SWORDException
Provides a dumb but plausible service document - it contains an anonymous workspace and collection, and one personalised for the onBehalfOf user.

Specified by:
doServiceDocument in interface SWORDServer
Parameters:
sdr - The request
Returns:
The ServiceDocument representing the service document
Throws:
SWORDAuthenticationException - If the credentials are bad
SWORDErrorException - If something goes wrong, such as
SWORDException - Thrown in an un-handalable Exception occurs. This will be dealt with by sending a HTTP 500 Server Exception

doDeposit

public DepositResponse doDeposit(Deposit deposit)
                          throws SWORDAuthenticationException,
                                 SWORDErrorException,
                                 SWORDException
Description copied from interface: SWORDServer
Answer a SWORD deposit

Specified by:
doDeposit in interface SWORDServer
Parameters:
deposit - The Deposit object
Returns:
The response to the deposit
Throws:
SWORDAuthenticationException - Thrown if the authentication fails
SWORDErrorException - Thrown if there was an error with the input not matching the capabilities of the server
SWORDException - Thrown if an un-handalable Exception occurs. This will be dealt with by sending a HTTP 500 Server Exception

doAtomDocument

public AtomDocumentResponse doAtomDocument(AtomDocumentRequest adr)
                                    throws SWORDAuthenticationException,
                                           SWORDErrorException,
                                           SWORDException
Description copied from interface: SWORDServer
Answer a request for an entry document

Specified by:
doAtomDocument in interface SWORDServer
Parameters:
adr - The Atom Document Request object
Returns:
The response to the atom document request
Throws:
SWORDAuthenticationException - Thrown if the authentication fails
SWORDErrorException - Thrown if there was an error with the input not matching the capabilities of the server
SWORDException - Thrown if an un-handalable Exception occurs. This will be dealt with by sending a HTTP 500 Server Exception


Copyright © 2013 DuraSpace. All Rights Reserved.