|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.security.provider.RDBMPermissionImpl
public class RDBMPermissionImpl
Reference implementation of IPermissionStore. Performs CRUD operations on the UP_Permission table.
Field Summary | |
---|---|
private static java.lang.String |
ACTIVITY_COLUMN
|
private static java.lang.String |
allPermissionColumnsSql
|
private static java.lang.String |
deletePermissionSql
|
private static java.lang.String |
EFFECTIVE_COLUMN
|
private static java.lang.String |
EXPIRES_COLUMN
|
private static java.lang.String |
findPermissionSql
|
private static java.lang.String |
insertPermissionSql
|
private static org.apache.commons.logging.Log |
log
|
private static java.lang.String |
OWNER_COLUMN
|
private static java.lang.String |
PERMISSION_TABLE
|
private static java.lang.String |
PRINCIPAL_KEY_COLUMN
|
private static java.lang.String |
PRINCIPAL_SEPARATOR
|
private static java.lang.String |
PRINCIPAL_TYPE_COLUMN
|
private static java.lang.String |
selectPermissionSql
|
private static RDBMPermissionImpl |
singleton
|
private static java.lang.String |
TARGET_COLUMN
|
private static boolean |
timestampHasMillis
|
private static java.lang.String |
TYPE_COLUMN
|
private static java.lang.String |
updatePermissionSql
|
Constructor Summary | |
---|---|
RDBMPermissionImpl()
RDBMReferencePermission constructor comment. |
Method Summary | |
---|---|
void |
add(IPermission perm)
Add the IPermission to the store. |
void |
add(IPermission[] perms)
Add the IPermissions to the store. |
void |
delete(IPermission perm)
Delete a single IPermission from the store. |
void |
delete(IPermission[] perms)
Delete the IPermissions from the store. |
boolean |
existsInDatabase(IPermission perm)
Answer if this entity exists in the database. |
private static java.lang.String |
getAllPermissionColumnsSql()
|
private static java.lang.String |
getDeletePermissionSql()
|
private static java.lang.String |
getFindPermissionSql()
Insert the method's description here. |
private static java.lang.String |
getInsertPermissionSql()
|
private java.lang.String |
getPrincipalKey(IPermission perm)
Returns the principal key portion of the IPermission principal. |
private java.lang.String |
getPrincipalKey(java.lang.String principalString)
Returns the principal key portion of the IPermission principal. |
private int |
getPrincipalType(IPermission perm)
Returns the principal type portion of the IPermission principal. |
private int |
getPrincipalType(java.lang.String principalString)
Returns the principal type portion of the principal. |
private static java.lang.String |
getSelectPermissionSql()
|
private static long |
getTimestampMillis(java.sql.Timestamp ts)
|
private static java.lang.String |
getUpdatePermissionSql()
|
private IPermission |
instanceFromResultSet(java.sql.ResultSet rs)
|
IPermission |
newInstance(java.lang.String owner)
Factory method for IPermissions |
private void |
primAdd(IPermission[] perms)
Add the IPermissions to the store. |
private void |
primAdd(IPermission perm,
java.sql.PreparedStatement ps)
Set the params on the PreparedStatement and execute the insert. |
private void |
primDelete(IPermission[] perms)
Delete the IPermissions from the store. |
private int |
primDelete(IPermission perm,
java.sql.PreparedStatement ps)
Set the params on the PreparedStatement and execute the delete. |
private void |
primUpdate(IPermission[] perms)
Update the IPermissions in the store. |
private int |
primUpdate(IPermission perm,
java.sql.PreparedStatement ps)
Set the params on the PreparedStatement and execute the update. |
IPermission[] |
select(java.lang.String owner,
java.lang.String principal,
java.lang.String activity,
java.lang.String target,
java.lang.String type)
Select the Permissions from the store. |
static RDBMPermissionImpl |
singleton()
|
void |
update(IPermission perm)
Update a single IPermission in the store. |
void |
update(IPermission[] perms)
Update the IPermissions in the store. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private static RDBMPermissionImpl singleton
private static boolean timestampHasMillis
private static java.lang.String PERMISSION_TABLE
private static java.lang.String OWNER_COLUMN
private static java.lang.String PRINCIPAL_TYPE_COLUMN
private static java.lang.String PRINCIPAL_KEY_COLUMN
private static java.lang.String ACTIVITY_COLUMN
private static java.lang.String TARGET_COLUMN
private static java.lang.String TYPE_COLUMN
private static java.lang.String EFFECTIVE_COLUMN
private static java.lang.String EXPIRES_COLUMN
private static java.lang.String allPermissionColumnsSql
private static java.lang.String deletePermissionSql
private static java.lang.String findPermissionSql
private static java.lang.String insertPermissionSql
private static java.lang.String selectPermissionSql
private static java.lang.String updatePermissionSql
private static java.lang.String PRINCIPAL_SEPARATOR
Constructor Detail |
---|
public RDBMPermissionImpl()
Method Detail |
---|
public void add(IPermission[] perms) throws AuthorizationException
add
in interface IPermissionStore
perms
- org.jasig.portal.security.IPermission[]
AuthorizationException
- - wraps an Exception specific to the store.public void add(IPermission perm) throws AuthorizationException
add
in interface IPermissionStore
perm
- org.jasig.portal.security.IPermission
AuthorizationException
- - wraps an Exception specific to the store.public void delete(IPermission[] perms) throws AuthorizationException
delete
in interface IPermissionStore
perms
- org.jasig.portal.security.IPermission[]
AuthorizationException
- - wraps an Exception specific to the store.public void delete(IPermission perm) throws AuthorizationException
delete
in interface IPermissionStore
perm
- org.jasig.portal.security.IPermission
AuthorizationException
- - wraps an Exception specific to the store.public boolean existsInDatabase(IPermission perm) throws AuthorizationException, java.sql.SQLException
perm
- org.jasig.portal.security.IPermission
java.sql.SQLException
AuthorizationException
private static java.lang.String getAllPermissionColumnsSql()
private static java.lang.String getDeletePermissionSql()
private static java.lang.String getFindPermissionSql()
private static java.lang.String getInsertPermissionSql()
private java.lang.String getPrincipalKey(java.lang.String principalString)
principalString
-
private java.lang.String getPrincipalKey(IPermission perm) throws AuthorizationException
perm
- org.jasig.portal.security.IPermission
AuthorizationException
private int getPrincipalType(java.lang.String principalString)
principalString
-
private int getPrincipalType(IPermission perm) throws AuthorizationException
perm
- org.jasig.portal.security.IPermission
AuthorizationException
private static java.lang.String getSelectPermissionSql()
private static java.lang.String getUpdatePermissionSql()
private IPermission instanceFromResultSet(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- java.sql.ResultSet
java.sql.SQLException
public IPermission newInstance(java.lang.String owner)
newInstance
in interface IPermissionStore
private void primAdd(IPermission[] perms) throws java.lang.Exception
perms
- org.jasig.portal.security.IPermission[]
java.lang.Exception
private void primAdd(IPermission perm, java.sql.PreparedStatement ps) throws java.lang.Exception
perm
- org.jasig.portal.security.IPermissionps
- java.sql.PreparedStatement - the PreparedStatement for inserting a Permission row.
java.lang.Exception
private void primDelete(IPermission[] perms) throws java.lang.Exception
perms
- org.jasig.portal.security.IPermission[]
java.lang.Exception
private int primDelete(IPermission perm, java.sql.PreparedStatement ps) throws java.lang.Exception
perm
- org.jasig.portal.security.IPermissionps
- java.sql.PreparedStatement - the PreparedStatement for deleting a Permission row.
java.lang.Exception
private void primUpdate(IPermission[] perms) throws java.lang.Exception
perms
- org.jasig.portal.security.IPermission[]
java.lang.Exception
private int primUpdate(IPermission perm, java.sql.PreparedStatement ps) throws java.lang.Exception
perm
- org.jasig.portal.security.IPermissionps
- java.sql.PreparedStatement - the PreparedStatement for updating a Permission row.
java.lang.Exception
public IPermission[] select(java.lang.String owner, java.lang.String principal, java.lang.String activity, java.lang.String target, java.lang.String type) throws AuthorizationException
select
in interface IPermissionStore
owner
- String - the Permission ownerprincipal
- String - the Permission principalactivity
- String - the Permission activitytarget
- String - the Permission targettype
- String - the Permission type
AuthorizationException
- - wraps an Exception specific to the store.public static RDBMPermissionImpl singleton()
public void update(IPermission[] perms) throws AuthorizationException
update
in interface IPermissionStore
perms
- org.jasig.portal.security.IPermission[]
AuthorizationException
- - wraps an Exception specific to the store.public void update(IPermission perm) throws AuthorizationException
update
in interface IPermissionStore
perm
- org.jasig.portal.security.IPermission
AuthorizationException
- - wraps an Exception specific to the store.private static long getTimestampMillis(java.sql.Timestamp ts)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |