Package org.camunda.bpm.engine.impl
Class AuthorizationQueryImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.db.ListQueryParameterObject
-
- org.camunda.bpm.engine.impl.AbstractQuery<AuthorizationQuery,Authorization>
-
- org.camunda.bpm.engine.impl.AuthorizationQueryImpl
-
- All Implemented Interfaces:
java.io.Serializable
,AuthorizationQuery
,Command<java.lang.Object>
,Query<AuthorizationQuery,Authorization>
public class AuthorizationQueryImpl extends AbstractQuery<AuthorizationQuery,Authorization> implements AuthorizationQuery
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.camunda.bpm.engine.impl.AbstractQuery
AbstractQuery.ResultType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Integer
authorizationType
protected java.lang.String[]
groupIds
protected java.lang.String
id
protected int
permission
protected boolean
queryByPermission
protected boolean
queryByResourceType
protected java.lang.String
resourceId
protected int
resourceType
protected java.lang.String[]
userIds
-
Fields inherited from class org.camunda.bpm.engine.impl.AbstractQuery
commandExecutor, expressions, maxResultsLimitEnabled, resultType, SORTORDER_ASC, SORTORDER_DESC, validators
-
Fields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck
-
-
Constructor Summary
Constructors Constructor Description AuthorizationQueryImpl()
AuthorizationQueryImpl(CommandExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationQuery
authorizationId(java.lang.String id)
only selects authorizations for the given idAuthorizationQuery
authorizationType(java.lang.Integer type)
only selects authorizations for the given type.long
executeCount(CommandContext commandContext)
java.util.List<Authorization>
executeList(CommandContext commandContext, Page page)
Executes the actual query to retrieve the list of results.java.lang.String[]
getGroupIds()
java.lang.String
getId()
int
getPermission()
java.lang.String
getResourceId()
java.util.Set<Resource>
getResourcesIntersection()
int
getResourceType()
java.lang.String[]
getUserIds()
AuthorizationQuery
groupIdIn(java.lang.String... groupIdIn)
only selects authorizations for the given group idsprotected boolean
hasExcludingConditions()
Whether or not the query has excluding conditions.AuthorizationQuery
hasPermission(Permission p)
only selects authorizations which grant the permissions represented by the parameter.boolean
isQueryByPermission()
boolean
isQueryByResourceType()
AuthorizationQuery
orderByResourceId()
Order by resource id (needs to be followed byQuery.asc()
orQuery.desc()
).AuthorizationQuery
orderByResourceType()
Order by resource type (needs to be followed byQuery.asc()
orQuery.desc()
).AuthorizationQuery
resourceId(java.lang.String resourceId)
only selects authorizations for the given resource idAuthorizationQuery
resourceType(int resourceType)
only selects authorizations for the given resource typeAuthorizationQuery
resourceType(Resource resource)
only selects authorizations for the given resource typeAuthorizationQuery
userIdIn(java.lang.String... userIdIn)
only selects authorizations for the given user ids-
Methods inherited from class org.camunda.bpm.engine.impl.AbstractQuery
addExpression, addValidator, asc, checkMaxResultsLimit, checkQueryOk, count, desc, direction, disableMaxResultsLimit, enableMaxResultsLimit, evaluateExpressions, evaluateExpressionsAndExecuteCount, evaluateExpressionsAndExecuteDeploymentIdMappingsList, evaluateExpressionsAndExecuteIdsList, evaluateExpressionsAndExecuteList, execute, executeDeploymentIdMappingsList, executeIdsList, executeResult, executeSingleResult, extend, getExpressions, getMethod, list, listDeploymentIdMappings, listIds, listPage, mergeExpressions, mergeOrdering, orderBy, orderBy, removeValidator, setCommandExecutor, setExpressions, singleResult, unlimitedList, validate, validate
-
Methods inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getOrderingProperties, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setMaxResults, setOrderingProperties, setParameter, setTenantCheck
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.interceptor.Command
isRetryable
-
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult, unlimitedList
-
-
-
-
Field Detail
-
id
protected java.lang.String id
-
userIds
protected java.lang.String[] userIds
-
groupIds
protected java.lang.String[] groupIds
-
resourceType
protected int resourceType
-
resourceId
protected java.lang.String resourceId
-
permission
protected int permission
-
authorizationType
protected java.lang.Integer authorizationType
-
queryByPermission
protected boolean queryByPermission
-
queryByResourceType
protected boolean queryByResourceType
-
-
Constructor Detail
-
AuthorizationQueryImpl
public AuthorizationQueryImpl()
-
AuthorizationQueryImpl
public AuthorizationQueryImpl(CommandExecutor commandExecutor)
-
-
Method Detail
-
authorizationId
public AuthorizationQuery authorizationId(java.lang.String id)
Description copied from interface:AuthorizationQuery
only selects authorizations for the given id- Specified by:
authorizationId
in interfaceAuthorizationQuery
-
userIdIn
public AuthorizationQuery userIdIn(java.lang.String... userIdIn)
Description copied from interface:AuthorizationQuery
only selects authorizations for the given user ids- Specified by:
userIdIn
in interfaceAuthorizationQuery
-
groupIdIn
public AuthorizationQuery groupIdIn(java.lang.String... groupIdIn)
Description copied from interface:AuthorizationQuery
only selects authorizations for the given group ids- Specified by:
groupIdIn
in interfaceAuthorizationQuery
-
resourceType
public AuthorizationQuery resourceType(Resource resource)
Description copied from interface:AuthorizationQuery
only selects authorizations for the given resource type- Specified by:
resourceType
in interfaceAuthorizationQuery
-
resourceType
public AuthorizationQuery resourceType(int resourceType)
Description copied from interface:AuthorizationQuery
only selects authorizations for the given resource type- Specified by:
resourceType
in interfaceAuthorizationQuery
-
resourceId
public AuthorizationQuery resourceId(java.lang.String resourceId)
Description copied from interface:AuthorizationQuery
only selects authorizations for the given resource id- Specified by:
resourceId
in interfaceAuthorizationQuery
-
hasPermission
public AuthorizationQuery hasPermission(Permission p)
Description copied from interface:AuthorizationQuery
only selects authorizations which grant the permissions represented by the parameter. If this method is called multiple times, all passed-in permissions will be checked with AND semantics. Example:authorizationQuery.userId("user1") .resourceType("processDefinition") .resourceId("2313") .hasPermission(Permissions.READ) .hasPermission(Permissions.UPDATE) .hasPermission(Permissions.DELETE) .list();
Selects all Authorization objects which provide READ,UPDATE,DELETE Permissions for the given user.- Specified by:
hasPermission
in interfaceAuthorizationQuery
-
authorizationType
public AuthorizationQuery authorizationType(java.lang.Integer type)
Description copied from interface:AuthorizationQuery
only selects authorizations for the given type. Legal values:Authorization.AUTH_TYPE_GLOBAL
,Authorization.AUTH_TYPE_GRANT
Authorization.AUTH_TYPE_REVOKE
- Specified by:
authorizationType
in interfaceAuthorizationQuery
-
executeCount
public long executeCount(CommandContext commandContext)
- Specified by:
executeCount
in classAbstractQuery<AuthorizationQuery,Authorization>
-
executeList
public java.util.List<Authorization> executeList(CommandContext commandContext, Page page)
Description copied from class:AbstractQuery
Executes the actual query to retrieve the list of results.- Specified by:
executeList
in classAbstractQuery<AuthorizationQuery,Authorization>
page
- used if the results must be paged. If null, no paging will be applied.
-
hasExcludingConditions
protected boolean hasExcludingConditions()
Description copied from class:AbstractQuery
Whether or not the query has excluding conditions. If the query has excluding conditions, (e.g. task due date before and after are excluding), the SQL query is avoided and a default result is returned. The returned result is the same as if the SQL was executed and there were no entries.- Overrides:
hasExcludingConditions
in classAbstractQuery<AuthorizationQuery,Authorization>
- Returns:
true
if the query does have excluding conditions,false
otherwise
-
getId
public java.lang.String getId()
-
isQueryByPermission
public boolean isQueryByPermission()
-
getUserIds
public java.lang.String[] getUserIds()
-
getGroupIds
public java.lang.String[] getGroupIds()
-
getResourceType
public int getResourceType()
-
getResourceId
public java.lang.String getResourceId()
-
getPermission
public int getPermission()
-
isQueryByResourceType
public boolean isQueryByResourceType()
-
getResourcesIntersection
public java.util.Set<Resource> getResourcesIntersection()
-
orderByResourceType
public AuthorizationQuery orderByResourceType()
Description copied from interface:AuthorizationQuery
Order by resource type (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByResourceType
in interfaceAuthorizationQuery
-
orderByResourceId
public AuthorizationQuery orderByResourceId()
Description copied from interface:AuthorizationQuery
Order by resource id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByResourceId
in interfaceAuthorizationQuery
-
-