org.mule.security.oauth
Enum OnNoTokenPolicy

java.lang.Object
  extended by java.lang.Enum<OnNoTokenPolicy>
      extended by org.mule.security.oauth.OnNoTokenPolicy
All Implemented Interfaces:
Serializable, Comparable<OnNoTokenPolicy>

public enum OnNoTokenPolicy
extends Enum<OnNoTokenPolicy>

This enum specifies the behavior to take when an OAuth protected operation is executed before the authorization is performed


Enum Constant Summary
EXCEPTION
          This policy throws a NotAuthorizedException
STOP_FLOW
          This policy returns null which means that the processor chain should stop and the rest of the processors should not be executed.
 
Method Summary
abstract  MuleEvent handleNotAuthorized(Object source, org.mule.common.security.oauth.exception.NotAuthorizedException e, MuleEvent event)
          This method handles a NotAuthorizedException according to each policy
static OnNoTokenPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static OnNoTokenPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

EXCEPTION

public static final OnNoTokenPolicy EXCEPTION
This policy throws a NotAuthorizedException


STOP_FLOW

public static final OnNoTokenPolicy STOP_FLOW
This policy returns null which means that the processor chain should stop and the rest of the processors should not be executed. It behaves similarly to a message filter

Method Detail

values

public static OnNoTokenPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (OnNoTokenPolicy c : OnNoTokenPolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static OnNoTokenPolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

handleNotAuthorized

public abstract MuleEvent handleNotAuthorized(Object source,
                                              org.mule.common.security.oauth.exception.NotAuthorizedException e,
                                              MuleEvent event)
                                       throws org.mule.common.security.oauth.exception.NotAuthorizedException
This method handles a NotAuthorizedException according to each policy

Parameters:
source - the unauthorized connector
e - the exception thrown
event - the current mule event
Returns:
the same event that was received or a new/modified one. It could also return null to signal that the chain execution should stop
Throws:
org.mule.common.security.oauth.exception.NotAuthorizedException - if the policy decides to simply bubble up the exception


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.