public class Clients extends InitializableObject
This class is made to group multiple clients using a specific parameter to distinguish them, generally on one callback url.
The InitializableObject.init()
method is used to initialize the callback urls of the clients from the callback url of the
clients group if empty and a specific parameter added to define the client targeted. It is implicitly called by the
"finders" methods and doesn't need to be called explicitly.
The findClient(WebContext)
, findClient(String)
or findClient(Class)
methods must be called
to find the right client according to the input context or type. The findAllClients()
method returns all the
clients.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CLIENT_NAME_PARAMETER |
Constructor and Description |
---|
Clients() |
Clients(Client... clients) |
Clients(Client client) |
Clients(List<Client> clients) |
Clients(String callbackUrl,
Client... clients) |
Clients(String callbackUrl,
Client client) |
Clients(String callbackUrl,
List<Client> clients) |
Modifier and Type | Method and Description |
---|---|
void |
addAuthorizationGenerator(AuthorizationGenerator authorizationGenerator) |
List<Client> |
findAllClients()
Find all the clients.
|
<C extends Client> |
findClient(Class<C> clazz)
Return the right client according to the specific class.
|
Client |
findClient(String name)
Return the right client according to the specific name.
|
Client |
findClient(WebContext context)
Return the right client according to the web context.
|
AjaxRequestResolver |
getAjaxRequestResolver() |
List<AuthorizationGenerator> |
getAuthorizationGenerators() |
String |
getCallbackUrl() |
String |
getClientNameParameter() |
List<Client> |
getClients() |
Client |
getDefaultClient() |
UrlResolver |
getUrlResolver() |
protected void |
internalInit()
Initialize all clients by computing callback urls if necessary.
|
void |
setAjaxRequestResolver(AjaxRequestResolver ajaxRequestResolver) |
void |
setAuthorizationGenerator(AuthorizationGenerator authorizationGenerator) |
void |
setAuthorizationGenerators(AuthorizationGenerator... authorizationGenerators) |
void |
setAuthorizationGenerators(List<AuthorizationGenerator> authorizationGenerators) |
void |
setCallbackUrl(String callbackUrl) |
void |
setClientNameParameter(String clientNameParameter) |
void |
setClients(Client... clients) |
void |
setClients(List<Client> clients) |
void |
setDefaultClient(Client defaultClient)
Set the default client (can be
null ). |
void |
setUrlResolver(UrlResolver urlResolver) |
String |
toString() |
protected void |
updateCallbackUrlOfIndirectClient(IndirectClient indirectClient)
Sets a client's Callback URL, if not already set.
|
init, reinit
public static final String DEFAULT_CLIENT_NAME_PARAMETER
public Clients()
public Clients(Client... clients)
public Clients(Client client)
protected void internalInit()
internalInit
in class InitializableObject
protected void updateCallbackUrlOfIndirectClient(IndirectClient indirectClient)
indirectClient
- A client.public Client findClient(WebContext context)
context
- web contextpublic Client findClient(String name)
name
- name of the clientpublic <C extends Client> C findClient(Class<C> clazz)
C
- the kind of clientclazz
- class of the clientpublic String getClientNameParameter()
public void setClientNameParameter(String clientNameParameter)
public String getCallbackUrl()
public void setCallbackUrl(String callbackUrl)
public void setClients(Client... clients)
public void setDefaultClient(Client defaultClient)
null
). If not null
, it must exist in the list of clients.defaultClient
- the default client to definepublic Client getDefaultClient()
public AjaxRequestResolver getAjaxRequestResolver()
public void setAjaxRequestResolver(AjaxRequestResolver ajaxRequestResolver)
public UrlResolver getUrlResolver()
public void setUrlResolver(UrlResolver urlResolver)
public List<AuthorizationGenerator> getAuthorizationGenerators()
public void setAuthorizationGenerators(List<AuthorizationGenerator> authorizationGenerators)
public void setAuthorizationGenerators(AuthorizationGenerator... authorizationGenerators)
public void setAuthorizationGenerator(AuthorizationGenerator authorizationGenerator)
public void addAuthorizationGenerator(AuthorizationGenerator authorizationGenerator)
Copyright © 2018. All rights reserved.