Package org.opensaml.profile.action.impl

# Class CheckAccess

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.impl.CheckAccess

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`

public class CheckAccess extends AbstractProfileAction
This action validates that a request comes from an authorized client, based on an injected service and policy parameters.

Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.ACCESS_DENIED`

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private Function<ProfileRequestContext,String>`
`operationLookupStrategy`
Lookup strategy for operation.
`private Function<ProfileRequestContext,String>`
`policyNameLookupStrategy`
Lookup strategy for policy to apply.
`private Function<ProfileRequestContext,String>`
`resourceLookupStrategy`
Lookup strategy for resource.
`private AccessControlService`
`service`
Access control service.

## Constructor Summary

Constructors
Constructor
Description
`CheckAccess()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`doExecute(ProfileRequestContext profileRequestContext)`
Performs this action.
`protected void`
`doInitialize()`
`void`
`setAccessControlService(AccessControlService acs)`
Set the service to use.
`void`
`setOperation(String op)`
Set operation.
`void`
`setOperationLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set a lookup strategy to use to obtain the operation.
`void`
`setPolicyName(String name)`
Set an explicit policy name to apply.
`void`
`setPolicyNameLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set a lookup strategy to use to obtain the policy name to apply.
`void`
`setResource(String res)`
Set resource.
`void`
`setResourceLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set a lookup strategy to use to obtain the resource.

### Methods inherited from class org.opensaml.profile.action.AbstractProfileAction

`doPostExecute, doPostExecute, doPreExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### service

@NonnullAfterInit private AccessControlService service
Access control service.

### policyNameLookupStrategy

@Nonnull private Function<ProfileRequestContext,String> policyNameLookupStrategy
Lookup strategy for policy to apply.

### operationLookupStrategy

@Nonnull private Function<ProfileRequestContext,String> operationLookupStrategy
Lookup strategy for operation.

### resourceLookupStrategy

@Nonnull private Function<ProfileRequestContext,String> resourceLookupStrategy
Lookup strategy for resource.

## Constructor Details

### CheckAccess

public CheckAccess()
Constructor.

## Method Details

### setAccessControlService

public void setAccessControlService(@Nonnull AccessControlService acs)
Set the service to use.

Parameters:
  `acs` - service to use

### setPolicyNameLookupStrategy

public void setPolicyNameLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
Set a lookup strategy to use to obtain the policy name to apply.

Parameters:
  `strategy` - lookup strategy
Since:
  3.3.0

### setPolicyName

public void setPolicyName(@Nonnull @NotEmpty String name)
Set an explicit policy name to apply.

Parameters:
  `name` - policy name

### setOperationLookupStrategy

public void setOperationLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
Set a lookup strategy to use to obtain the operation.

Parameters:
  `strategy` - lookup strategy
Since:
  3.3.0

### setOperation

public void setOperation(@Nullable String op)
Set operation.

Parameters:
  `op` - operation

### setResourceLookupStrategy

public void setResourceLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
Set a lookup strategy to use to obtain the resource.

Parameters:
  `strategy` - lookup strategy
Since:
  3.3.0

### setResource

public void setResource(@Nullable String res)
Set resource.

Parameters:
  `res` - resource

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### doExecute

public void doExecute(@Nonnull ProfileRequestContext profileRequestContext)
Performs this action. Actions must override this method to perform their work.

Overrides:
  `doExecute` in class `AbstractProfileAction`
Parameters:
  `profileRequestContext` - the current IdP profile request context