org.palo.api.subsets
Interface SubsetHandler

All Known Implementing Classes:
SubsetHandlerImpl

public interface SubsetHandler

SubsetHandler

This interface defines all methods to handle Subset2 related functionalities.

Version:
$Id: SubsetHandler.html,v 1.5 2009/07/09 11:01:46 ArndHouben Exp $

Method Summary
 Subset2 addSubset(java.lang.String name, int type)
          Adds a new Subset2 with the given name and type to this hierarchy
 boolean canRead(int type)
          Checks if the user is allowed to read subsets of given type
 boolean canWrite(int type)
          Checks if the user is allowed to write subsets of given type
 Dimension getDimension()
          Deprecated. use getHierarchy() instead.
 Hierarchy getHierarchy()
          Returns the Hierarchy to which this SubsetHandler is registered.
 Subset2 getSubset(java.lang.String id, int type)
          Returns the Subset2 instance which is registered with the given id and for the given type or null if no subset with this id could be found or new subsets are not supported
 java.lang.String getSubsetId(java.lang.String name, int type)
          Checks if a subset with the given name and type already exists for this hierarchy and returns its id.
 java.lang.String[] getSubsetIDs()
          Returns the IDs of all locally and globally registered Subset2s
 java.lang.String[] getSubsetIDs(int type)
          Returns the IDs of all registered Subset2s of given type
 java.lang.String getSubsetName(java.lang.String id)
          Returns the name of the subset which is registered for the given id or null
 java.lang.String[] getSubsetNames()
          Returns the names of all locally and globally registered Subset2s
 java.lang.String[] getSubsetNames(int type)
          Returns the names of all registered Subset2s of given type
 Subset2[] getSubsets()
          Returns all Subset2s which are currently registered with this hierarchy.
 Subset2[] getSubsets(int type)
          Returns all Subset2s of the given type which are registered with this hierarchy.
 boolean hasSubsets(int type)
          Checks if there are any subsets of the given type
 void remove(java.lang.String id, int type)
          Removes the subset specified by the given id and type.
 void remove(Subset2 subset)
          Removes the given subset
 void reset()
          Resets this SubsetHandler.
 void save(Subset2 subset)
          Saves the given subset
 

Method Detail

getDimension

Dimension getDimension()
Deprecated. use getHierarchy() instead.

Returns the Dimension to which this SubsetHandler is registered.

Returns:
the Dimension of this SubsetHandler.

getHierarchy

Hierarchy getHierarchy()
Returns the Hierarchy to which this SubsetHandler is registered.

Returns:
the Hierarchy of this SubsetHandler.

reset

void reset()
Resets this SubsetHandler. This will clear all internally used caches too.


getSubsetId

java.lang.String getSubsetId(java.lang.String name,
                             int type)
Checks if a subset with the given name and type already exists for this hierarchy and returns its id.

Parameters:
name - a subset name
type - one of the defined subset type constants
Returns:
the id of the specified subset if it exists for this hierarchy or null otherwise

addSubset

Subset2 addSubset(java.lang.String name,
                  int type)
Adds a new Subset2 with the given name and type to this hierarchy

Parameters:
name - the name of the subset
type - one of the defined subset type constants
Returns:
the new subset instance
Throws:
InsufficientRightsException

getSubsets

Subset2[] getSubsets()
Returns all Subset2s which are currently registered with this hierarchy. This method tries to load all locally and globally defined subsets. Subsets which cannot be loaded are ignored.

Returns:
the registered subsets

getSubsets

Subset2[] getSubsets(int type)
Returns all Subset2s of the given type which are registered with this hierarchy. Subsets which cannot be loaded are ignored.

Parameters:
type - one of the defined subset type constants
Returns:
the registered subsets

getSubset

Subset2 getSubset(java.lang.String id,
                  int type)
Returns the Subset2 instance which is registered with the given id and for the given type or null if no subset with this id could be found or new subsets are not supported

Parameters:
id - the subset id
type - one of the defined subset type constants
Returns:
the corresponding subset instance
Throws:
PaloIOException

getSubsetIDs

java.lang.String[] getSubsetIDs()
Returns the IDs of all locally and globally registered Subset2s

Returns:
the IDs of all locally and globally registered subsets

getSubsetNames

java.lang.String[] getSubsetNames()
Returns the names of all locally and globally registered Subset2s

Returns:
the names of all locally and globally registered subsets

getSubsetNames

java.lang.String[] getSubsetNames(int type)
Returns the names of all registered Subset2s of given type

Parameters:
type - one of the defined subset type constants
Returns:
the names of all registered subsets of given type
Throws:
InsufficientRightsException

getSubsetIDs

java.lang.String[] getSubsetIDs(int type)
Returns the IDs of all registered Subset2s of given type

Parameters:
type - one of the defined subset type constants
Returns:
the IDs of all registered subsets of given type
Throws:
InsufficientRightsException

getSubsetName

java.lang.String getSubsetName(java.lang.String id)
Returns the name of the subset which is registered for the given id or null

Parameters:
id - the subset id
Returns:
null if no name exists to given id or if new subsets are not supported

hasSubsets

boolean hasSubsets(int type)
Checks if there are any subsets of the given type

Parameters:
type - one of the defined subset type constants
Returns:
true if there are subsets of given type registered or false if not

remove

void remove(Subset2 subset)
Removes the given subset

Parameters:
subset - the subset to remove
Throws:
InsufficientRightsException

remove

void remove(java.lang.String id,
            int type)
Removes the subset specified by the given id and type.

Parameters:
id - the subset id
type - the subset type
Throws:
InsufficientRightsException

save

void save(Subset2 subset)
Saves the given subset

Parameters:
subset - the subset to save
Throws:
InsufficientRightsException

canWrite

boolean canWrite(int type)
Checks if the user is allowed to write subsets of given type

Parameters:
type - one of the predefined subset type constants.
Returns:
true if user is allowed to write subsets of given type, false otherwise

canRead

boolean canRead(int type)
Checks if the user is allowed to read subsets of given type

Parameters:
type - one of the predefined subset type constants.
Returns:
true if user is allowed to read subsets of given type, false otherwise