|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.connection.BaseTransaction
com.metamatrix.platform.security.authorization.spi.jdbc.JDBCAuthorizationTransaction
public class JDBCAuthorizationTransaction
Method Summary | |
---|---|
void |
addPermissionsWithResourcesToParent(java.lang.String parent,
java.util.Collection resources,
AuthorizationRealm realm)
Add the given resources as AuthorizationPermission s to existing
AuthorizationPolicies that have a permission with the given parent
as a resource. |
boolean |
containsPolicy(AuthorizationPolicyID id)
Return whether there is an existing policy with the specified ID. |
java.util.Set |
executeActions(AuthorizationPolicyID targetPolicyID,
java.util.List actions,
java.lang.String grantor)
Execute the actions on given object. |
void |
executeBatch(java.lang.String sql,
java.util.List paramData)
|
java.util.Collection |
findAllPolicyIDs()
Locate the IDs of all of the policies that are accessible by the caller. |
java.util.Collection |
findPolicyIDs(java.util.Collection principals)
Locate the IDs of all of the policies that apply to the specified principals. |
java.util.Collection |
findPolicyIDs(java.util.Collection principals,
AuthorizationRealm realm)
Locate the IDs of all of the policies that apply to the specified principals and are in the given realm. |
java.util.Collection |
getDependantPermissions(AuthorizationPermission request)
Get the collection of permissions whose resources are dependant on the given permision. |
java.util.Map |
getElementEntitlements(AuthorizationRealm realm,
java.lang.String elementNamePattern)
Returns a compound List of entitlements to the given fully qualified
element in the given realm. |
java.util.Map |
getGroupEntitlements(AuthorizationRealm realm,
java.lang.String fullyQualifiedGroupName)
Returns a compound List of entitlements to the given fully qualified
group in the given realm. |
java.util.Set |
getPermissionsForPolicy(AuthorizationPolicyID policyID)
Find and create all AuthorizationPermissionsImpl known to a policy. |
java.util.Collection |
getPolicies(java.util.Collection policyIDs)
Locate the policies that have the specified IDs. |
AuthorizationPolicy |
getPolicy(AuthorizationPolicyID policyID)
Locate the policy that has the specified ID. |
java.util.Collection |
getPolicyIDsForResourceInRealm(AuthorizationRealm realm,
java.lang.String resourceName)
Returns a Collection of AuthorizationPolicyID s
that have AuthorizationPermissionsImpl on the given resource that
exists in the given AuthorizationRealm . |
java.util.Collection |
getPolicyIDsInPartialRealm(AuthorizationRealm realm)
Returns a Collection of AuthorizationPolicyID s
that have AuthorizationPermissionsImpl that exist in the given
AuthorizationRealm .The implementation is such that all AuthorizationPolicyID s
whose AuthorizationRealm AuthorizationRealm are returned. |
java.util.Collection |
getPolicyIDsInRealm(AuthorizationRealm realm)
Returns a Collection of AuthorizationPolicyID s
in the given AuthorizationRealm . |
java.util.Collection |
getPolicyIDsWithPermissionsInRealm(AuthorizationRealm realm)
Returns a Collection of AuthorizationPolicyID s
that have AuthorizationPermission s in the given AuthorizationRealm .NOTE: It is the responsibility of the caller to determine which of the AuthorizationPolicy 's AuthorizationPermission s
are actually in the given AuthorizationRealm . |
protected java.lang.Number |
getPolicyUID(AuthorizationPolicyID policyID)
Get the Database UID for the given policID. |
java.util.Collection |
getPrincipalsForRole(java.lang.String roleName)
Returns a collection MetaMatrixPrincipalName objects containing the name
of the principal along with its type which belong to the given role. |
java.util.Collection |
getRealmNames()
Obtain the names of all of the realms known to the system. |
protected java.lang.Number |
getRealmUID(AuthorizationRealm realm)
|
java.util.Map |
getRoleDescriptions()
Returns a Map of String Metamatrix role names to String descriptions of each role. |
java.util.Collection |
getRoleNamesForPrincipal(java.util.Collection principals)
Returns a Collection of String names of MetaMatrix roles which the given principal belongs to |
protected void |
removePermissionsForRealm(java.lang.Number realmUID)
Remove entries from AUTHPERMISSIONS for the specified realm |
void |
removePermissionsWithResources(java.util.Collection resources,
AuthorizationRealm realm)
Remove all permissions in the system that are on the given resources. |
protected void |
removePoliciesForRealm(AuthorizationRealm realm)
Remove entries from AUTHPOLICIES for the specified realm |
boolean |
removePrincipalFromAllPolicies(MetaMatrixPrincipalName principal)
Remove given Principal from AuthorizationPolicies to
which he belongs. |
void |
removePrincipalsAndPoliciesForRealm(AuthorizationRealm realm)
Remove entries from AUTHREALM, AUTHPERMISSIONS, AUTHPOLICIES, AUTHPRINCIPALS for the specified realm |
protected void |
removePrincipalsForRealm(AuthorizationRealm realm)
Remove entries from AUTHPRINCIPALS for the specified realm |
protected void |
removeRealm(java.lang.Number realmUID)
Remove the specified entry from AUTHREALM |
Methods inherited from class com.metamatrix.common.connection.BaseTransaction |
---|
close, commit, finalize, getConnection, getRollbackOnFinalize, isClosed, isEnded, isReadonly, rollback, setRollbackOnFinalize |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.metamatrix.platform.security.authorization.spi.AuthorizationSourceTransaction |
---|
close |
Methods inherited from interface com.metamatrix.common.connection.TransactionInterface |
---|
commit, isClosed, isReadonly, rollback |
Method Detail |
---|
public void addPermissionsWithResourcesToParent(java.lang.String parent, java.util.Collection resources, AuthorizationRealm realm) throws AuthorizationSourceConnectionException, AuthorizationSourceException
AuthorizationPermission
s to existing
AuthorizationPolicies
that have a permission with the given parent
as a resource. Use the parent's AuthorizationActions
to create
the permission for each resource.
addPermissionsWithResourcesToParent
in interface AuthorizationSourceTransaction
parent
- The uuid of the resource that will be the parent of the given
resources.resources
- The uuids of the newly added resources.realm
- Confine the resources to this realm.
AuthorizationSourceConnectionException
AuthorizationSourceException
public void removePermissionsWithResources(java.util.Collection resources, AuthorizationRealm realm) throws AuthorizationSourceConnectionException, AuthorizationSourceException
removePermissionsWithResources
in interface AuthorizationSourceTransaction
resources
- The resource names of the resources to be removed.realm
- Confines the resource names to this realm.
AuthorizationSourceConnectionException
AuthorizationSourceException
public java.util.Collection getDependantPermissions(AuthorizationPermission request) throws AuthorizationSourceConnectionException, AuthorizationSourceException
AuthorizationRealm
of the given request.
getDependantPermissions
in interface AuthorizationSourceTransaction
request
- The permission for which to find dependants.
AuthorizationSourceConnectionException
AuthorizationSourceException
public java.util.Map getGroupEntitlements(AuthorizationRealm realm, java.lang.String fullyQualifiedGroupName) throws AuthorizationSourceConnectionException, AuthorizationSourceException
List
of entitlements to the given fully qualified
group in the given realm.
The returned List
will be comprised of a List
s of 6 elements.MetaMatrixPrincipalName
getGroupEntitlements
in interface AuthorizationSourceTransaction
realm
- The realm in which the group must live.fullyQualifiedGroupName
- The resource for which to look up permissions.
List
of entitlements to the given group in the
given realm - May be empty but never null.
AuthorizationSourceConnectionException
- if there is an error communicating with the source.
AuthorizationSourceException
- if there is an unspecified error.public java.util.Map getElementEntitlements(AuthorizationRealm realm, java.lang.String elementNamePattern) throws AuthorizationSourceConnectionException, AuthorizationSourceException
List
of entitlements to the given fully qualified
element in the given realm.
The returned List
will be comprised of a List
s of 7 elements.MetaMatrixPrincipalName
getElementEntitlements
in interface AuthorizationSourceTransaction
realm
- The realm in which the element must live.elementNamePattern
- The resource for which to look up permissions.
List
of entitlements to the given element in the
given realm - May be empty but never null.
AuthorizationSourceConnectionException
- if there is an error communicating with the source.
AuthorizationSourceException
- if there is an unspecified error.public java.util.Collection getRealmNames() throws AuthorizationSourceConnectionException, AuthorizationSourceException
getRealmNames
in interface AuthorizationSourceTransaction
AuthorizationSourceConnectionException
AuthorizationSourceException
public java.util.Map getRoleDescriptions() throws AuthorizationSourceConnectionException, AuthorizationSourceException
getRoleDescriptions
in interface AuthorizationSourceTransaction
AuthorizationSourceConnectionException
- if there is an error communicating with the source.
AuthorizationSourceException
- if there is an unspecified error.public java.util.Collection getPrincipalsForRole(java.lang.String roleName) throws AuthorizationSourceConnectionException, AuthorizationSourceException
MetaMatrixPrincipalName
objects containing the name
of the principal along with its type which belong to the given role.
MetaMatrixPrincipalName
getPrincipalsForRole
in interface AuthorizationSourceTransaction
roleName
- String name of MetaMatrix role for which principals
are sought
MetaMatrixPrincipalName
s who are in the given role, possibly enpty, never null.
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection getRoleNamesForPrincipal(java.util.Collection principals) throws AuthorizationSourceConnectionException, AuthorizationSourceException
getRoleNamesForPrincipal
in interface AuthorizationSourceTransaction
principals
- MetaMatrixPrincipalName
s of a principal and
any group memberships for which roles are sought
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public boolean containsPolicy(AuthorizationPolicyID id) throws AuthorizationSourceConnectionException, AuthorizationSourceException
containsPolicy
in interface AuthorizationSourceTransaction
id
- the ID that is to be checked
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection findAllPolicyIDs() throws AuthorizationSourceConnectionException, AuthorizationSourceException
findAllPolicyIDs
in interface AuthorizationSourceTransaction
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection getPolicyIDsWithPermissionsInRealm(AuthorizationRealm realm) throws AuthorizationSourceConnectionException, AuthorizationSourceException
Collection
of AuthorizationPolicyID
s
that have AuthorizationPermission
s in the given AuthorizationRealm
.AuthorizationPolicy
's AuthorizationPermission
s
are actually in the given AuthorizationRealm
. The AuthorizationPolicy
may span AuthorizationRealm
s.
getPolicyIDsWithPermissionsInRealm
in interface AuthorizationSourceTransaction
realm
- The realm in which to search for AuthorizationPermission
s.
AuthorizationPolicyID
s that have permissions
in the given realm - possibly empty but never null.
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection getPolicyIDsInRealm(AuthorizationRealm realm) throws AuthorizationSourceConnectionException, AuthorizationSourceException
Collection
of AuthorizationPolicyID
s
in the given AuthorizationRealm
.
AuthorizationPolicy
's AuthorizationPermission
s
are actually in the given AuthorizationRealm
. The AuthorizationPolicy
may span AuthorizationRealm
s.
getPolicyIDsInRealm
in interface AuthorizationSourceTransaction
realm
- The realm in which to search for AuthorizationPermission
s.
AuthorizationPolicyID
s that have permissions
in the given realm - possibly empty but never null.
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection getPolicyIDsInPartialRealm(AuthorizationRealm realm) throws AuthorizationSourceConnectionException, AuthorizationSourceException
Collection
of AuthorizationPolicyID
s
that have AuthorizationPermissionsImpl
that exist in the given
AuthorizationRealm
.AuthorizationPolicyID
s
whose AuthorizationRealm
AuthorizationRealm
are returned.
getPolicyIDsInPartialRealm
in interface AuthorizationSourceTransaction
realm
- The AuthorizationPermission
s whose realm name AuthorizationPolicyID
s that have permissions
in the given partial realm - possibly empty but never null.
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection findPolicyIDs(java.util.Collection principals, AuthorizationRealm realm) throws AuthorizationSourceConnectionException, AuthorizationSourceException
findPolicyIDs
in interface AuthorizationSourceTransaction
principals
- the Set of MetaMatrixPrincipalName
to whom
the returned policies should apply to (may not null, empty or invalid,
all of which would result in an empty result).realm
- The applicable realm in which to search for policies.
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection findPolicyIDs(java.util.Collection principals) throws AuthorizationSourceConnectionException, AuthorizationSourceException
findPolicyIDs
in interface AuthorizationSourceTransaction
principals
- the Set of MetaMatrixPrincipalName
to whom
the returned policies should apply to (may not null, empty or invalid,
all of which would result in an empty result).
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection getPolicyIDsForResourceInRealm(AuthorizationRealm realm, java.lang.String resourceName) throws AuthorizationSourceConnectionException, AuthorizationSourceException
Collection
of AuthorizationPolicyID
s
that have AuthorizationPermissionsImpl
on the given resource that
exists in the given AuthorizationRealm
.
getPolicyIDsForResourceInRealm
in interface AuthorizationSourceTransaction
realm
- The realm in which to search for AuthorizationPermission
s.resourceName
- The resource for which to search for AuthorizationPermission
s.
AuthorizationPolicyID
s that have permissions
on the given resource - possibly empty but never null.
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Collection getPolicies(java.util.Collection policyIDs) throws AuthorizationSourceConnectionException, AuthorizationSourceException
getPolicies
in interface AuthorizationSourceTransaction
policyIDs
- the policy IDs for which the policies are to be obtained
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public AuthorizationPolicy getPolicy(AuthorizationPolicyID policyID) throws AuthorizationSourceConnectionException, AuthorizationSourceException
getPolicy
in interface AuthorizationSourceTransaction
policyID
- the ID of the policy to be obtained
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Set getPermissionsForPolicy(AuthorizationPolicyID policyID) throws AuthorizationSourceConnectionException, AuthorizationSourceException
AuthorizationPermissionsImpl
known to a policy.
getPermissionsForPolicy
in interface AuthorizationSourceTransaction
policyID
- The policy indentifier.
AuthorizationSourceConnectionException
AuthorizationSourceException
public boolean removePrincipalFromAllPolicies(MetaMatrixPrincipalName principal) throws AuthorizationSourceConnectionException, AuthorizationSourceException
AuthorizationPolicies
to
which he belongs.
removePrincipalFromAllPolicies
in interface AuthorizationSourceTransaction
principal
- MetaMatrixPrincipalName
which should be deleted.
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public java.util.Set executeActions(AuthorizationPolicyID targetPolicyID, java.util.List actions, java.lang.String grantor) throws AuthorizationSourceConnectionException, AuthorizationSourceException, AuthorizationSourceException
executeActions
in interface AuthorizationSourceTransaction
targetPolicyID
- The ID of the policy on which to execute the transactions.actions
- The list of actions to execute.grantor
- The principal name of the policy grantor.
AuthorizationSourceConnectionException
- if there is an connection
or communication error with the data source, signifying that
the method should be retried with a different connection.
AuthorizationSourceException
- if there is an unspecified or unknown
error with the data source.public void removePrincipalsAndPoliciesForRealm(AuthorizationRealm realm) throws AuthorizationSourceException
removePrincipalsAndPoliciesForRealm
in interface AuthorizationSourceTransaction
realm
-
java.sql.SQLException
AuthorizationSourceException
protected void removePermissionsForRealm(java.lang.Number realmUID) throws java.sql.SQLException
realmUID
-
java.sql.SQLException
protected void removeRealm(java.lang.Number realmUID) throws java.sql.SQLException
realmUID
-
java.sql.SQLException
protected void removePrincipalsForRealm(AuthorizationRealm realm) throws java.sql.SQLException
realmUID
-
java.sql.SQLException
protected void removePoliciesForRealm(AuthorizationRealm realm) throws java.sql.SQLException
realmUID
-
java.sql.SQLException
protected java.lang.Number getPolicyUID(AuthorizationPolicyID policyID) throws AuthorizationSourceException, java.sql.SQLException
AuthorizationSourceException
java.sql.SQLException
protected java.lang.Number getRealmUID(AuthorizationRealm realm) throws AuthorizationSourceException
AuthorizationSourceException
public void executeBatch(java.lang.String sql, java.util.List paramData) throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |