Interface SWORDClient

All Known Implementing Classes:
Client

public interface SWORDClient
Interface for any SWORD client implementation.
  • Method Details

    • setServer

      void setServer(String server, int port)
      Set the server that is to be contacted on the next access.
      Parameters:
      server - The name of the server, e.g. www.aber.ac.uk
      port - The port number, e.g. 80.
    • setCredentials

      void setCredentials(String username, String password)
      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

      void setProxy(String host, int port)
      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

      ServiceDocument getServiceDocument(String url) throws SWORDClientException
      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

      ServiceDocument getServiceDocument(String url, String onBehalfOf) throws SWORDClientException
      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.