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(org.mule.devkit.model.module.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(org.mule.devkit.model.module.Module module,
org.mule.devkit.model.code.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(org.mule.devkit.model.module.Module module)
Template method that subclasses must not override
|
protected void |
generateLoggerMethod(org.mule.devkit.model.code.GeneratedClass oauthManagerClass)
Implementation in the generated manager class to fulfill the contract within
BaseOAuth2Manager.getLogger() if using OAuth2,
or BaseOAuth1Manager.getLogger() if using OAuth |
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 org.mule.devkit.model.code.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, generateHasBeenAuthorizedMethod, generateInitialiseMethod, generateLoggerField, generateOAuth1AuthorizeMethod, generateOAuth2AuthorizeMethod, generateOnNoTokenPolicyField, generateRequestTokenUrlField, getOAuthAdapterClass, ref, ref, ref, ref, restoreAccessTokenCallbackField, saveAccessTokenCallbackField, setCtxclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitshouldGeneratepublic List<Product> consumes()
consumes in interface Generatorconsumes in class AbstractOAuthAdapterGeneratorpublic List<Product> produces()
produces in interface Generatorproduces in class AbstractOAuthAdapterGeneratorpublic void generate(org.mule.devkit.model.module.Module module) throws GenerationException
generate in interface ModuleGeneratormodule - GenerationExceptionprotected abstract org.mule.devkit.model.code.TypeReference getExtendManagerClass()
protected abstract AbstractOAuthAdapterGenerator getAdapterGenerator()
protected abstract void doGenerate(org.mule.devkit.model.module.Module module, org.mule.devkit.model.code.GeneratedClass oAuthManagerClass) throws GenerationException
module - oAuthManagerClass - GenerationExceptionprotected void callGenerator(org.mule.devkit.model.module.Module module, AbstractOAuthAdapterGenerator oauthAdapterGenerator) throws GenerationException
module - oauthAdapterGenerator - GenerationExceptionprotected void generateLoggerMethod(org.mule.devkit.model.code.GeneratedClass oauthManagerClass)
BaseOAuth2Manager.getLogger() if using OAuth2,
or BaseOAuth1Manager.getLogger() if using OAuthoauthManagerClass - generated subclass of BaseOAuth2Manager or BaseOAuth1ManagerCopyright © 2010–2017 MuleSoft, Inc.. All rights reserved.