org.palo.api.subsets.impl
Class SubsetHandlerImpl

java.lang.Object
  extended by org.palo.api.subsets.impl.SubsetHandlerImpl
All Implemented Interfaces:
SubsetHandler

public class SubsetHandlerImpl
extends java.lang.Object
implements SubsetHandler

SubsetHandlerImpl

- API INTERNAL CLASS -

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

Constructor Summary
SubsetHandlerImpl(Dimension dimension)
          Deprecated. use hierarchy constructor instead.
 
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
 Subset2 create(java.lang.String id, java.lang.String name, Hierarchy hierarchy, int type)
          - API INTERNAL -
 Dimension getDimension()
          Returns the Dimension to which this SubsetHandler is registered.
 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.
 void getSubsets(int type, SubsetLoadObserver observer)
           
 void getSubsets(SubsetLoadObserver observer)
           
 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubsetHandlerImpl

public SubsetHandlerImpl(Dimension dimension)
Deprecated. use hierarchy constructor instead.

Creates a new SubsetHandlerImpl instance for the given dimension.

Parameters:
dimension - the dimension to create the subset handler for
Method Detail

canRead

public final boolean canRead(int type)
Description copied from interface: SubsetHandler
Checks if the user is allowed to read subsets of given type

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

canWrite

public final boolean canWrite(int type)
Description copied from interface: SubsetHandler
Checks if the user is allowed to write subsets of given type

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

getDimension

public final Dimension getDimension()
Description copied from interface: SubsetHandler
Returns the Dimension to which this SubsetHandler is registered.

Specified by:
getDimension in interface SubsetHandler
Returns:
the Dimension of this SubsetHandler.

getHierarchy

public final Hierarchy getHierarchy()
Description copied from interface: SubsetHandler
Returns the Hierarchy to which this SubsetHandler is registered.

Specified by:
getHierarchy in interface SubsetHandler
Returns:
the Hierarchy of this SubsetHandler.

reset

public final void reset()
Description copied from interface: SubsetHandler
Resets this SubsetHandler. This will clear all internally used caches too.

Specified by:
reset in interface SubsetHandler

addSubset

public final Subset2 addSubset(java.lang.String name,
                               int type)
Description copied from interface: SubsetHandler
Adds a new Subset2 with the given name and type to this hierarchy

Specified by:
addSubset in interface SubsetHandler
Parameters:
name - the name of the subset
type - one of the defined subset type constants
Returns:
the new subset instance

getSubset

public final Subset2 getSubset(java.lang.String id,
                               int type)
Description copied from interface: SubsetHandler
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

Specified by:
getSubset in interface SubsetHandler
Parameters:
id - the subset id
type - one of the defined subset type constants
Returns:
the corresponding subset instance

getSubsets

public final void getSubsets(SubsetLoadObserver observer)

getSubsets

public final Subset2[] getSubsets()
Description copied from interface: SubsetHandler
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.

Specified by:
getSubsets in interface SubsetHandler
Returns:
the registered subsets

getSubsets

public final void getSubsets(int type,
                             SubsetLoadObserver observer)

getSubsets

public final Subset2[] getSubsets(int type)
Description copied from interface: SubsetHandler
Returns all Subset2s of the given type which are registered with this hierarchy. Subsets which cannot be loaded are ignored.

Specified by:
getSubsets in interface SubsetHandler
Parameters:
type - one of the defined subset type constants
Returns:
the registered subsets

getSubsetId

public final java.lang.String getSubsetId(java.lang.String name,
                                          int type)
Description copied from interface: SubsetHandler
Checks if a subset with the given name and type already exists for this hierarchy and returns its id.

Specified by:
getSubsetId in interface SubsetHandler
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

getSubsetIDs

public final java.lang.String[] getSubsetIDs()
Description copied from interface: SubsetHandler
Returns the IDs of all locally and globally registered Subset2s

Specified by:
getSubsetIDs in interface SubsetHandler
Returns:
the IDs of all locally and globally registered subsets

getSubsetIDs

public java.lang.String[] getSubsetIDs(int type)
Description copied from interface: SubsetHandler
Returns the IDs of all registered Subset2s of given type

Specified by:
getSubsetIDs in interface SubsetHandler
Parameters:
type - one of the defined subset type constants
Returns:
the IDs of all registered subsets of given type

getSubsetNames

public java.lang.String[] getSubsetNames()
Description copied from interface: SubsetHandler
Returns the names of all locally and globally registered Subset2s

Specified by:
getSubsetNames in interface SubsetHandler
Returns:
the names of all locally and globally registered subsets

getSubsetNames

public java.lang.String[] getSubsetNames(int type)
Description copied from interface: SubsetHandler
Returns the names of all registered Subset2s of given type

Specified by:
getSubsetNames in interface SubsetHandler
Parameters:
type - one of the defined subset type constants
Returns:
the names of all registered subsets of given type

getSubsetName

public final java.lang.String getSubsetName(java.lang.String id)
Description copied from interface: SubsetHandler
Returns the name of the subset which is registered for the given id or null

Specified by:
getSubsetName in interface SubsetHandler
Parameters:
id - the subset id
Returns:
null if no name exists to given id or if new subsets are not supported

hasSubsets

public final boolean hasSubsets(int type)
Description copied from interface: SubsetHandler
Checks if there are any subsets of the given type

Specified by:
hasSubsets in interface SubsetHandler
Parameters:
type - one of the defined subset type constants
Returns:
true if there are subsets of given type registered or false if not

remove

public void remove(Subset2 subset)
Description copied from interface: SubsetHandler
Removes the given subset

Specified by:
remove in interface SubsetHandler
Parameters:
subset - the subset to remove

remove

public void remove(java.lang.String id,
                   int type)
Description copied from interface: SubsetHandler
Removes the subset specified by the given id and type.

Specified by:
remove in interface SubsetHandler
Parameters:
id - the subset id
type - the subset type

save

public final void save(Subset2 subset)
Description copied from interface: SubsetHandler
Saves the given subset

Specified by:
save in interface SubsetHandler
Parameters:
subset - the subset to save

create

public final Subset2 create(java.lang.String id,
                            java.lang.String name,
                            Hierarchy hierarchy,
                            int type)

- API INTERNAL -