Package com.jalios.jcms.rest
Class RestManager
- java.lang.Object
-
- com.jalios.jcms.rest.RestManager
-
public class RestManager extends java.lang.Object
Hold JCMS configuration of OpenAPI. RestResource may be added.- Since:
- JCMS-6.0
- Author:
- dissert
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPKEY_ENABLE
static java.lang.String
PROPKEY_READACCESS_ENABLE
static java.lang.String
PROPKEY_READACCESS_IPFILTER
static java.lang.String
PROPKEY_WRITEACCESS_ENABLE
static java.lang.String
PROPKEY_WRITEACCESS_IPFILTER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResource()
void
addResourcesMap(Plugin plugin, java.util.Map<java.lang.String,java.lang.Class<? extends JcmsRestResource>> resourcesMap)
boolean
checkReadAccessIP(java.lang.String ip)
Returns true if the given IP address is authorized for read for REST request.boolean
checkWriteAccessIP(java.lang.String ip)
Returns true if the given IP address is authorized for write for REST request.java.util.Map<Plugin,java.util.Map<java.lang.String,java.lang.Class<? extends JcmsRestResource>>>
getExtendedResourcesMap()
static RestManager
getInstance()
void
init()
Initialize the RestManager.
This method can be called multiple time during the lifetime of the site, for example on properties change.boolean
isEnable()
boolean
isReadAccessEnable()
boolean
isWriteAccessEnable()
void
removeResources(java.util.Map<java.lang.String,java.lang.Class<? extends JcmsRestResource>> resourcesMap)
void
setApplication(RestletApplication app)
-
-
-
Field Detail
-
PROPKEY_ENABLE
public static final java.lang.String PROPKEY_ENABLE
- See Also:
- Constant Field Values
-
PROPKEY_READACCESS_ENABLE
public static final java.lang.String PROPKEY_READACCESS_ENABLE
- See Also:
- Constant Field Values
-
PROPKEY_READACCESS_IPFILTER
public static final java.lang.String PROPKEY_READACCESS_IPFILTER
- See Also:
- Constant Field Values
-
PROPKEY_WRITEACCESS_ENABLE
public static final java.lang.String PROPKEY_WRITEACCESS_ENABLE
- See Also:
- Constant Field Values
-
PROPKEY_WRITEACCESS_IPFILTER
public static final java.lang.String PROPKEY_WRITEACCESS_IPFILTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static final RestManager getInstance()
-
init
public void init()
Initialize the RestManager.
This method can be called multiple time during the lifetime of the site, for example on properties change.
-
checkReadAccessIP
public boolean checkReadAccessIP(java.lang.String ip)
Returns true if the given IP address is authorized for read for REST request. (It doesn't check if either Rest is enabled or Read access is enabled).- Parameters:
ip
- the IP address to be checked- Returns:
- true if the given IP address is authorized.
-
checkWriteAccessIP
public boolean checkWriteAccessIP(java.lang.String ip)
Returns true if the given IP address is authorized for write for REST request. (It doesn't check if either Rest is enabled or Write access is enabled).- Parameters:
ip
- the IP address to be checked- Returns:
- true if the given IP address is authorized.
-
isEnable
public boolean isEnable()
-
isReadAccessEnable
public boolean isReadAccessEnable()
-
isWriteAccessEnable
public boolean isWriteAccessEnable()
-
addResourcesMap
public void addResourcesMap(Plugin plugin, java.util.Map<java.lang.String,java.lang.Class<? extends JcmsRestResource>> resourcesMap)
-
removeResources
public void removeResources(java.util.Map<java.lang.String,java.lang.Class<? extends JcmsRestResource>> resourcesMap)
-
getExtendedResourcesMap
public java.util.Map<Plugin,java.util.Map<java.lang.String,java.lang.Class<? extends JcmsRestResource>>> getExtendedResourcesMap()
-
setApplication
public void setApplication(RestletApplication app)
-
addResource
public void addResource()
-
-