org.purl.sword.server
Class DummyServer
java.lang.Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DummyServer
public DummyServer()
doServiceDocument
public ServiceDocument doServiceDocument(ServiceDocumentRequest sdr)
throws SWORDAuthenticationException
- 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:
onBehalfOf - The user that the client is acting on behalf of
- Returns:
- The ServiceDocument representing the service document
- Throws:
SWORDAuthenticationException
doDeposit
public DepositResponse doDeposit(Deposit deposit)
throws SWORDAuthenticationException,
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
SWORDException - Thrown in an un-handalable Exception occurs.
This will be dealt with by sending a HTTP 500 Server Exception
Copyright © 2008 The DSpace Foundation. All Rights Reserved.