Class RestManager


  • public class RestManager
    extends java.lang.Object
    Hold JCMS configuration of OpenAPI. RestResource may be added.
    Since:
    JCMS-6.0
    Version:
    $Revision: 104426 $
    Author:
    dissert
    • Field Detail

      • 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()
      • addResource

        public void addResource()