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 |
---|---|
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.
|
String |
getCallbackUrl() |
String |
getClientNameParameter() |
List<Client> |
getClients() |
Client |
getDefaultClient() |
protected void |
internalInit()
Initialize all clients by computing callback urls if necessary.
|
void |
setCallbackUrl(String callbackUrl) |
void |
setClientNameParameter(String clientNameParameter) |
void |
setClients(Client... clients) |
void |
setClients(List<Client> clients) |
void |
setClientsList(List<Client> clients)
Deprecated.
|
void |
setDefaultClient(Client defaultClient) |
String |
toString() |
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
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)
@Deprecated public void setClientsList(List<Client> clients)
setClients(List)
instead.clients
- the clients to setpublic void setClients(Client... clients)
public void setDefaultClient(Client defaultClient)
public Client getDefaultClient()
Copyright © 2016. All rights reserved.