|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.dataobjects.BaseDataObject
com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
com.jcorporate.expresso.core.dbobj.DBObject
com.jcorporate.expresso.core.dbobj.SecuredDBObject
A database object can be stored in a table (or tables), can be retrieved, and various other operations Specific database objects extend this object
| Nested Class Summary |
| Nested classes inherited from class com.jcorporate.expresso.core.dbobj.DBObject |
DBObject.FieldError, DBObject.FieldUpdate |
| Field Summary | |
static String |
ADD
Field constants for add update search and delete functionality. |
static String[] |
ALL_FUNCTIONS
all possible manipution functions |
protected static String |
CACHE_NAME
Cache name for the system security |
protected static long |
CACHE_TTY
Cache Default Expiration Default value of 30 minutes. |
static String |
DELETE
Designates a Delete Operation |
static String |
SEARCH
Desginates an Search Operation |
static int |
SYSTEM_ACCOUNT
Used in the constructor. |
static String |
SYSTEM_ACCOUNT_NAME
Used in the deprecated constructor. |
static String |
UPDATE
Designates an Update Operation |
| 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 | |
SecuredDBObject()
Constructor |
|
SecuredDBObject(ControllerRequest request)
Constructor that sets user ID and data context from request |
|
SecuredDBObject(DBConnection newConnection)
Constructor that sets the connection on create |
|
SecuredDBObject(DBConnection theConnection,
int theUser)
Constructor: Specify a DB connection AND user id |
|
SecuredDBObject(DBConnection newConnection,
String setupTablesContext)
Constructor that sets a connection as the object is created - typically this is used when a particular DBConnection is required for the purposes of maintaining a database transaction. |
|
SecuredDBObject(int newUid)
Constructor: Specify a DB connection AND user |
|
SecuredDBObject(RequestContext request)
For using DBObjects within Controllers. |
|
SecuredDBObject(String dbKey,
int theUser)
Alternate form of constructor, specifying the db name/context and the user at once |
|
| Method Summary | |
void |
add()
If the user is allowed to add, invoke the superclass add |
boolean |
canRequesterAdd()
determine if getRequestingUid has rights to add this kind of object (not just this particular object, but ALL INSTANCES of this kind of object) |
boolean |
canRequesterDelete()
determine if getRequestingUid has rights to delete this kind of object (not just this particular object, but ALL INSTANCES of this kind of object) |
boolean |
canRequesterRead()
determine if getRequestingUid has rights to read this kind of object (not just this particular object, but ALL INSTANCES of this kind of object) |
boolean |
canRequesterUpdate()
determine if getRequestingUid has rights to update this kind of object (not just this particular object, but ALL INSTANCES of this kind of object) |
boolean |
checkAllowed(String requestedFunction)
See if the current user has permission to perform the permissions |
void |
copyAttributes(DBObject returnObj)
this method should make sure that the 'returnObj' object is properly initialized with copied UID and data context as this (parent) object |
int |
count()
Security check on count |
protected void |
createSecurityCache()
Creates the security caches Synchronized to provide thread safety since this is accessing a system-wide object. |
void |
delete()
Delete a record from the target table |
void |
deleteAll()
Security check on deleteAll |
boolean |
find()
Just like retrieve, but works with any fields, not just the key field. |
int |
getRequestingUid()
New version of "setUser()", returns the integer UID of the permissions this dbobject is operating under |
protected String |
getString(String stringCode)
Convenience method of the above with no arguments |
protected String |
getString(String stringCode,
Object[] args)
Convenience method to get a local language string from within any SecuredDBObject by using the user's language perferences automatically |
protected String |
getString(String stringCode,
String arg1)
Convenience method of the above without array arguments |
protected String |
getString(String stringCode,
String arg1,
String arg2)
Convenience method of the above without array arguments |
protected String |
getString(String stringCode,
String arg1,
String arg2,
String arg3)
Convenience method of the above without array arguments |
protected String |
getString(String stringCode,
String arg1,
String arg2,
String arg3,
String arg4)
Convenience method of the above without array arguments |
int |
getSystemUid()
Retrieve the uid of the 'System Account' |
static SecuredDBObject |
instantiate(String className)
Convenience factory method to create a SecuredDBObject object from it's name |
void |
isAllowed(String requestedFunction)
See if the current user of this DB object is allowed to perform the requested function, given the function's code. |
void |
retrieve()
Get a particular record from the database into this object's fields Assumes that the key fields are set to the key of the object to be retrieved |
void |
search()
Find a set of keys of all of the objects that match the current search critieria in the fields Assumes that the fields are populated with search criteria instead of data NOTE: Criteria in 'text' type colums is ignored (SQL Server limitation) |
ArrayList |
searchAndRetrieveList()
Find a set of records of all of the objects that match the current search critieria in the fields and retrieve the list of all records that match this criteria NOTE: Criteria in 'text' type colums is ignored (SQL Server limitation) |
ArrayList |
searchAndRetrieveList(String sortKeys)
Find a set of records of all of the objects that match the current search critieria in the fields and retrieve the list of all records that match this criteria NOTE: Criteria in 'text' type colums is ignored (SQL Server limitation) |
void |
setRequestingUid(int newUid)
New version of "setUser()" to to speak. |
void |
update()
Update the database with the new info |
| 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 |
public static final int SYSTEM_ACCOUNT
public static final String SYSTEM_ACCOUNT_NAME
protected static final String CACHE_NAME
protected static final long CACHE_TTY
public static final String ADD
public static final String DELETE
public static final String SEARCH
public static final String UPDATE
public static final String[] ALL_FUNCTIONS
| Constructor Detail |
public SecuredDBObject()
throws DBException
public SecuredDBObject(DBConnection newConnection)
throws DBException
newConnection - The dbConnection object to associate with this
object
public SecuredDBObject(DBConnection newConnection,
String setupTablesContext)
throws DBException
This constructor is neceesary to work with otherDBMap and transaction capabilities
newConnection - The DBConnection to utilizesetupTablesContext - The data context that contains the setup (and
security) tables for this object
public SecuredDBObject(ControllerRequest request)
throws DBException
request - the request from which to set user, context
DBException - upon construction error
public SecuredDBObject(int newUid)
throws DBException
newUid - User ID attempting to use this object.
If this is SecuredDBObject.SYSTEM_ACCOUNT, then
full permissions are granted. Note that you cannot log in
as SecuredDBObject.SYSTEM_ACCOUNT,
t can only be used from within a method.
DBException - If the object cannot be created
public SecuredDBObject(DBConnection theConnection,
int theUser)
throws DBException
theConnection - A DBConnection that this object should
use to connect to the databasetheUser - User name attempting to use this object.
If this is "SYSTEM", then
full permissions are granted. Note that you cannot log in
as "SYSTEM", it can only be used from within a method.
DBException - If the object cannot be created
public SecuredDBObject(RequestContext request)
throws DBException
request - - The controller request handed to you by the framework.
DBException - if there's an error constructing the SecuredDBObject
public SecuredDBObject(String dbKey,
int theUser)
throws DBException
dbKey - db/Context key for the context being requestedtheUser - User id of the user requesting access| Method Detail |
public void setRequestingUid(int newUid)
setRequestingUid in interface SecurablenewUid - Sets the UID for this DBObject. Used for security checks.public int getRequestingUid()
getRequestingUid in interface Securable
public void add()
throws DBException
add in interface DataObjectadd in class DBObjectDBException - If the user is not permitted to add
or if the add fails
public boolean checkAllowed(String requestedFunction)
throws DBException
checkAllowed in class DBObjectrequestedFunction - (A)dd, (U)pdate, (D)elete, (S)earch
DBException - upon error.isAllowed(java.lang.String)
public void delete()
throws DBException
delete in interface DataObjectdelete in class DBObjectDBException - if delete is not allowed for the current userto delete objects identified by non-key fields
public boolean find()
throws DBException
find in interface DataObjectfind in class DBObjectDBException - if search is not allowed
protected void createSecurityCache()
throws CacheException
CacheException - if there's an error creating the cache or
adding the listeners.
public void isAllowed(String requestedFunction)
throws SecurityException,
DBException
isAllowed in interface SecurablerequestedFunction - The code of the requested function. The codes are:
DBException - If the requested operation is not permitted to this user
SecurityException - if the user is not allowedpublic int getSystemUid()
public void retrieve()
throws DBException
retrieve in class DBObjectDBException - if search is not allowed or if no record is foundDBObject.find()
public void search()
throws DBException
search in class DBObjectDBException - if search is not allowed for the current user
public ArrayList searchAndRetrieveList()
throws DBException
searchAndRetrieveList in interface DataObjectsearchAndRetrieveList in class DBObjectDBException - if search is not allowed for the current user
public ArrayList searchAndRetrieveList(String sortKeys)
throws DBException
searchAndRetrieveList in interface DataObjectsearchAndRetrieveList in class DBObjectsortKeys - A list of field names, seperated by pipes,
that determine the order
in which the records retrieved are sorted
DBException - if search is not allowed for the current user
public void update()
throws DBException
update in interface DataObjectupdate in class DBObjectDBException - if update is not allowed for the current userDBObject.update(boolean)
protected String getString(String stringCode,
Object[] args)
throws DBException
stringCode - The string code in the MessagesBundle to retrieveargs - The i18n formatting arguments which equals the standard arguments
for a normal Java i18n APi
DBException - if there's an error recovering the message string.
public static SecuredDBObject instantiate(String className)
throws DBException
className - The classname to instantiate of this DBObject.
DBException - if there's an error constructing the DBOBject
protected String getString(String stringCode)
throws DBException
stringCode - The string code to retrieve from the MessagesBundle.
DBException - if there's an error retrieving the text
protected String getString(String stringCode,
String arg1)
throws DBException
arg1 - Formatting Argument #1stringCode - The string code to retrieve from the MessagesBundle.
DBException - if there's an error retrieving the text
protected String getString(String stringCode,
String arg1,
String arg2)
throws DBException
stringCode - The string code to retrieve from the MessagesBundle.arg1 - Formatting Argument #1arg2 - Formatting Argument #2
DBException - if there's an error retrieving the text
protected String getString(String stringCode,
String arg1,
String arg2,
String arg3)
throws DBException
stringCode - The string code to retrieve from the MessagesBundle.arg1 - Formatting Argument #1arg2 - Formatting Argument #2arg3 - Formatting Argument #3
DBException - if there's an error retrieving the text
protected String getString(String stringCode,
String arg1,
String arg2,
String arg3,
String arg4)
throws DBException
stringCode - The string code to retrieve from the MessagesBundle.arg1 - Formatting Argument #1arg2 - Formatting Argument #2arg3 - Formatting Argument #3arg4 - Formatting Argument #4
DBException - if there's an error retrieving the text
public void copyAttributes(DBObject returnObj)
throws DBException
copyAttributes in class DBObjectreturnObj - the object to copy the attributes into.
DBException - upon error
public int count()
throws DBException
count in interface DataObjectcount in class DBObjectDBException - or security exception
if search permissions is not allowed
public void deleteAll()
throws DBException
deleteAll in class DBObjectDBException - upon error
public boolean canRequesterRead()
throws DBException
DBException - upon database communication error
public boolean canRequesterAdd()
throws DBException
DBException - upon database communication error
public boolean canRequesterDelete()
throws DBException
DBException - upon database communication error
public boolean canRequesterUpdate()
throws DBException
DBException - upon database communication error
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||