pl.bristleback.server.bristle.rights
Class ConnectorRightsSet

java.lang.Object
  extended by pl.bristleback.server.bristle.rights.ConnectorRightsSet

public class ConnectorRightsSet
extends java.lang.Object

Wrapper class containing synchronized set of connector actual rights. All operations on this set are thread safe. New empty connector rights set is created automatically for every connector, and it is stored as a connector variable with a name given in BristleConstants class. For more useful methods using connector rights set, see ConnectorRightsUtil.

Created on: 2010-09-03 16:08:17

Author:
Wojciech Niemiec

Constructor Summary
ConnectorRightsSet()
          Creates empty connector rights set.
 
Method Summary
 void addRight(java.lang.String right)
          Adds right with given name.
 boolean hasRight(java.lang.String right)
          Checks whether set contains given right.
 boolean hasRights(java.util.Collection rightsToCheck)
          Checks whether connector rights set contains all rights given in collection.
 void removeRight(java.lang.String right)
          Removes right given as a parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectorRightsSet

public ConnectorRightsSet()
Creates empty connector rights set.

Method Detail

addRight

public void addRight(java.lang.String right)
Adds right with given name. If right already existed in set, nothing happens.

Parameters:
right - name of the right.

hasRights

public boolean hasRights(java.util.Collection rightsToCheck)
Checks whether connector rights set contains all rights given in collection.

Parameters:
rightsToCheck - collection of checked rights.
Returns:
true if all rights from collection are in connector rights set.

hasRight

public boolean hasRight(java.lang.String right)
Checks whether set contains given right.

Parameters:
right - name of the right to check.
Returns:
true if set contains given right, false otherwise.

removeRight

public void removeRight(java.lang.String right)
Removes right given as a parameter. If set does not contains that right, nothing happens.

Parameters:
right - right to remove.


Copyright © 2011. All Rights Reserved.