Package org.purl.sword.client
Interface SWORDClient
- All Known Implementing Classes:
Client
public interface SWORDClient
Interface for any SWORD client implementation.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the credentials settings on the client.getServiceDocument
(String url) Get a service document, specified in the URL.getServiceDocument
(String url, String onBehalfOf) Get a service document, specified in the URL.Get the status result returned from the most recent network test.postFile
(PostMessage message) Post a file to the specified destination URL.void
setCredentials
(String username, String password) Set the user credentials that are to be used for subsequent accesses.void
Set the proxy that is to be used for subsequent accesses.void
Set the server that is to be contacted on the next access.
-
Method Details
-
setServer
Set the server that is to be contacted on the next access.- Parameters:
server
- The name of the server, e.g. www.aber.ac.ukport
- The port number, e.g. 80.
-
setCredentials
Set the user credentials that are to be used for subsequent accesses.- Parameters:
username
- The username.password
- The password.
-
clearCredentials
void clearCredentials()Clear the credentials settings on the client. -
setProxy
Set the proxy that is to be used for subsequent accesses.- Parameters:
host
- The host name, e.g. cache.host.com.port
- The port, e.g. 8080.
-
getStatus
Status getStatus()Get the status result returned from the most recent network test.- Returns:
- The status code and message.
-
getServiceDocument
Get a service document, specified in the URL.- Parameters:
url
- The URL to connect to.- Returns:
- A ServiceDocument that contains the Service details that were obained from the specified URL.
- Throws:
SWORDClientException
- If there is an error accessing the URL.
-
getServiceDocument
Get a service document, specified in the URL. The document is accessed on behalf of the specified user.- Parameters:
url
- The URL to connect to.onBehalfOf
- The username for the onBehalfOf access.- Returns:
- A ServiceDocument that contains the Service details that were obtained from the specified URL.
- Throws:
SWORDClientException
- If there is an error accessing the URL.
-
postFile
Post a file to the specified destination URL.- Parameters:
message
- The message that defines the requirements for the operation.- Returns:
- A DespoitResponse if the response is successful. If there was an error,
null
should be returned. - Throws:
SWORDClientException
- If there is an error accessing the URL.
-