org.purl.sword.base
Class ServiceDocument

java.lang.Object
  extended by org.purl.sword.base.ServiceDocument

public class ServiceDocument
extends Object

A representation of a SWORD Service Document. http://www.ukoln.ac.uk/repositories/digirep/index/SWORD_APP_Profile_0.5

Author:
Stuart Lewis, Neil Taylor

Constructor Summary
ServiceDocument()
          Create a new instance and set the initial service level to Zero.
ServiceDocument(Service service)
          Create a new instance and store the specified Service document.
ServiceDocument(ServiceLevel complianceLevel)
          Create a new instance and set the specified service level.
ServiceDocument(ServiceLevel complianceLevel, boolean noOp, boolean verbose, String workspaceTitle, Collection workspaceCollections)
          Deprecated. Please use the other constructors.
 
Method Summary
 void addWorkspace(Workspace workspace)
          Deprecated. Please access the value directly from the service.
 ServiceLevel getComplianceLevel()
          Deprecated. Please access the compliance level directly from the service.
 Service getService()
          Retrieve the Service object associated with this document.
 Iterator<Collection> getWorkspaceCollections()
          Deprecated. Please access the value directly from the service.
 Iterator<Workspace> getWorkspaces()
          Deprecated. Please access the value directly from the service.
 String marshall()
          Marshall the data in the Service element and generate a String representation.
 void setNoOp(boolean noOp)
          Deprecated. Please access the value directly from the service.
 void setService(Service service)
          Set the service object associated with this document.
 void setVerbose(boolean verbose)
          Deprecated. Please access the value directly from the service.
 boolean supportsNoOp()
          Deprecated. Please access the value directly from the service.
 boolean supportsVerbose()
          Deprecated. Please access the value directly from the service.
 String toString()
          Return the Service Document in it's XML form.
 void unmarshall(String xml)
          Convert the specified XML string into a set of objects used within the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceDocument

public ServiceDocument()
Create a new instance and set the initial service level to Zero.


ServiceDocument

public ServiceDocument(ServiceLevel complianceLevel)
Create a new instance and set the specified service level.

Parameters:
complianceLevel - The service compliance level.

ServiceDocument

public ServiceDocument(Service service)
Create a new instance and store the specified Service document.

Parameters:
service - The Service object.

ServiceDocument

public ServiceDocument(ServiceLevel complianceLevel,
                       boolean noOp,
                       boolean verbose,
                       String workspaceTitle,
                       Collection workspaceCollections)
Deprecated. Please use the other constructors.

Instantiate a ServiceDocument

Parameters:
complianceLevel - The compliance level of this implementation
noOp - Whether or not the NOOP option is available
verbose - Whether or not the verbose option is available
workspaceTitle - The name of the workspace title
workspaceCollections - A Collection of workspaces
Method Detail

getComplianceLevel

public ServiceLevel getComplianceLevel()
Deprecated. Please access the compliance level directly from the service.

Get the compliance level from this Service Document

Returns:
The compliance level

supportsNoOp

public boolean supportsNoOp()
Deprecated. Please access the value directly from the service.

Returns a boolean depending on whether or not the Service Document says the server supports the NOOP option

Returns:
The NOOP option status

setNoOp

public void setNoOp(boolean noOp)
Deprecated. Please access the value directly from the service.

Parameters:
noOp -

supportsVerbose

public boolean supportsVerbose()
Deprecated. Please access the value directly from the service.

Returns a boolean depending on whether or not the Service Document says the server supports the verbose option

Returns:
The verbose option status

setVerbose

public void setVerbose(boolean verbose)
Deprecated. Please access the value directly from the service.

Parameters:
verbose -

getWorkspaceCollections

public Iterator<Collection> getWorkspaceCollections()
Deprecated. Please access the value directly from the service.

Returns the Collectinos in the workspace described by the Service Document

Returns:
The workspaces

getWorkspaces

public Iterator<Workspace> getWorkspaces()
Deprecated. Please access the value directly from the service.


addWorkspace

public void addWorkspace(Workspace workspace)
Deprecated. Please access the value directly from the service.

Parameters:
workspace -

setService

public void setService(Service service)
Set the service object associated with this document.

Parameters:
service - The new Service object.

getService

public Service getService()
Retrieve the Service object associated with this document.

Returns:
The Service object.

toString

public String toString()
Return the Service Document in it's XML form.

Overrides:
toString in class Object
Returns:
The ServiceDocument

marshall

public String marshall()
Marshall the data in the Service element and generate a String representation. The returned string is UTF-8 format.

Returns:
A string of XML, or null if there was an error marshalling the data.

unmarshall

public void unmarshall(String xml)
                throws UnmarshallException
Convert the specified XML string into a set of objects used within the service. A new Service object will be created and stored. This will dispose of any previous Service object associated with this object.

Parameters:
xml - The XML string.
Throws:
UnmarshallException - If there was a problem unmarshalling the data. This might be as a result of an error in parsing the XML string, extracting information.


Copyright © 2008 The DSpace Foundation. All Rights Reserved.