public abstract class AbstractOAuthManagerGenerator extends AbstractOAuthAdapterGenerator implements ModuleGenerator
ACCESS_CODE_PATTERN_FIELD_NAME, AUTH_CODE_PATTERN_FIELD_NAME, AUTHORIZE_METHOD_NAME, CONSUMER_FIELD_NAME, context, ENCODING, EXPIRATION_FIELD_NAME, EXPIRATION_TIME_PATTERN_FIELD_NAME, FETCH_ACCESS_TOKEN_METHOD_NAME, GRANT_TYPE, HAS_TOKEN_EXPIRED_METHOD_NAME, MULE_CONTEXT_FIELD_NAME, OAUTH_RESTORE_ACCESS_TOKEN_CALLBACK_FIELD_NAME, OAUTH_SAVE_ACCESS_TOKEN_CALLBACK_FIELD_NAME, OAUTH_VERIFIER_FIELD_NAME, ON_NO_TOKEN_POLICY_FIELD_NAME, REFRESH_TOKEN_FIELD_NAME, REFRESH_TOKEN_PATTERN_FIELD_NAME, REQUEST_TOKEN_FIELD_NAME, REQUEST_TOKEN_SECRET_FIELD_NAME, RESET_METHOD_NAME, VERIFIER_FIELD_NAME
Constructor and Description |
---|
AbstractOAuthManagerGenerator() |
Modifier and Type | Method and Description |
---|---|
protected void |
callGenerator(Module module,
AbstractOAuthAdapterGenerator oauthAdapterGenerator)
Generation of the adapter, code lives here to reduce the dependency between generators (Adapter vs Manager..).
|
List<Product> |
consumes() |
protected abstract void |
doGenerate(Module module,
GeneratedClass oAuthManagerClass)
Hook method to implement the custom core behaviour of the manager anything the concrete object to generate the adapter (either for OAuth1 or OAuth2)
|
void |
generate(Module module)
Template method that subclasses must not override
|
protected void |
generateLoggerMethod(GeneratedClass oauthManagerClass)
|
protected abstract AbstractOAuthAdapterGenerator |
getAdapterGenerator()
Returns the concrete object to generate the adapter (either for OAuth1 or OAuth2)
TODO: It must be refactored to avoid calling a generator from another generator, but this will imply adding more dependencies in the CONSUMES/PRODUCES mechanism
|
protected abstract TypeReference |
getExtendManagerClass()
Returns the concrete class to be used a superclass of the generated Manager (either for OAuth1 or OAuth2)
|
List<Product> |
produces() |
authorizationCodeField, ctx, generateAccessTokenUrlField, generateAuthorizationUrlField, generateCatchAndReThrow, generateCatchAndReThrow, generateCreateConsumerMethod, generateFieldForBoolean, generateFieldForMessageProcessor, generateFieldForString, generateHasBeenAuthorizedMethod, generateInitialiseMethod, generateLoggerField, generateOAuth1AuthorizeMethod, generateOAuth2AuthorizeMethod, generateOnNoTokenPolicyField, generateProvider, generateRequestTokenUrlField, getOAuthAdapterClass, getterMethodForFieldAnnotatedWith, muleContextField, ref, ref, ref, ref, restoreAccessTokenCallbackField, saveAccessTokenCallbackField, setCtx
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
shouldGenerate
public List<Product> consumes()
consumes
in interface Generator
consumes
in class AbstractOAuthAdapterGenerator
public List<Product> produces()
produces
in interface Generator
produces
in class AbstractOAuthAdapterGenerator
public void generate(Module module) throws GenerationException
generate
in interface ModuleGenerator
module
- GenerationException
protected abstract TypeReference getExtendManagerClass()
protected abstract AbstractOAuthAdapterGenerator getAdapterGenerator()
protected abstract void doGenerate(Module module, GeneratedClass oAuthManagerClass) throws GenerationException
module
- oAuthManagerClass
- GenerationException
protected void callGenerator(Module module, AbstractOAuthAdapterGenerator oauthAdapterGenerator) throws GenerationException
module
- oauthAdapterGenerator
- GenerationException
protected void generateLoggerMethod(GeneratedClass oauthManagerClass)
BaseOAuth2Manager.getLogger()
if using OAuth2
,
or BaseOAuth1Manager.getLogger()
if using OAuth
oauthManagerClass
- generated subclass of BaseOAuth2Manager
or BaseOAuth1Manager
Copyright © 2010–2015 MuleSoft, Inc.. All rights reserved.