org.dspace.sword
Class SWORDConfiguration

java.lang.Object
  extended by org.dspace.sword.SWORDConfiguration

public class SWORDConfiguration
extends Object

Author:
Richard Jones Class to represent the principal configurations of the sword service being offered. Not all configuration is available through this class, but the most useful common options, and those with default values are available Note that changes to values via the api will not be persisted between sword requests. For detailed descriptions of configuration values, see the sword configuration documentation

Field Summary
static org.apache.log4j.Logger log
          logger
 
Constructor Summary
SWORDConfiguration()
          Initialise the sword configuration.
 
Method Summary
 Map<String,Float> getAcceptPackaging(Collection col)
          Get a map of packaging URIs to Q values for the packaging types which the given collection will accept.
 List<String> getAccepts(Context context, DSpaceObject dso)
          Get the list of mime types that the given dspace object will accept as packages
 List<String> getCollectionAccepts()
          Get the list of mime types that a Collection will accept as packages
 String getFailedPackageDir()
          directory location of the files with original packages for failed ingests
 int getMaxUploadSize()
          what is the max upload size (in bytes) for the sword interface
 String getSwordBundle()
          Get the bundle name that sword will store its original deposit packages in, when storing them inside an item
 String getTempDir()
          Get the temp directory for storing files during deposit
 boolean isAcceptableContentType(Context context, String type, DSpaceObject dso)
          is the given content mimetype acceptable to the given dspace object
 boolean isKeepOriginal()
          should the repository keep the original package
 boolean isKeepPackageOnFailedIngest()
          should the repository write file of the original package if ingest fails
 boolean isMediated()
          does the server support mediated deposit (aka on-behalf-of)
 boolean isNoOp()
          is this a no-op deposit
 boolean isSupportedMediaType(String mediaType, DSpaceObject dso)
          is the given packaging/media type supported by the given dspace object
 boolean isVerbose()
          is this a verbose deposit
 void setFailedPackageDir(String dir)
          set the directory to write file of the original package
 void setKeepOriginal(boolean keepOriginal)
          set whether the repository should keep copies of the original package
 void setKeepPackageOnFailedIngest(boolean keepOriginalOnFail)
          set whether the repository should write file of the original package if ingest fails
 void setMaxUploadSize(int maxUploadSize)
          set the max uplaod size (in bytes) for the sword interface
 void setMediated(boolean mediated)
          set whether the server supports mediated deposit (aka on-behalf-of)
 void setNoOp(boolean noOp)
          set whether this is a no-op deposit
 void setSwordBundle(String swordBundle)
          Set the bundle name that sword will store its original deposit packages in, when storing them inside an item
 void setVerbose(boolean verbose)
          set whether this is a verbose deposit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
logger

Constructor Detail

SWORDConfiguration

public SWORDConfiguration()
Initialise the sword configuration. It is at this stage that the object will interrogate the DSpace Configuration for details

Method Detail

getSwordBundle

public String getSwordBundle()
Get the bundle name that sword will store its original deposit packages in, when storing them inside an item

Returns:

setSwordBundle

public void setSwordBundle(String swordBundle)
Set the bundle name that sword will store its original deposit packages in, when storing them inside an item

Parameters:
swordBundle -

isNoOp

public boolean isNoOp()
is this a no-op deposit

Returns:

setNoOp

public void setNoOp(boolean noOp)
set whether this is a no-op deposit

Parameters:
noOp -

isVerbose

public boolean isVerbose()
is this a verbose deposit

Returns:

setVerbose

public void setVerbose(boolean verbose)
set whether this is a verbose deposit

Parameters:
verbose -

getMaxUploadSize

public int getMaxUploadSize()
what is the max upload size (in bytes) for the sword interface

Returns:

setMaxUploadSize

public void setMaxUploadSize(int maxUploadSize)
set the max uplaod size (in bytes) for the sword interface

Parameters:
maxUploadSize -

isMediated

public boolean isMediated()
does the server support mediated deposit (aka on-behalf-of)

Returns:

setMediated

public void setMediated(boolean mediated)
set whether the server supports mediated deposit (aka on-behalf-of)

Parameters:
mediated -

isKeepOriginal

public boolean isKeepOriginal()
should the repository keep the original package

Returns:

setKeepOriginal

public void setKeepOriginal(boolean keepOriginal)
set whether the repository should keep copies of the original package

Parameters:
keepOriginal -

setKeepPackageOnFailedIngest

public void setKeepPackageOnFailedIngest(boolean keepOriginalOnFail)
set whether the repository should write file of the original package if ingest fails

Parameters:
keepOriginalOnFail -

isKeepPackageOnFailedIngest

public boolean isKeepPackageOnFailedIngest()
should the repository write file of the original package if ingest fails

Returns:
keepPackageOnFailedIngest

setFailedPackageDir

public void setFailedPackageDir(String dir)
set the directory to write file of the original package

Parameters:
dir -

getFailedPackageDir

public String getFailedPackageDir()
directory location of the files with original packages for failed ingests

Returns:
failedPackageDir

getAccepts

public List<String> getAccepts(Context context,
                               DSpaceObject dso)
                        throws DSpaceSWORDException
Get the list of mime types that the given dspace object will accept as packages

Parameters:
context -
dso -
Returns:
Throws:
DSpaceSWORDException

getCollectionAccepts

public List<String> getCollectionAccepts()
                                  throws DSpaceSWORDException
Get the list of mime types that a Collection will accept as packages

Returns:
the list of mime types
Throws:
DSpaceSWORDException

getAcceptPackaging

public Map<String,Float> getAcceptPackaging(Collection col)
Get a map of packaging URIs to Q values for the packaging types which the given collection will accept. The URI should be a unique identifier for the packaging type, such as: http://purl.org/net/sword-types/METSDSpaceSIP and the Q value is a floating point between 0 and 1 which defines how much the server "likes" this packaging type

Parameters:
col -
Returns:

isSupportedMediaType

public boolean isSupportedMediaType(String mediaType,
                                    DSpaceObject dso)
                             throws DSpaceSWORDException,
                                    SWORDErrorException
is the given packaging/media type supported by the given dspace object

Parameters:
mediaType -
dso -
Returns:
Throws:
DSpaceSWORDException
SWORDErrorException

isAcceptableContentType

public boolean isAcceptableContentType(Context context,
                                       String type,
                                       DSpaceObject dso)
                                throws DSpaceSWORDException
is the given content mimetype acceptable to the given dspace object

Parameters:
context -
type -
dso -
Returns:
Throws:
DSpaceSWORDException

getTempDir

public String getTempDir()
                  throws DSpaceSWORDException
Get the temp directory for storing files during deposit

Returns:
Throws:
DSpaceSWORDException


Copyright © 2013 DuraSpace. All Rights Reserved.