public class ClientAppConfig
extends org.springframework.extensions.surf.util.AbstractLifecycleBean
The naming convention must confirm to the following:
repo.client-app.<client-name>.<propertyName>
Also, the client-name or property name (<propertyName>) must not contain a dot ('.')
Note also, that any property without a value is ignored and the client will not be registered if all the properties of that client have no values.
So, if a new client (e.g. MyClientName) is required to send a shared-link email and the service or the API requires, for example, sharedLinkBaseUrl and templateAssetsUrl properties, then the following needs to be put into a properties file.
Modifier and Type | Class and Description |
---|---|
static class |
ClientAppConfig.ClientApp |
Modifier and Type | Field and Description |
---|---|
static String |
PREFIX |
static String |
PROP_TEMPLATE_ASSETS_URL |
Constructor and Description |
---|
ClientAppConfig() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
getAndMergeProperties()
Converts and merges the given Java properties into a
java.util.Map . |
ClientAppConfig.ClientApp |
getClient(String name)
Returns the named client or null if no client exists with the given name.
|
Map<String,ClientAppConfig.ClientApp> |
getClients()
Returns an unmodifiable view of the clients map.
|
void |
init() |
protected void |
onBootstrap(org.springframework.context.ApplicationEvent event) |
protected void |
onShutdown(org.springframework.context.ApplicationEvent event) |
protected Map<String,ClientAppConfig.ClientApp> |
processClients(Set<String> clientsNames,
Set<String> propsNames,
Map<String,String> allProps)
Processes the given properties and if the properties' values are valid, creates
a map of
ClientApp with the client's name as the key. |
protected void |
processPropertyKeys(Map<String,String> allProps,
Set<String> clientsNames,
Set<String> propsNames)
Processes the property's key and extracts the clients' names.
|
void |
setDefaultProperties(Properties defaultProperties) |
void |
setGlobalProperties(Properties globalProperties) |
public static final String PREFIX
public static final String PROP_TEMPLATE_ASSETS_URL
public void setDefaultProperties(Properties defaultProperties)
public void setGlobalProperties(Properties globalProperties)
public void init()
public Map<String,ClientAppConfig.ClientApp> getClients()
public ClientAppConfig.ClientApp getClient(String name)
name
- the name of the client to retrieveprotected void onBootstrap(org.springframework.context.ApplicationEvent event)
onBootstrap
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
protected void onShutdown(org.springframework.context.ApplicationEvent event)
onShutdown
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
protected void processPropertyKeys(Map<String,String> allProps, Set<String> clientsNames, Set<String> propsNames)
allProps
- the merged propertiesclientsNames
- a set of strings which will be populated with client namespropsNames
- a set of strings which will be populated with properties names (i.e.the property after the client name)protected Map<String,ClientAppConfig.ClientApp> processClients(Set<String> clientsNames, Set<String> propsNames, Map<String,String> allProps)
ClientApp
with the client's name as the key.clientsNames
- the processed clients' namespropsNames
- the processed properties namesallProps
- the merged propertiesClientApp
with the client's name as the key.Copyright © 2005–2017 Alfresco Software. All rights reserved.