Expresso 5-6

com.jcorporate.expresso.services.dbobj
Class RowGroupPerms

java.lang.Object
  extended bycom.jcorporate.expresso.core.dataobjects.BaseDataObject
      extended bycom.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
          extended bycom.jcorporate.expresso.core.dbobj.DBObject
              extended bycom.jcorporate.expresso.services.dbobj.RowGroupPerms
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, LookupInterface, Serializable

public class RowGroupPerms
extends DBObject

storage for read/write permissions for a group, concerning a given row in the database this object and its table are a complement to the RowPermissions object and table. RowGroupPerms holds group permissions.

this object and its table should be manipulated only through RowSecuredDBObject

Author:
larry hamel
See Also:
RowSecuredDBObject, RowPermissions, Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.jcorporate.expresso.core.dbobj.DBObject
DBObject.FieldError, DBObject.FieldUpdate
 
Field Summary
static String GROUP
          field name for the group about which "group privilege settings" (read/write) apply
static String GROUP_PERMISSIONS_TABLE_NAME
           
static String PERMISSIONS
          field name for bits that make up permissions; perms stored in this table, ROW_GRP_PERMS, have bits for owner and other which are unused.
static String ROW_KEY
          field name for primary key of row
static String TABLE_NAME
          field name for name of table
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.DBObject
ATTRIBUTE_ERROR, ATTRIBUTE_ERROR_MESSAGE, ATTRIBUTE_PAGE_LIMIT, BIG_DECIMAL_ZERO, EMAIL_MASK, EVENT_ADD, EVENT_DELETE, EVENT_UPDATE, FLOAT_MASK, INT_MASK, IS_CHECK_RELATIONAL_INTEGRITY, UPDATE_CHANGED_ONLY, WHERE_KEYWORD
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
anyFieldsDistinct, anyFieldsToRetrieve, appendCustomWhere, caseSensitiveQuery, customWhereClause, dbKey, distinctFields, 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.DataObject
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED
 
Constructor Summary
RowGroupPerms()
          default constructor
RowGroupPerms(RowGroupPerms model)
          convenience copy constructor
RowGroupPerms(String table, String rowKey)
          convenience constructor which sets table, key
RowGroupPerms(String table, String rowKey, String grp)
          convenience constructor which sets table, key, group
 
Method Summary
 boolean canGroupAdministrate()
           
 boolean canGroupRead()
           
 boolean canGroupWrite()
           
 String group()
          get group name
 void group(String group)
          Set group; will throw run-time exception if the entire key for this row, which includes tablename, row key, and group name, is longer than permitted maximum for the host database.
 String key()
           
 void key(String key)
          set the row key
 int permissions()
          set permissions; not protected by test
 void permissions(int perm)
          set permissions
 void setDefaultPermissions()
          set group group is "Everybody" just sets fields--does not save; caller must call update()
protected  void setupFields()
          override in subclesses, and be sure to call this as first line of override
 String table()
          accessor for table name
 void table(String targetTable)
          set the target table
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.DBObject
add, addDetail, addField, addField, addFieldError, addFoundKeys, addIfNeeded, addIndex, addKey, addOrUpdate, addSortKey, addTransition, addVirtualField, addVirtualField, addVirtualField, addVirtualField, average, basicAdd, cacheIsChangedComparison, checkAllowed, checkAllReferredToBy, checkAllRefs, checkAllRefsPublic, checkDeleteDetailPerm, checkField, checkRef, checkRef, clear, clearDistinctFields, clearError, clearFieldsToRetrieve, clearSortKeys, containsWildCards, copyAttributes, count, delete, delete, deleteAll, deleteAll, deleteDetails, denotesRange, equals, find, forKey, formatDateTime, get, getAllAttributes, getAttribute, getAttributesIterator, getBooleanFieldValue, getCacheSize, getCacheStatsMap, getCacheUtil, getCheckZeroUpdate, getCustomWhereClause, getDataContext, getDataField, getDataTransferObject, getDBName, getDetails, getDistinctFieldCount, getDistinctFields, getField, getFieldBigDecimal, getFieldBoolean, getFieldByte, getFieldByteArray, getFieldData, getFieldDate, getFieldDecimalFormatted, getFieldDouble, getFieldErrorMessage, getFieldFloat, getFieldInt, getFieldLong, getFieldMetaData, getFieldShort, getFieldsToRetrieveCount, getFilterClass, getFoundCount, getFoundKeysArray, getIndexArray, getISOValuesDefault, getISOValuesDefault, getISOValuesDefault, getKey, getKeyFieldListIterator, getLength, getLengthInt, getLocalConnection, getLocale, getLogger, getLookupObject, getMax, getMax, getMaxRecords, getMyKeys, getMyUpdatesArray, getOffsetRecord, getPatternMatcher, getPrecision, getSerializedForm, getStringFilter, getThisDBbj, getThisDBObj, getValidValueDescrip, getValidValues, getValidValuesList, getValues, getValuesDefault, getValuesDefault, getValuesDefault, hasError, hasErrors, haveAllKeys, initialize, isCached, isChanged, isDistinct, isEmpty, isFieldDistinct, isFieldNull, isFieldsToRetrieve, isFieldToRetrieve, isMultiValued, isReadOnly, isSecret, isVirtual, loadFromConnection, logChange, max, min, newInstance, noNewLine, noQuotes, notifyListeners, populateDefaultValues, referredToBy, removeAttribute, removeFromCache, retrieve, retrieveFromCache, saveBinaryField, search, search, searchAndRetrieveList, searchAndRetrieveList, set, setAttribute, 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, setFieldsToRetrieve, setFilterClass, setFilterClass, setKeys, setLocale, setLookupField, setLookupObject, setMask, setMaxRecords, setMultiValued, setName, setOffsetRecord, setReadOnly, setSchema, setSecret, setSortKey, setStringFilter, setStringFiltersOnAll, setTargetDbSchema, setTargetTable, sqlAggrFunction, sum, toDebugString, update, update, updateAll, updateAll, verify
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
addInParam, addOutParam, buildWhereClause, buildWhereClauseBuffer, checkZeroUpdate, constructNewMetaData, createAndExecuteSearch, createAndRunStoreProcedure, getConnectionPool, getCustomStringFieldValue, getDef, getDistinctFieldArrayList, getExecutor, getFieldsToRetrieveIterator, getJDBCMetaData, getJDBCUtil, 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
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GROUP_PERMISSIONS_TABLE_NAME

public static final String GROUP_PERMISSIONS_TABLE_NAME
See Also:
Constant Field Values

TABLE_NAME

public static final String TABLE_NAME
field name for name of table

See Also:
Constant Field Values

ROW_KEY

public static final String ROW_KEY
field name for primary key of row

See Also:
Constant Field Values

GROUP

public static final String GROUP
field name for the group about which "group privilege settings" (read/write) apply

See Also:
Constant Field Values

PERMISSIONS

public static final String PERMISSIONS
field name for bits that make up permissions; perms stored in this table, ROW_GRP_PERMS, have bits for owner and other which are unused. Conversely, perms stored in table ROW_PERMISSIONS have bits for group permissions that are unused.

See Also:
Constant Field Values
Constructor Detail

RowGroupPerms

public RowGroupPerms()
              throws DBException
default constructor


RowGroupPerms

public RowGroupPerms(String table,
                     String rowKey)
              throws DBException
convenience constructor which sets table, key

Parameters:
table - tablename
rowKey - pipe-delimited concatenation of all necessary values for keys

RowGroupPerms

public RowGroupPerms(String table,
                     String rowKey,
                     String grp)
              throws DBException
convenience constructor which sets table, key, group

Parameters:
table - tablename
rowKey - pipe-delimited concatenation of all necessary values for keys
grp - name of group

RowGroupPerms

public RowGroupPerms(RowGroupPerms model)
              throws DBException
convenience copy constructor

Parameters:
model - an object from which all attributes will be copies (table, group, perms)
Method Detail

canGroupAdministrate

public boolean canGroupAdministrate()
                             throws DBException
Returns:
true if this group can administrate
Throws:
DBException

canGroupRead

public boolean canGroupRead()
                     throws DBException
Returns:
true if this group can read
Throws:
DBException

canGroupWrite

public boolean canGroupWrite()
                      throws DBException
Returns:
true if this group can write
Throws:
DBException

setupFields

protected void setupFields()
                    throws DBException
override in subclesses, and be sure to call this as first line of override

Overrides:
setupFields in class DBObject
Throws:
DBException - upon error

group

public String group()
             throws DBException
get group name

Throws:
DBException

group

public void group(String group)
           throws DBException
Set group; will throw run-time exception if the entire key for this row, which includes tablename, row key, and group name, is longer than permitted maximum for the host database.

Parameters:
group - the group string?
Throws:
DBException - upon error

setDefaultPermissions

public void setDefaultPermissions()
                           throws DBException
set group group is "Everybody" just sets fields--does not save; caller must call update()

Throws:
DBException - upon error

permissions

public void permissions(int perm)
                 throws DBException
set permissions

Parameters:
perm - Permissions code
Throws:
DBException - upon error

permissions

public int permissions()
                throws DBException
set permissions; not protected by test

Returns:
integer permission code
Throws:
DBException - upon error

table

public String table()
             throws DBException
accessor for table name

Returns:
table name
Throws:
DBException

table

public void table(String targetTable)
           throws DBException
set the target table

Throws:
DBException

key

public String key()
           throws DBException
Returns:
row key
Throws:
DBException

key

public void key(String key)
         throws DBException
set the row key

Throws:
DBException

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.