org.purl.sword.base
Class Service

java.lang.Object
  extended by org.purl.sword.base.XmlElement
      extended by org.purl.sword.base.Service
All Implemented Interfaces:
SwordElementInterface

public class Service
extends XmlElement
implements SwordElementInterface

Represents an Atom Publishing Protocol Service element, with SWORD extensions.

Author:
Neil Taylor

Field Summary
static String ELEMENT_GENERATOR
          Deprecated. 
static String ELEMENT_NAME
          Deprecated. 
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, DATE_FORMATS, xmlName
 
Constructor Summary
Service()
          Create a new instance.
Service(String version)
          Create a new instance.
Service(String version, boolean noOp, boolean verbose)
          Create a new instance with the specified compliance level, noOp and verbose values.
 
Method Summary
 void addWorkspace(Workspace workspace)
          Add a workspace.
 void clearWorkspaces()
          Clear the list of workspaces.
static XmlName elementName()
           
 Generator getGenerator()
           
 int getMaxUploadSize()
          Get the maximum upload file size (in kB)
 String getVersion()
          Get the SWORD version.
 Iterator<Workspace> getWorkspaces()
          Get an Iterator over the workspaces.
 List<Workspace> getWorkspacesList()
          Get a List of workspaces
 boolean isNoOp()
          Get the NoOp value.
 boolean isNoOpSet()
          Determine if the NoOp value has been set.
 boolean isVerbose()
          Get the Verbose setting.
 boolean isVerboseSet()
          Determine if the Verbose value has been set.
 nu.xom.Element marshall()
          Marshall the data in this object to an Element object.
 void setGenerator(Generator generator)
           
 void setMaxUploadSize(int maxUploadSize)
          Set the maximum file upload size in kB
 void setNoOp(boolean noOp)
          Set the NoOp value.
 void setVerbose(boolean verbose)
          Set the Verbose value.
 void setVersion(String version)
          Set the SWORD version.
 void unmarshall(nu.xom.Element service)
          Unmarshall the content element into the data in this object.
 SwordValidationInfo unmarshall(nu.xom.Element service, Properties validationProperties)
           
protected  SwordValidationInfo validate(ArrayList<SwordValidationInfo> existing, Properties validationContext)
           
 SwordValidationInfo validate(Properties validationContext)
           
 
Methods inherited from class org.purl.sword.base.XmlElement
createValidAttributeInfo, getQualifiedName, getQualifiedName, getQualifiedNameWithPrefix, getXmlName, handleIncorrectElement, isInstanceOf, isInstanceOf, processUnexpectedAttributes, processUnexpectedAttributes, unmarshallBoolean, unmarshallInteger, unmarshallString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_GENERATOR

@Deprecated
public static final String ELEMENT_GENERATOR
Deprecated. 
MaxUploadSize

See Also:
Constant Field Values

ELEMENT_NAME

@Deprecated
public static final String ELEMENT_NAME
Deprecated. 
Name for this element.

See Also:
Constant Field Values
Constructor Detail

Service

public Service()
Create a new instance.


Service

public Service(String version)
Create a new instance.

Parameters:
complianceLevel - The service compliance level.

Service

public Service(String version,
               boolean noOp,
               boolean verbose)
Create a new instance with the specified compliance level, noOp and verbose values.

Parameters:
complianceLevel - The service compliance level.
noOp - The noOp.
verbose - The verbose element.
Method Detail

elementName

public static XmlName elementName()

getVersion

public String getVersion()
Get the SWORD version.

Returns:
The version.

setVersion

public void setVersion(String version)
Set the SWORD version.

Parameters:
version - The version.

isNoOp

public boolean isNoOp()
Get the NoOp value.

Returns:
The value.

setNoOp

public void setNoOp(boolean noOp)
Set the NoOp value.

Parameters:
noOp - The value.

isNoOpSet

public boolean isNoOpSet()
Determine if the NoOp value has been set. This should be called to check if an item has been programatically set and does not have a default value.

Returns:
True if it has been set programmatically. Otherwise, false.

isVerbose

public boolean isVerbose()
Get the Verbose setting.

Returns:
The value.

setVerbose

public void setVerbose(boolean verbose)
Set the Verbose value.

Parameters:
verbose - The value.

isVerboseSet

public boolean isVerboseSet()
Determine if the Verbose value has been set. This should be called to check if an item has been programatically set and does not have a default value.

Returns:
True if it has been set programmatically. Otherwise, false.

setMaxUploadSize

public void setMaxUploadSize(int maxUploadSize)
Set the maximum file upload size in kB

Parameters:
maxUploadSize - Max upload file size in kB

getMaxUploadSize

public int getMaxUploadSize()
Get the maximum upload file size (in kB)

Returns:
the maximum file upload size. If no value has been set, this will be equal to Integer.MIN_VALUE.

getGenerator

public Generator getGenerator()

setGenerator

public void setGenerator(Generator generator)

getWorkspaces

public Iterator<Workspace> getWorkspaces()
Get an Iterator over the workspaces.

Returns:
The workspace.

getWorkspacesList

public List<Workspace> getWorkspacesList()
Get a List of workspaces

Returns:
The workspaces in a List

addWorkspace

public void addWorkspace(Workspace workspace)
Add a workspace.

Parameters:
workspace - The workspace.

clearWorkspaces

public void clearWorkspaces()
Clear the list of workspaces.


marshall

public nu.xom.Element marshall()
Marshall the data in this object to an Element object.

Specified by:
marshall in interface SwordElementInterface
Returns:
A XOM Element that holds the data for this Content element.

unmarshall

public void unmarshall(nu.xom.Element service)
                throws UnmarshallException
Unmarshall the content element into the data in this object.

Specified by:
unmarshall in interface SwordElementInterface
Parameters:
service - The data to unmarshall.
Throws:
UnmarshallException - If the element does not contain a content element or if there are problems accessing the data.

unmarshall

public SwordValidationInfo unmarshall(nu.xom.Element service,
                                      Properties validationProperties)
                               throws UnmarshallException
Parameters:
service -
validate -
Returns:
Throws:
UnmarshallException

validate

public SwordValidationInfo validate(Properties validationContext)
Specified by:
validate in class XmlElement

validate

protected SwordValidationInfo validate(ArrayList<SwordValidationInfo> existing,
                                       Properties validationContext)
Parameters:
existing -
Returns:


Copyright © 2009 The DSpace Foundation. All Rights Reserved.