com.ibm.dse.applsrv.aa
Class SecurityRight

java.lang.Object
  |
  +--com.ibm.dse.applsrv.aa.SecurityObject
        |
        +--com.ibm.dse.applsrv.aa.SecurityRight

public class SecurityRight
extends SecurityObject
implements SecurityConstants, java.io.Serializable

This class represents a security right.

See Also:
Serialized Form

Fields inherited from class com.ibm.dse.applsrv.aa.SecurityObject
fs
 
Fields inherited from interface com.ibm.dse.applsrv.aa.SecurityConstants
ACTIVE_CONTEXTS, ALL_CONTEXTS, AUDIT_FILE, CBTF_TRACING, CONFIGURATION, CONFIGURATIONS_DATABASE, CONTEXT_ACTIVE, CONTEXT_DATABASE, CONTEXT_INACTIVE, CONTEXT_INVALID, CONTEXTS, CONTROLLER, DEFAULT_CONFIGURATIONS_DATABASE, DEFAULT_CONTEXT_DATABASE, DEFAULT_GROUPS_DATABASE, DEFAULT_RIGHTS_DATABASE, DEFAULT_ROLES_DATABASE, DEFAULT_SERVICES_DATABASE, DEFAULT_USER_DATABASE, ENCRYPTION, GLOBAL_CONTEXTS, GROUPS, GROUPS_DATABASE, INACTIVE_CONTEXTS, JDBC_DATABASE, JDBC_DRIVER, JDBC_MAX_DATA, JDBC_MAX_GROUPS, JDBC_MAX_HANDLER, JDBC_MAX_ID, JDBC_MAX_PASSWORD, JDBC_MAX_RIGHT_TIMES, JDBC_MAX_RIGHTS, JDBC_MAX_ROLE_TIMES, JDBC_MAX_ROLES, JDBC_MAX_USER_ID, JDBC_MAX_USERS, JDBC_PASSWORD, JDBC_URL, JDBC_USER_ID, LIMIT_DATABASE, LIMITS, LOGGING_HANDLER, LOGGING_OPTIONS, PERSIST_CONTEXTS, PERSISTENCE, QUERY_PASSWORDS, RIGHTS, RIGHTS_DATABASE, ROLES, ROLES_DATABASE, SECURITY_DIRECTORY, SECURITY_MANAGER, SERVICES, SERVICES_DATABASE, SPECIFIC_CONTEXTS, TEST_ADD_RIGHT_TO_USER, TEST_ADD_RIGHTS_TO_USER, TEST_AUDIT, TEST_CONTEXT_IDS, TEST_DISABLE_PERSISTENCE, TEST_EXPORT, TEST_GET_CONFIGURATION, TEST_GET_CONTEXTS, TEST_GET_GROUPS, TEST_GET_PASSWORD_ACCESS, TEST_GET_PERSISTENCE, TEST_GET_RIGHTS, TEST_GET_ROLES, TEST_GET_SERVICES, TEST_GET_UNIQUE_LOGON, TEST_GET_USERS, TEST_GROUP_IDS, TEST_IMPORT, TEST_IMPORT2, TEST_LOAD_CONFIGURATIONS, TEST_LOAD_CONTEXTS, TEST_LOAD_GROUPS, TEST_LOAD_RIGHTS, TEST_LOAD_ROLES, TEST_LOAD_SERVICES, TEST_LOAD_USERS, TEST_PERSISTENCE, TEST_QUERY_SM, TEST_REMOVE_ALL_RIGHTS_FROM_USER, TEST_RESET, TEST_RIGHT_IDS, TEST_ROLE_IDS, TEST_SAVE, TEST_SERVICE_IDS, TEST_SET_CONFIGURATION, TEST_SET_PASSWORD_ACCESS, TEST_SET_PERSISTENCE, TEST_SET_UNIQUE_LOGON, TEST_TEST1, TEST_TEST2, TEST_TEST3, TEST_TRACE, TEST_USER_IDS, TRACE_EXCEPTIONS, TRACE_FILE, TRACE_LOGGER, UNIQUE_LOGONS, USE_LIMITS, USER_DATABASE, USERS
 
Constructor Summary
protected SecurityRight(java.lang.String nameOfRight)
          Create a new instance of a Right with the specified name.
 
Method Summary
protected  void _save()
          A hack to force inheritence of a static method.
protected static void checkRights(java.lang.String[] rightsToCheck)
          Verify that all of the named rights actually exist.
static void controller(SecurityController ctrl)
          Set the security controller.
 boolean delete()
          Delete this right.
protected static boolean delete(java.lang.String right)
          Delete the named right.
protected static boolean deleteRights(java.lang.String[] rightsToDelete, java.lang.String[] options)
          Delete the named rights subject to the specified options.
protected static boolean disablePersist()
          Disable persistence for rights.
protected static java.util.Enumeration enumerationOverRights()
          Return an enumeration over the rights.
protected static void forceSave()
          Force a save of the current state of the rights to the database.
protected static SecurityRight get(java.lang.String nameOfRight, boolean create)
          Return the right with the specified name.
 Dictionary getAttributes()
          Return a dictionary containing all of the attributes of this right.
protected static java.lang.String[] getCreatedRights()
          Return the list of the names of the user created rights.
protected static SecurityPersistence getDB()
          Return the persistence controller for this class.
protected static java.lang.String getPathName()
          Return the pathname of this database of rights.
protected static boolean getPersist()
          Return the persistence state for rights.
protected static java.lang.String[] getRightIds()
          Return the list of names of the rights.
protected static java.lang.String[] initializeRights()
          Insure that all of the intrinsic rights exists and return this list.
protected static java.lang.String[] initRights()
          Return the list of initial rights for the default user.
protected static void load()
          Load the current state of the rights from the database.
protected static Dictionary loadr()
          Load and return the current state of the rights from the database.
protected static int numberOfRights()
          Return the number of rights that are currently defined.
protected static void reset()
          Reset the rights.
 void resetAttributes()
          Reset all attributes of this right with the exception of the right's name.
protected static Dictionary rights()
          Return a copy of the dictionary of rights.
protected static void save()
          Save the current state of the rights to the database.
protected static void setDB(SecurityPersistence securityPersistence)
          Set the persistence controller for this class.
protected static void setFileName(java.lang.String fileName)
          Set the filename of this database.
protected static void setPersist(boolean persistence)
          Enable or disable persistence for rights.
protected static void shutdown()
          Shutdown the security component.
 java.lang.String toString()
          Returns a string representation of this object.
 void verify()
          Verify this right.
protected static void verifyAll()
          Verify the consistancy of this database.
 
Methods inherited from class com.ibm.dse.applsrv.aa.SecurityObject
getData, getData, getDataOrNull, getName, home, prefix, putData, putData, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SecurityRight

protected SecurityRight(java.lang.String nameOfRight)
                 throws DSESecurityException
Create a new instance of a Right with the specified name.
Parameters:
nameOfRight - String - the name of this right.
Throws:
DSESecurityException - - error in the request.
Method Detail

_save

protected void _save()
              throws DSESecurityException
A hack to force inheritence of a static method.
Overrides:
_save in class SecurityObject
Throws:
DSESecurityException - - abstract method.

checkRights

protected static void checkRights(java.lang.String[] rightsToCheck)
                           throws DSESecurityException
Verify that all of the named rights actually exist. Throw an VBSecurityException if at least one of these doesn't.
Parameters:
rightsToCheck - String[] - the names of the rights to delete.
Throws:
DSESecurityException - - error in the request.

controller

public static void controller(SecurityController ctrl)
Set the security controller.
Parameters:
ctrl - SecurityController - the security controller.

delete

public boolean delete()
               throws DSESecurityException
Delete this right.
Returns:
boolean - true if the delete succeeded else false.
Throws:
DSESecurityException - - database error.

delete

protected static boolean delete(java.lang.String right)
                         throws DSESecurityException
Delete the named right.
Parameters:
right - String - the name of the right to delete.
Returns:
boolean - true if the delete succeeded else false.
Throws:
DSESecurityException - - database error.

deleteRights

protected static boolean deleteRights(java.lang.String[] rightsToDelete,
                                      java.lang.String[] options)
                               throws DSESecurityException
Delete the named rights subject to the specified options. OPTIONS: atomic , exception , local , nosave , references , safe , skip.
Parameters:
rightsToDelete - String[] - the names of the rights to delete.
options - String[] - the options for this command.
Returns:
boolean - true if the deletes succeeded else false.
Throws:
DSESecurityException - - error in the request.

disablePersist

protected static boolean disablePersist()
Disable persistence for rights.
Returns:
boolean - true if rights were persisting else false.

enumerationOverRights

protected static java.util.Enumeration enumerationOverRights()
Return an enumeration over the rights.
Returns:
Enumeration - the enumeration over the rights.

forceSave

protected static void forceSave()
                         throws DSESecurityException
Force a save of the current state of the rights to the database.
Throws:
DSESecurityException - - database error.

get

protected static SecurityRight get(java.lang.String nameOfRight,
                                   boolean create)
                            throws DSESecurityException
Return the right with the specified name. If the right doesn't exist & the create option is false then return null else create & return a new right with the specified name.
Parameters:
nameOfRight - String - the name of the right.
create - boolean - if the right does not exist then if true then create it else just return null.
Returns:
SecurityRight - the right.
Throws:
DSESecurityException - - error in the request.

getAttributes

public Dictionary getAttributes()
                         throws DSESecurityException
Return a dictionary containing all of the attributes of this right.
Returns:
Dictionary - a dictionary containing all of the attributes of this right.
Throws:
DSESecurityException - - database error.

getCreatedRights

protected static java.lang.String[] getCreatedRights()
                                              throws DSESecurityException
Return the list of the names of the user created rights.
Returns:
String[] - the list of names of all the rights.
Throws:
DSESecurityException - - database error.

getDB

protected static SecurityPersistence getDB()
Return the persistence controller for this class.
Returns:
SecurityPersistence - the persistence controller.

getPathName

protected static java.lang.String getPathName()
Return the pathname of this database of rights.
Returns:
String - the pathname of this database or null if its not configured.

getPersist

protected static boolean getPersist()
Return the persistence state for rights.
Returns:
boolean - true if rights are persisting else false.

getRightIds

protected static java.lang.String[] getRightIds()
Return the list of names of the rights.
Returns:
String[] - the list of names of the rights.

initializeRights

protected static java.lang.String[] initializeRights()
Insure that all of the intrinsic rights exists and return this list.
Returns:
String[] - the list of initial rights.

initRights

protected static java.lang.String[] initRights()
Return the list of initial rights for the default user.
Returns:
String[] - the list of initial rights.

load

protected static void load()
                    throws DSESecurityException
Load the current state of the rights from the database.
Throws:
DSESecurityException - - database error.

loadr

protected static Dictionary loadr()
                           throws DSESecurityException
Load and return the current state of the rights from the database.
Returns:
Dictionary - the database.
Throws:
DSESecurityException - - database error.

numberOfRights

protected static int numberOfRights()
Return the number of rights that are currently defined.
Returns:
int - the number of rights that are currently defined.

reset

protected static void reset()
                     throws DSESecurityException
Reset the rights.
Throws:
DSESecurityException - - database error.

resetAttributes

public void resetAttributes()
                     throws DSESecurityException
Reset all attributes of this right with the exception of the right's name.
Throws:
DSESecurityException - - error during save.

rights

protected static Dictionary rights()
Return a copy of the dictionary of rights.
Returns:
Dictionary - a copy of the rights.

save

protected static void save()
                    throws DSESecurityException
Save the current state of the rights to the database.
Throws:
DSESecurityException - - database error.

setDB

protected static void setDB(SecurityPersistence securityPersistence)
Set the persistence controller for this class.
Parameters:
securityPersistence - SecurityPersistence - the persistence controller.

setFileName

protected static void setFileName(java.lang.String fileName)
Set the filename of this database.
Parameters:
fileName - String - the name of this database.

setPersist

protected static void setPersist(boolean persistence)
Enable or disable persistence for rights.
Parameters:
persistence - boolean - true to enable persistence, false to disable it.

shutdown

protected static void shutdown()
                        throws DSESecurityException
Shutdown the security component.
Throws:
DSESecurityException - - error in the request.

toString

public java.lang.String toString()
Returns a string representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
String - a string representation of this object.

verify

public void verify()
            throws DSESecurityException
Verify this right.
Throws:
DSESecurityException - - error in the request.

verifyAll

protected static void verifyAll()
                         throws DSESecurityException
Verify the consistancy of this database.
Throws:
DSESecurityException - - error in the request.