com.sri.common.util
Class PermGroup

java.lang.Object
  extended by com.jcorporate.expresso.core.dataobjects.BaseDataObject
      extended by com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
          extended by com.jcorporate.expresso.core.dbobj.DBObject
              extended by com.jcorporate.expresso.core.dbobj.SecuredDBObject
                  extended by com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
                      extended by com.sri.common.util.PermGroup
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, Securable, LookupInterface, IViewable, Serializable

public class PermGroup
extends RowSecuredDBObject
implements IViewable

Version of UserGroup which has RowSecuredDBObject as superclass. Group is a grouping of a number of users for security purposes. UserGroups are equivalent to 'roles' in other terminology.

Author:
Larry Hamel
See Also:
UserGroup, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jcorporate.expresso.core.dbobj.DBObject
DBObject.FieldError, DBObject.FieldUpdate
 
Field Summary
static String ADMIN_GROUP
           
static String ALL_USERS_GROUP
          Used as default group for all users who register and their reg domain has no other group set.
static String DEMO_GROUP
           
static int GROUP_DESCRIP_MAX_LEN
           
static String GROUP_DESCRIPTION
           
static String GROUP_NAME_FIELD
           
static int GROUP_NAME_MAX_LEN
           
static String NOT_REG_USERS_GROUP
           
static String UNKNOWN_USERS_GROUP
          Groups created as part of DBTool.setupSecurity bootstrap.
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
DEFAULT_PERMISSION_CODE
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
ADD, ALL_FUNCTIONS, CACHE_NAME, CACHE_TTY, DELETE, SEARCH, SYSTEM_ACCOUNT_NAME, UPDATE
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.DBObject
ATTRIBUTE_ERROR, ATTRIBUTE_ERROR_MESSAGE, ATTRIBUTE_PAGE_LIMIT, BIG_DECIMAL_ZERO, CACHE_LIMIT_PERCENT, CACHE_LIMIT_TTL, EMAIL_MASK, EVENT_ADD, EVENT_DELETE, EVENT_UPDATE, FLOAT_MASK, INT_MASK, IS_CHECK_RELATIONAL_INTEGRITY, IS_MUTABLE, sCacheStats, UPDATE_CHANGED_ONLY, WHERE_KEYWORD
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
anyFieldsDistinct, anyFieldsToInput, anyFieldsToRetrieve, appendCustomWhere, caseSensitiveQuery, customWhereClause, dbKey, distinctFields, inputFields, localConnection, LONGBINARY_READ_DEFAULT_SIZE, maxRecords, myClassName, myUpdates, offsetRecord, recordSet, retrieveFields, sMetadataMap, sortKeys
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
currentStatus, globalMask
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.Securable
SYSTEM_ACCOUNT
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED
 
Constructor Summary
PermGroup()
          Construct object with superuser privileges.
PermGroup(ControllerRequest request)
          For using DBObjects within Controllers.
PermGroup(DBConnection localConnection)
          Constructor for db transactions; object will have superuser privileges unless you separately call setRequestingUid().
 
Method Summary
protected  void checkAllReferredToBy()
          Check referential integrity of objects referring to this object.
 void delete()
          Extend the super.delete() method to first delete the GroupMembers elements that refer to the group being deleted
static PermGroup getGroup(String groupname)
           
 String getGroupDescription()
          convenience method
 String getGroupName()
          convenience method
 Vector getValues()
          Gets the valid values, specifically it returns a map of GroupNames to GroupDescriptions
 Transition getViewTrans()
          Provide a transition for viewing this object, suitable for creating an HTTP link.
 void populateDefaultValues()
          Add rowsecured privileges for built-in groups.
 void setGroupName(String groupName)
          convenience method
protected  void setupFields()
           
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
add, add, addGroupPerm, canRequesterAdministrate, canRequesterRead, canRequesterWrite, checkDeleteDetailPerm, checkKeyLength, defaultGroup, defaultPermissions, delete, deleteAll, find, getAdministrateGroups, getGroups, getPermissions, getReadGroups, getWriteGroups, isAdminGroup, isReadGroup, isRowAllowed, isRowAllowed, isWriteGroup, ownerID, removeGroup, retrieve, searchAndRetrieveList, searchAndRetrieveList, setPermissions, setPermissions, update
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
canRequesterAdd, canRequesterDelete, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, getRequestingUid, getRequestingUser, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, isAllowed, search, setRequestingUid, setRequestingUser
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.DBObject
addDetail, addField, addField, addFieldError, addFoundKeys, addIfNeeded, addIndex, addKey, addMaster, addOrUpdate, addSortKey, addTransition, addVirtualField, addVirtualField, addVirtualField, addVirtualField, average, basicAdd, cacheIsChangedComparison, canUseRetrieve, checkAllRefs, checkAllRefsPublic, checkField, checkMutable, checkRef, checkRef, clear, clearDistinctFields, clearError, clearFieldsToInput, clearFieldsToRetrieve, clearSortKeys, clone, containsWildCards, copyAllFields, deleteAll, deleteDetails, denotesRange, equals, fetchImmut, fetchImmutable, forKey, formatDateTime, get, getAllAttributes, getAttribute, getAttributesIterator, getBooleanFieldValue, getCacheSize, getCacheStatsMap, getCacheUtil, getCheckZeroUpdate, getCustomWhereClause, getDataContext, getDataField, getDataTransferObject, getDBName, getDetails, getDistinctFieldCount, getDistinctFields, getField, getFieldAttributesIterator, getFieldBigDecimal, getFieldBoolean, getFieldByte, getFieldByteArray, getFieldData, getFieldDate, getFieldDecimalFormatted, getFieldDouble, getFieldErrorMessage, getFieldFloat, getFieldInt, getFieldLong, getFieldMetaData, getFieldShort, getFieldsToInputCount, getFieldsToRetrieveCount, getFilterClass, getFoundCount, getFoundKeysArray, getIndexArray, getISOValuesDefault, getISOValuesDefault, getISOValuesDefault, getKey, getKeyFieldListIterator, getLength, getLengthInt, getLocale, getLogger, getLookupObject, getMax, getMax, getMaxRecords, getMyKeys, getMyUpdatesArray, getOffsetRecord, getPatternMatcher, getPrecision, getSerializedForm, getSizeEstimate, getStringFilter, getThisDBbj, getThisDBObj, getValidValueDescrip, getValidValues, getValidValuesList, getValuesDefault, getValuesDefault, getValuesDefault, hasError, hasErrors, haveAllKeys, initialize, isCached, isChanged, isDistinct, isEmpty, isFieldDistinct, isFieldNull, isFieldsToInput, isFieldsToRetrieve, isFieldToRetrieve, isMultiValued, isMutable, isMutable, isReadOnly, isSecret, isVirtual, loadFromConnection, logChange, max, min, newInstance, noNewLine, noQuotes, notifyListeners, referredToBy, removeAttribute, removeFromCache, retrieveFromCache, saveBinaryField, search, set, setAttribute, setCacheLimit, setCacheLimit, setCacheLimitAsPercent, setCacheSize, setCharset, setCheckZeroUpdate, setConnection, setConnection, setCustomWhereClause, setCustomWhereClause, setDataContext, setDataField, setDataTransferObject, setDefaultValue, setDescription, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setFieldData, setFieldData, setFieldDistinct, setFieldsToInput, setFieldsToRetrieve, setFilterClass, setFilterClass, setKey, setKeys, setLocale, setLookupField, setLookupObject, setMask, setMaxRecords, setMultiValued, setName, setOffsetRecord, setReadOnly, setSchema, setSecret, setSortKey, setStringFilter, setStringFiltersOnAll, setTargetDbSchema, setTargetTable, sqlAggrFunction, sum, toDebugString, update, updateAll, updateAll, updateIsChanged, verify
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
addInParam, addOutParam, buildWhereClause, buildWhereClauseBuffer, checkZeroUpdate, constructNewMetaData, createAndExecuteSearch, createAndRunStoreProcedure, createSQLSelectStatement, createSQLSelectStatement, getConnectionPool, getCustomStringFieldValue, getDef, getDistinctFieldArrayList, getExecutor, getFieldsToInputIterator, getFieldsToRetrieveIterator, getJDBCMetaData, getJDBCUtil, getLocalConnection, getMappedDataContext, getMetaData, getQueryInterface, getSerialForm, loadFromConnection, makeLimitationStub, quoteIfNeeded, runStoredProcedure, runStoredProcedureAndRetrieveList, selectFieldString, setCaseSensitiveQuery, setDBConnectionPool, setDBName, setMappedDataContext, setOriginalDBName, setTargetStoreProcedure
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
getGlobalMask, getStatus, isGlobalMasked, setFieldsWithDefaults, setGlobalMask, setStatus
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GROUP_NAME_FIELD

public static final String GROUP_NAME_FIELD
See Also:
Constant Field Values

GROUP_DESCRIPTION

public static final String GROUP_DESCRIPTION
See Also:
Constant Field Values

GROUP_NAME_MAX_LEN

public static final int GROUP_NAME_MAX_LEN
See Also:
Constant Field Values

GROUP_DESCRIP_MAX_LEN

public static final int GROUP_DESCRIP_MAX_LEN
See Also:
Constant Field Values

ALL_USERS_GROUP

public static final String ALL_USERS_GROUP
Used as default group for all users who register and their reg domain has no other group set.

See Also:
SimpleRegistration, Constant Field Values

DEMO_GROUP

public static final String DEMO_GROUP
See Also:
Constant Field Values

UNKNOWN_USERS_GROUP

public static final String UNKNOWN_USERS_GROUP
Groups created as part of DBTool.setupSecurity bootstrap.

See Also:
Constant Field Values

NOT_REG_USERS_GROUP

public static final String NOT_REG_USERS_GROUP
See Also:
Constant Field Values

ADMIN_GROUP

public static final String ADMIN_GROUP
See Also:
Constant Field Values
Constructor Detail

PermGroup

public PermGroup()
          throws DBException
Construct object with superuser privileges.

Throws:
DBException - upon construction error
See Also:
SecuredDBObject

PermGroup

public PermGroup(ControllerRequest request)
          throws DBException
For using DBObjects within Controllers. Initializes based upon the current user and the requested db. [Of course this can be modified later].

Parameters:
request - - The controller request handed to you by the framework.
Throws:
DBException - upon construction error

PermGroup

public PermGroup(DBConnection localConnection)
          throws DBException
Constructor for db transactions; object will have superuser privileges unless you separately call setRequestingUid().

Parameters:
localConnection - the connection which should be used, typically because of an ongoing transaction
Throws:
DBException - upon construction error
Method Detail

checkAllReferredToBy

protected void checkAllReferredToBy()
                             throws DBException
Check referential integrity of objects referring to this object.

Overrides:
checkAllReferredToBy in class DBObject
Throws:
DBException - If the integrity cannot be verified

delete

public void delete()
            throws DBException
Extend the super.delete() method to first delete the GroupMembers elements that refer to the group being deleted

Specified by:
delete in interface DataObject
Overrides:
delete in class SecuredDBObject
Throws:
DBException - upon delete error.

setupFields

protected void setupFields()
                    throws DBException
Overrides:
setupFields in class DBObject
Throws:
DBException - upon setup error.
See Also:
SecuredDBObject

getValues

public Vector getValues()
                 throws DBException
Gets the valid values, specifically it returns a map of GroupNames to GroupDescriptions

Specified by:
getValues in interface LookupInterface
Overrides:
getValues in class DBObject
Returns:
a vector of valid values.
Throws:
DBException - upon database access error.

getGroupName

public String getGroupName()
                    throws DBException
convenience method

Returns:
name of group
Throws:
DBException - upon error

setGroupName

public void setGroupName(String groupName)
                  throws DBException
convenience method

Parameters:
groupName - the new gropu name
Throws:
DBException - upon error

getGroup

public static PermGroup getGroup(String groupname)
                          throws DBException
Parameters:
groupname - the new group name
Returns:
group for this name, or null if not found; uses "default" dbcontext
Throws:
DBException - upon error

getGroupDescription

public String getGroupDescription()
                           throws DBException
convenience method

Returns:
java.lang.String the group description
Throws:
DBException - upon error

getViewTrans

public Transition getViewTrans()
                        throws DBException
Provide a transition for viewing this object, suitable for creating an HTTP link.

Specified by:
getViewTrans in interface IViewable
Returns:
transtion for viewing, including label for name of object; never null
Throws:
DBException - upon database access error.

populateDefaultValues

public void populateDefaultValues()
                           throws DBException
Add rowsecured privileges for built-in groups.

Overrides:
populateDefaultValues in class DBObject
Throws:
DBException - upon population error.


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.