C
- as AbstractConfiguration
type@Path(value="/") @Consumes(value={"application/json","application/text","text/html"}) @Produces(value="application/json;charset=utf-8") @Secured(value={"ROLE_USER","ROLE_ADMIN"}) public class DynamicConfigService<C extends AbstractConfiguration> extends SiteAuthorizableSecurableService
getService()
.deriveContextNameSpacePrefix
.audit, authorizationModule
applicationContext, CACHE, NO_CACHE, request, response
Constructor and Description |
---|
DynamicConfigService() |
DynamicConfigService(boolean checkAuthFiltered) |
Modifier and Type | Method and Description |
---|---|
void |
addEdit(String namespace,
String name,
String value) |
void |
clearCache(String namespace) |
boolean |
delete(String namespace,
String name) |
boolean |
edit(String namespace,
String name,
String value,
Integer status) |
Map |
get(String namespace) |
javax.ws.rs.core.Response |
get(String namespace,
String name) |
protected String |
getContextNameSpace(String contextNameSpacePrefix,
String namespace) |
protected <T> T |
getContextNameSpaceConfig(Function<String,Object> f)
Override, to override all Context based namespace derived config behavior.
|
Function<javax.servlet.http.HttpServletRequest,String> |
getDeriveContextNameSpacePrefix()
An optional
Function that converts super.request HttpServletRequest into a default context namespace,
and prefixes it to any namespace specified. |
String |
getDynamic(String namespace,
String name) |
Function<String,C> |
getInstanceFactory()
For a namespace or null return an
AbstractConfiguration type |
protected String |
getModuleName()
If Service uses
SiteAuthorizableSecurableService.getUserAuths(User) or SiteAuthorizableSecurableService.getCurrentUserAuths() then a module name is required to be supplied. |
javax.ws.rs.core.Response |
getProperty(String springId,
String name) |
ConfigurationService<String,String,C> |
getService() |
void |
init() |
protected javax.ws.rs.core.Response |
searchProperty(String propertyName)
Search all properties files for property
|
protected boolean |
set(String namespace,
String name,
String value,
Integer status) |
void |
setDeriveContextNameSpacePrefix(Function<javax.servlet.http.HttpServletRequest,String> deriveContextNameSpacePrefix)
An optional
Function that converts super.request HttpServletRequest into a default context namespace,
and prefixes it to any namespace specified. |
void |
setInstanceFactory(Function<String,C> instanceFactory)
For a namespace or null return an
AbstractConfiguration type |
void |
setService(ConfigurationService<String,String,C> service) |
adminCheck, getAuthorizableIdAssignable, getAuthorizableService, getAuthorizationModule, getCurrentUserAuths, getUser, getUserAuths, isAdmin, isUser, setAuthorizationModule
filter, getAuthorizableId, getAuthorizations, setAuthorizableId, setAuthorizations
checkAuthFilterInvoked, query
filter, getCacheDef, getTestString, query
public DynamicConfigService()
public DynamicConfigService(boolean checkAuthFiltered)
protected <T> T getContextNameSpaceConfig(Function<String,Object> f)
deriveContextNameSpacePrefix
.Function
f, that accepts the contextNameSpace
and returns the final config value for the context. (String or Response)>f
- as Function
takes in String (context namsespace) and returns the same output as this function.adapter (For default behavior)
,
(For default behavior)
protected String getContextNameSpace(String contextNameSpacePrefix, String namespace)
@GET @Path(value="get/{namespace}/{name}") @Consumes(value="text/plain") @Produces(value="text/plain") public javax.ws.rs.core.Response get(@PathParam(value="namespace") String namespace, @PathParam(value="name") String name) throws Exception
Exception
protected javax.ws.rs.core.Response searchProperty(String propertyName) throws Exception
propertyName
- as StringException
@GET @Path(value="get-dynamic/{namespace}/{name}") @Consumes(value="text/plain") @Produces(value="text/plain") public String getDynamic(@PathParam(value="namespace") String namespace, @PathParam(value="name") String name) throws Exception
Exception
@GET @Path(value="get-property/{springId}/{name}") @Consumes(value="text/plain") @Produces(value="text/plain") public javax.ws.rs.core.Response getProperty(@PathParam(value="springId") String springId, @PathParam(value="name") String name) throws Exception
Exception
@GET @Path(value="get/{namespace}") @Consumes(value="text/plain") @Produces(value="application/json") public Map get(@PathParam(value="namespace") String namespace) throws Exception
Exception
@PostConstruct public void init()
protected boolean set(String namespace, String name, String value, Integer status) throws Exception
Exception
@PUT @Path(value="admin/edit/{namespace}/{name}") @Consumes(value="text/plain") @Produces(value="text/plain") public boolean edit(@PathParam(value="namespace") String namespace, @PathParam(value="name") String name, @QueryParam(value="value") String value, @QueryParam(value="status") Integer status) throws Exception
Exception
@PUT @Path(value="admin/addEdit/{namespace}/{name}") @Consumes(value="text/plain") public void addEdit(@PathParam(value="namespace") String namespace, @PathParam(value="name") String name, @QueryParam(value="value") String value) throws Exception
Exception
@DELETE @Path(value="admin/delete/{namespace}/{name}") @Consumes(value="text/plain") @Produces(value="text/plain") public boolean delete(@PathParam(value="namespace") String namespace, @PathParam(value="name") String name) throws Exception
Exception
@PUT @Path(value="admin/clearcache/{namespace}") @Consumes(value="text/plain") public void clearCache(@PathParam(value="namespace") String namespace) throws Exception
Exception
protected String getModuleName()
SiteAuthorizableSecurableService.getUserAuths(User)
or SiteAuthorizableSecurableService.getCurrentUserAuths()
then a module name is required to be supplied.getModuleName
in class SiteAuthorizableSecurableService
public Function<String,C> getInstanceFactory()
AbstractConfiguration
type public void setInstanceFactory(Function<String,C> instanceFactory)
AbstractConfiguration
type public ConfigurationService<String,String,C> getService()
public void setService(ConfigurationService<String,String,C> service)
public Function<javax.servlet.http.HttpServletRequest,String> getDeriveContextNameSpacePrefix()
Function
that converts super.request HttpServletRequest
into a default context namespace,
and prefixes it to any namespace specified. Effective namespace = <context_namespace>.<supplied_namespace>
.Function
returns null; then it will skip and rely on the supplied default name.public void setDeriveContextNameSpacePrefix(Function<javax.servlet.http.HttpServletRequest,String> deriveContextNameSpacePrefix)
Function
that converts super.request HttpServletRequest
into a default context namespace,
and prefixes it to any namespace specified. Effective namespace = <context_namespace>.<supplied_namespace>
.Function
returns null; then it will skip and rely on the supplied default name.Copyright © 2018. All rights reserved.