org.tentackle.appworx
Class AppDbObjectClassVariables

java.lang.Object
  extended by org.tentackle.db.DbObjectClassVariables
      extended by org.tentackle.appworx.AppDbObjectClassVariables

public class AppDbObjectClassVariables
extends DbObjectClassVariables

Extends DbObjectClassVariables for AppDbObjects.

Author:
harald

Field Summary
 int allInContextCursorStatementId
          prepared statement ID for AppDbObject.selectAllInContextCursor()
 int allInContextStatementId
          prepared statement ID for AppDbObject.selectAllInContext()
 boolean checkSecurity
          Flag is true to check the security rules for each access to objects of this class.
 int normTextCursorStatementId
          prepared statement ID for AppDbObject.selectByNormTextCursor(java.lang.String)
 int normTextStatementId
          prepared statement ID for AppDbObject.selectByNormText(java.lang.String)
 int selectEditedByStatementId
          prepared statement ID for select in AppDbObject.updateEditedBy(java.sql.Timestamp, long, java.sql.Timestamp)
 int transferEditedByStatementId
          prepared statement ID for AppDbObject.transferEditedBy(long)
 int updateEditedByOnlyStatementId
          prepared statement ID for AppDbObject.updateEditedByOnly()
 int updateEditedByStatementId
          prepared statement ID for AppDbObject.updateEditedBy(java.sql.Timestamp, long, java.sql.Timestamp)
 
Fields inherited from class org.tentackle.db.DbObjectClassVariables
alwaysPrepare, classBaseName, className, clazz, deleteStatementId, dummyUpdateStatementId, expirationBacklog, fieldCount, idSourceId, insertStatementId, instanceCount, multiName, properties, remoteDelegateId, selectAllStatementId, selectExpiredTableSerials1StatementId, selectExpiredTableSerials2StatementId, selectLockedStatementId, selectSerialStatementId, selectStatementId, singleName, tableName, updateSerialAndTableSerialStatementId, updateSerialStatementId, updateStatementId, updateTableSerialStatementId
 
Constructor Summary
AppDbObjectClassVariables(Class<? extends AppDbObject> clazz, String tableName, String singleName, String multiName)
          Constructs a classvariable.
AppDbObjectClassVariables(Class<? extends AppDbObject> clazz, String tableName, String singleName, String multiName, boolean checkSecurity)
          constructs a classvariable
 
Method Summary
 boolean isReadAllowed()
          Check the read security for this class in all contexts.
 boolean isReadAllowed(AppDbObject object)
          Check the read security for a single object.
<T extends AppDbObject,C extends Collection<T>>
C
isReadAllowed(C objects)
          Checks the read security for a collection of objects of this class.
The returned collection is of the same type as the original collection.
 boolean isReadAllowed(ContextDb contextDb)
          Check the read security for this class.
 boolean isWriteAllowed()
          Check the write security for this class in all contexts.
 boolean isWriteAllowed(AppDbObject object)
          Check the write security for a single object.
<T extends AppDbObject,C extends Collection<T>>
C
isWriteAllowed(C objects)
          Checks the write security for a collection of objects of this class.
The returned collection is of the same type as the original collection.
 boolean isWriteAllowed(ContextDb contextDb)
          Check the write security for this class.
 
Methods inherited from class org.tentackle.db.DbObjectClassVariables
countInstance, getProperty, getRemoteDelegate, getRemoteDelegateId, getVariables, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

checkSecurity

public final boolean checkSecurity
Flag is true to check the security rules for each access to objects of this class. The rules will be checked in local db access only (i.e. the check will be applied already at the RMI-side *before* the data is leaving the client!) Because this check can be somewhat time consuming, it's turned off by default. The flag cannot be changed at runtime anymore!


normTextStatementId

public int normTextStatementId
prepared statement ID for AppDbObject.selectByNormText(java.lang.String)


allInContextStatementId

public int allInContextStatementId
prepared statement ID for AppDbObject.selectAllInContext()


normTextCursorStatementId

public int normTextCursorStatementId
prepared statement ID for AppDbObject.selectByNormTextCursor(java.lang.String)


allInContextCursorStatementId

public int allInContextCursorStatementId
prepared statement ID for AppDbObject.selectAllInContextCursor()


updateEditedByStatementId

public int updateEditedByStatementId
prepared statement ID for AppDbObject.updateEditedBy(java.sql.Timestamp, long, java.sql.Timestamp)


updateEditedByOnlyStatementId

public int updateEditedByOnlyStatementId
prepared statement ID for AppDbObject.updateEditedByOnly()


selectEditedByStatementId

public int selectEditedByStatementId
prepared statement ID for select in AppDbObject.updateEditedBy(java.sql.Timestamp, long, java.sql.Timestamp)


transferEditedByStatementId

public int transferEditedByStatementId
prepared statement ID for AppDbObject.transferEditedBy(long)

Constructor Detail

AppDbObjectClassVariables

public AppDbObjectClassVariables(Class<? extends AppDbObject> clazz,
                                 String tableName,
                                 String singleName,
                                 String multiName,
                                 boolean checkSecurity)
constructs a classvariable

Parameters:
clazz - is the class of the derived DbObject
tableName - is the SQL tablename
singleName - text for a single object
multiName - text for multiple objects
checkSecurity - is true to check the READ/WRITE-Security on each access.

AppDbObjectClassVariables

public AppDbObjectClassVariables(Class<? extends AppDbObject> clazz,
                                 String tableName,
                                 String singleName,
                                 String multiName)
Constructs a classvariable. By default, the security check is turned on for servers. It can be overwridden by the property "checksecurity=on|off|true|false|enabled|disabled|0|1" in the class property file.

Parameters:
clazz - is the class of the derived DbObject
tableName - is the SQL tablename
singleName - text for a single object
multiName - text for multiple objects
Method Detail

isReadAllowed

public boolean isReadAllowed(ContextDb contextDb)
Check the read security for this class. The implementation checks that the class rules will accept and that no object rule denies.

Notice that Security objects are always readable!

Parameters:
contextDb - the current context, null = all
Returns:
false if operation (select) is denied.

isReadAllowed

public boolean isReadAllowed()
Check the read security for this class in all contexts.

Returns:
false if operation (select) is denied.

isWriteAllowed

public boolean isWriteAllowed(ContextDb contextDb)
Check the write security for this class. The implementation checks that the class rules will accept and that no object rule denies.

Parameters:
contextDb - the current context, null = all
Returns:
false if operation (delete, update or insert) is denied.

isWriteAllowed

public boolean isWriteAllowed()
Check the write security for this class in all contexts.

Returns:
false if operation (delete, update or insert) is denied.

isReadAllowed

public boolean isReadAllowed(AppDbObject object)
Check the read security for a single object.

Notice that Security objects are always readable!

Parameters:
object - the object to check the security rules for.
Returns:
false if operation (select) is denied.

isWriteAllowed

public boolean isWriteAllowed(AppDbObject object)
Check the write security for a single object.

Parameters:
object - the object to check the security rules for.
Returns:
false if operation (delete, update or insert) is denied.

isReadAllowed

public <T extends AppDbObject,C extends Collection<T>> C isReadAllowed(C objects)
Checks the read security for a collection of objects of this class.
The returned collection is of the same type as the original collection. Notice that this method is provided for applications that circumvent readFromResultsetWrapper() somehow (which checks the read permission). Tentackle is not using this method.

Notice that Security objects are always readable!

Type Parameters:
T - AppDbObject class
C - Collection class
Parameters:
objects - the collection to check the security rules for.
Returns:
the objects with permission accepted.

isWriteAllowed

public <T extends AppDbObject,C extends Collection<T>> C isWriteAllowed(C objects)
Checks the write security for a collection of objects of this class.
The returned collection is of the same type as the original collection. Notice that this method is provided for applications that circumvent deleteObject, updateObject or insertObject somehow (all of them check the write permission). Tentackle is not using this method. Furthermore, special care must be taken for "deleteBy..." methods that delete objects by an sql-statement via "DELETE ...".

Type Parameters:
T - AppDbObject class
C - Collection class
Parameters:
objects - the collection to check the security rules for.
Returns:
the objects with permission accepted.


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de