public class DatabaseMethodsImpl extends Object implements DatabaseMethods, PermissionChecker
DatabaseMethods
and PermissionChecker
.Constructor and Description |
---|
DatabaseMethodsImpl() |
Modifier and Type | Method and Description |
---|---|
void |
check(Permission permission,
DBObject dBObject)
Check if a permission is available on a database object.
|
boolean |
check(Permission permission,
DBObject dBObject,
boolean permissionRequired)
Check if a permission is available on a database object.
|
void |
check(Permission permission,
Surrogate surrogate)
Check if a permission is available on a database object.
|
boolean |
check(Permission permission,
Surrogate surrogate,
boolean permissionRequired)
Check if a permission is available on a database object.
|
void |
checkIntegrity(DBObject object,
Surrogate s,
Surrogate referrer)
Throw an exception if the DBObject is null.
|
Surrogate |
makeSurrogate(Database db,
DBObjectType dot,
DBObjectId id)
Create a surrogate for a database object.
|
Surrogate |
makeSurrogate(DBObject dBObject,
DBObjectId id)
Create a surrogate for a database object.
|
public void checkIntegrity(DBObject object, Surrogate s, Surrogate referrer) throws T2DBException
object
- an objects
- its surrogatereferrer
- the surrogate of the object's referrer or nullT2DBException
public Surrogate makeSurrogate(Database db, DBObjectType dot, DBObjectId id)
DatabaseMethods
makeSurrogate
in interface DatabaseMethods
db
- the database of the objectdot
- the type of the objectid
- the internal ID of the database objectpublic Surrogate makeSurrogate(DBObject dBObject, DBObjectId id)
DatabaseMethods
makeSurrogate
in interface DatabaseMethods
dBObject
- a database objectid
- the internal ID of the database objectpublic boolean check(Permission permission, DBObject dBObject, boolean permissionRequired) throws T2DBException
PermissionChecker
permissionRequired
throw an exception or return false on
failure.check
in interface PermissionChecker
permission
- a permissiondBObject
- a database objectpermissionRequired
- if true throw an exception on failure else return falseT2DBException
public void check(Permission permission, DBObject dBObject) throws T2DBException
PermissionChecker
check
in interface PermissionChecker
permission
- a permissiondBObject
- a database objectT2DBException
public boolean check(Permission permission, Surrogate surrogate, boolean permissionRequired) throws T2DBException
PermissionChecker
permissionRequired
throw an exception or return false on
failure.check
in interface PermissionChecker
permission
- a permissionsurrogate
- a surrogate identifying a database objectpermissionRequired
- if true throw an exception on failure else return falseT2DBException
public void check(Permission permission, Surrogate surrogate) throws T2DBException
PermissionChecker
check
in interface PermissionChecker
permission
- a permissionsurrogate
- if true throw an exception on failure else return falseT2DBException
Copyright © 2017. All rights reserved.