GNDMS 0.6.0
RESTful verison of GNDMS
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes

de.zib.gndms.logic.model.dspace.SubspaceConfiguration Class Reference

The subspace configuration checks and accesses a ConfigHolder for a subspace, which has to consist (at least) of the following fields:
path - the path of the subspace as text
gsiFtpPath - the path for gsiFtp access as text
visible - whether the subspaces meta subspace is visible as boolean
size - the maximal size of the subspace as number
mode - an entry in SetupMode. More...

Inherits de::zib::gndms::common::logic::config::Configuration.

List of all members.

Public Member Functions

 SubspaceConfiguration (final String path, final String gsiFtpPath, final boolean visible, final long size, final SetupMode mode, final String subspace)
 Constructs a SubspaceConfiguration.
 SubspaceConfiguration (final String path, final String gsiFtpPath, final boolean visible, final long size, final String mode, final String subspace)
 Constructs a SubspaceConfiguration.
final boolean isValid ()
final String getStringRepresentation ()
final String getPath ()
 Returns the path of a subspace configuration.
final void setPath (final String path)
 Sets the path of a subspace configuration.
final String getGsiFtpPath ()
 Returns the gsi ftp path of a subspace configuration.
final void setGsiFtpPath (final String gsiFtpPath)
 Sets the gsi ftp path of a subspace configuration.
final boolean isVisible ()
 Returns the visibility of a subspace configuration.
final void setVisible (final boolean visible)
 Sets the visibility of a subspace configuration.
final long getSize ()
 Returns the size of a subspace configuration.
final void setSize (final long size)
 Sets the size of a subspace configuration.
final SetupMode getMode ()
 Returns the mode of a subspace configuration.
final void setMode (final SetupMode mode)
 Sets the mode of a subspace configuration.
final void setMode (final String mode)
 Sets the mode of a subspace configuration as String.
final String toString ()
final boolean equals (final Object obj)
final int hashCode ()
void setSubspace (String subspace)
String getSubspace ()

Static Public Member Functions

static SubspaceConfiguration checkSubspaceConfig (final Configuration config)
 Converts a Configuration into a SubspaceConfiguration, if possible, and returns it, if valid.
static SubspaceConfiguration getSubspaceConfiguration (Subspace subspace)
 Constructs the subspace configuration of a subspace.

Static Public Attributes

static final String PATH = "path"
 The key for the subspace's path.
static final String GSIFTPPATH = "gsiFtpPath"
 The key for the subspace's gsiftp-path.
static final String VISIBLE = "visible"
 The key for the subspace's visibility.
static final String SIZE = "size"
 The key for the subspace's total size.
static final String MODE = "mode"
 The key for the configuration's mode.

Private Attributes

String path
 The path of the subspace.
String gsiFtpPath
 The gsi ftp path of the subspace.
boolean visible
 The visibility of the subspace.
long size
 The size of the subspace.
SetupMode mode
 The setup mode of the subspace.
String subspace

Detailed Description

The subspace configuration checks and accesses a ConfigHolder for a subspace, which has to consist (at least) of the following fields:
path - the path of the subspace as text
gsiFtpPath - the path for gsiFtp access as text
visible - whether the subspaces meta subspace is visible as boolean
size - the maximal size of the subspace as number
mode - an entry in SetupMode.

Author:
Ulrike Golas

Constructor & Destructor Documentation

de.zib.gndms.logic.model.dspace.SubspaceConfiguration.SubspaceConfiguration ( final String  path,
final String  gsiFtpPath,
final boolean  visible,
final long  size,
final SetupMode  mode,
final String  subspace 
)

Constructs a SubspaceConfiguration.

Parameters:
pathThe path.
gsiFtpPathThe gsi ftp path.
visibleThe visibility.
sizethe size.
modeThe setup mode.
                                                                                                             {
                this.path = path;
                this.gsiFtpPath = gsiFtpPath;
                this.visible = visible;
                this.size = size;
                this.mode = mode;
        this.subspace = subspace;
        }
de.zib.gndms.logic.model.dspace.SubspaceConfiguration.SubspaceConfiguration ( final String  path,
final String  gsiFtpPath,
final boolean  visible,
final long  size,
final String  mode,
final String  subspace 
)

Constructs a SubspaceConfiguration.

Parameters:
pathThe path.
gsiFtpPathThe gsi ftp path.
visibleThe visibility.
sizethe size.
modeThe setup mode.
                                                                                                          {
                this.path = path;
                this.gsiFtpPath = gsiFtpPath;
                this.visible = visible;
                this.size = size;
                setMode(mode);
        setSubspace( subspace );
        }

Member Function Documentation

static SubspaceConfiguration de.zib.gndms.logic.model.dspace.SubspaceConfiguration.checkSubspaceConfig ( final Configuration  config) [static]

Converts a Configuration into a SubspaceConfiguration, if possible, and returns it, if valid.

Parameters:
configThe given configuration.
Returns:
The valid SubspaceConfiguration.
                                                                                            {
                try {
                        SubspaceConfiguration subspaceConfig = (SubspaceConfiguration) config;
                        if (subspaceConfig.isValid()) {
                                return subspaceConfig;
                        } else {
                                throw new WrongConfigurationException(
                                                "Wrong subspace configuration");
                        }
                } catch (ClassCastException e) {
                        throw new WrongConfigurationException(
                                        "Wrong subspace configuration");
                }
        }
final String de.zib.gndms.logic.model.dspace.SubspaceConfiguration.getGsiFtpPath ( )

Returns the gsi ftp path of a subspace configuration.

Returns:
the gsiFtpPath
                                            {
                return gsiFtpPath;
        }
final SetupMode de.zib.gndms.logic.model.dspace.SubspaceConfiguration.getMode ( )

Returns the mode of a subspace configuration.

Returns:
the mode
                                         {
                return mode;
        }
final String de.zib.gndms.logic.model.dspace.SubspaceConfiguration.getPath ( )

Returns the path of a subspace configuration.

Returns:
the path
                                      {
                return path;
        }
final long de.zib.gndms.logic.model.dspace.SubspaceConfiguration.getSize ( )

Returns the size of a subspace configuration.

Returns:
the size
                                    {
                return size;
        }
static SubspaceConfiguration de.zib.gndms.logic.model.dspace.SubspaceConfiguration.getSubspaceConfiguration ( Subspace  subspace) [static]

Constructs the subspace configuration of a subspace.

Parameters:
subspaceThe subspace.
Returns:
The configuration.
                                                                                    {
                return new SubspaceConfiguration(subspace.getPath(), subspace.getGsiFtpPath(), subspace.isVisibleToPublic(), subspace.getTotalSize(), "READ", subspace.getId());
        }
final boolean de.zib.gndms.logic.model.dspace.SubspaceConfiguration.isVisible ( )

Returns the visibility of a subspace configuration.

Returns:
the visible
                                         {
                return visible;
        }
final void de.zib.gndms.logic.model.dspace.SubspaceConfiguration.setGsiFtpPath ( final String  gsiFtpPath)

Sets the gsi ftp path of a subspace configuration.

Parameters:
gsiFtpPaththe gsiFtpPath to set
                                                                 {
                this.gsiFtpPath = gsiFtpPath;
        }
final void de.zib.gndms.logic.model.dspace.SubspaceConfiguration.setMode ( final SetupMode  mode)

Sets the mode of a subspace configuration.

Parameters:
modethe mode to set
                                                        {
                this.mode = mode;
        }
final void de.zib.gndms.logic.model.dspace.SubspaceConfiguration.setMode ( final String  mode)

Sets the mode of a subspace configuration as String.

Parameters:
modethe mode to set
                                                     {
                try {
                        this.mode = SetupMode.valueOf(mode);
                } catch (IllegalArgumentException e) {
                        throw new WrongConfigurationException(mode + " is no valid setup mode.");
                } catch (NullPointerException e) {
                        throw new WrongConfigurationException("Mode is null.");
                }
        }
final void de.zib.gndms.logic.model.dspace.SubspaceConfiguration.setPath ( final String  path)

Sets the path of a subspace configuration.

Parameters:
paththe path to set
                                                     {
                this.path = path;
        }
final void de.zib.gndms.logic.model.dspace.SubspaceConfiguration.setSize ( final long  size)

Sets the size of a subspace configuration.

Parameters:
sizethe size to set
                                                   {
                this.size = size;
        }
final void de.zib.gndms.logic.model.dspace.SubspaceConfiguration.setVisible ( final boolean  visible)

Sets the visibility of a subspace configuration.

Parameters:
visiblethe visible to set
                                                            {
                this.visible = visible;
        }

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables