public class DfaAxisLoginTokensHelper extends Object implements LoginTokensHelper
LoginTokensHelper
for Axis.Constructor and Description |
---|
DfaAxisLoginTokensHelper(DfaServiceClientFactory dfaServiceClientFactory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
authenticate(String username,
String password,
Class<?> loginClass,
Object loginService)
Authenticates against the DFA API.
|
Class<?> |
getLoginClass(String stubPackage)
Retrieves the
Class object representing the login service. |
Object |
getLoginService(DfaSession session,
Class<?> loginClass)
Returns a
DfaServiceClient wrapping the login service. |
Class<?> |
getUserProfileClass(String stubPackage)
Retrieves the
Class object representing user profiles. |
String |
retrieveToken(Object userProfile)
Retrieves the user's authentication token from the
UserProfile
returned by the DFA API. |
@Inject public DfaAxisLoginTokensHelper(DfaServiceClientFactory dfaServiceClientFactory)
dfaServiceClientFactory
- the DFA service client factorypublic Class<?> getLoginClass(String stubPackage) throws ClassNotFoundException
Class
object representing the login service.getLoginClass
in interface LoginTokensHelper
stubPackage
- the package where all generated stubs are locatedClass
object representing the login serviceClassNotFoundException
- if the class cannot be resolvedpublic Class<?> getUserProfileClass(String stubPackage) throws ClassNotFoundException
Class
object representing user profiles.getUserProfileClass
in interface LoginTokensHelper
stubPackage
- the package where all generated stubs are locatedClass
object representing user profilesClassNotFoundException
- if the class cannot be resolvedpublic Object getLoginService(DfaSession session, Class<?> loginClass)
DfaServiceClient
wrapping the login service.getLoginService
in interface LoginTokensHelper
session
- the DFA sessionloginClass
- the Class
type of the login servicepublic Object authenticate(String username, String password, Class<?> loginClass, Object loginService) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
authenticate
in interface LoginTokensHelper
username
- the usernamepassword
- the passwordloginClass
- the Class
type of the login serviceloginService
- a service client object wrapping the login serviceUserProfile
response from the APIIllegalArgumentException
- if one of the arguments used in
authenticating is not allowedIllegalAccessException
- if the authenticate
method cannot be
accessedInvocationTargetException
- if an error occurs while invoking the
authenticate
methodNoSuchMethodException
- if the authenticate method
cannot be
locatedpublic String retrieveToken(Object userProfile) throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, IllegalAccessException
UserProfile
returned by the DFA API.retrieveToken
in interface LoginTokensHelper
userProfile
- the UserProfile
object returned by the APIClassNotFoundException
- if the UserProfile
class cannot be
locatedInvocationTargetException
- if an error occurs while invoking
getToken
on the given objectNoSuchMethodException
- if the getToken
method cannot be
found.IllegalAccessException
- if the getToken
method cannot be
accessed.Copyright © 2015. All Rights Reserved.