Class DeclarativeRegistry

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, Registry

    public class DeclarativeRegistry
    extends java.lang.Object
    implements Registry, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
    Registry of declarative (scripted/template driven) Web Scripts
    Author:
    davidc
    • Field Detail

      • WEBSCRIPT_DESC_XML

        public static final java.lang.String WEBSCRIPT_DESC_XML
        Filename extension for webscript descriptor paths
        See Also:
        Constant Field Values
    • Constructor Detail

      • DeclarativeRegistry

        public DeclarativeRegistry()
    • Method Detail

      • setDefaultWebScript

        public void setDefaultWebScript​(java.lang.String defaultWebScript)
        Parameters:
        defaultWebScript - String
      • setUriIndex

        public void setUriIndex​(UriIndex uriIndex)
        Parameters:
        uriIndex - UriIndex
      • setSearchPath

        public void setSearchPath​(SearchPath searchPath)
        Parameters:
        searchPath - SearchPath
      • setContainer

        public void setContainer​(Container container)
        Parameters:
        container - Container
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • getApplicationContext

        public org.springframework.context.ApplicationContext getApplicationContext()
        Gets the Application Context Changed from protected to public is for Dev Tools FreeMarker Editor plugin
        Returns:
        application context
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • reset

        public void reset()
        Description copied from interface: Registry
        Resets the Web Script Registry
        Specified by:
        reset in interface Registry
      • getPackage

        public Path getPackage​(java.lang.String scriptPackage)
        Description copied from interface: Registry
        Gets a Web Script Package
        Specified by:
        getPackage in interface Registry
        Parameters:
        scriptPackage - String
        Returns:
        web script path representing package
      • getUri

        public Path getUri​(java.lang.String scriptUri)
        Description copied from interface: Registry
        Gets a Web Script URL
        Specified by:
        getUri in interface Registry
        Parameters:
        scriptUri - String
        Returns:
        web script path representing uri
      • getFamily

        public Path getFamily​(java.lang.String scriptUri)
        Description copied from interface: Registry
        Gets a Web Script Family NOTE: - To get all families, pass / - To get a specific family, pass /{familyName}
        Specified by:
        getFamily in interface Registry
        Parameters:
        scriptUri - String
        Returns:
        web script path representing family
      • getWebScripts

        public java.util.Collection<WebScript> getWebScripts()
        Description copied from interface: Registry
        Gets all Web Scripts
        Specified by:
        getWebScripts in interface Registry
        Returns:
        web scripts
      • getFailures

        public java.util.Map<java.lang.String,​java.lang.String> getFailures()
        Description copied from interface: Registry
        Gets all Web Script definitions that failed to register
        Specified by:
        getFailures in interface Registry
        Returns:
        map of error by web script definition file path
      • getWebScript

        public WebScript getWebScript​(java.lang.String id)
        Description copied from interface: Registry
        Gets a Web Script by Id
        Specified by:
        getWebScript in interface Registry
        Parameters:
        id - web script id
        Returns:
        web script
      • findWebScript

        public Match findWebScript​(java.lang.String method,
                                   java.lang.String uri)
        Description copied from interface: Registry
        Gets a Web Script given an HTTP Method and URI
        Specified by:
        findWebScript in interface Registry
        Parameters:
        method - http method
        uri - uri
        Returns:
        script match (pair of script and uri that matched)
      • getLifecycle

        public Path getLifecycle​(java.lang.String lifecyclePath)
        Description copied from interface: Registry
        Gets a Lifecycle Family, for example, all deprecated web scripts NOTE: - To get all lifecycles, pass / - To get a specific lifecycle, pass /{lifecycleName}
        Specified by:
        getLifecycle in interface Registry
        Parameters:
        lifecyclePath - String
        Returns:
        web script path representing family
      • getPackageDescriptionDocument

        public PackageDescriptionDocument getPackageDescriptionDocument​(java.lang.String scriptPackage)
        Returns package description document with the given webscript package
        Specified by:
        getPackageDescriptionDocument in interface Registry
        Parameters:
        scriptPackage - webscript package
        Returns:
        list of package description document
      • getSchemaDescriptionDocument

        public SchemaDescriptionDocument getSchemaDescriptionDocument​(java.lang.String schemaId)
        Returns schema description document with the given id.
        Specified by:
        getSchemaDescriptionDocument in interface Registry
        Parameters:
        schemaId - schema id
        Returns:
        schema description document
      • getSchemaTypeDescriptionById

        public TypeDescription getSchemaTypeDescriptionById​(java.lang.String typeId)
        Returns schema type description document with given id
        Specified by:
        getSchemaTypeDescriptionById in interface Registry
        Parameters:
        typeId - id for schema description document
        Returns:
        schema type description document
      • getFailedPackageDescriptionsByPath

        public java.util.Map<java.lang.String,​java.lang.String> getFailedPackageDescriptionsByPath()
        Returns list of package description documents that fail to register
        Specified by:
        getFailedPackageDescriptionsByPath in interface Registry
        Returns:
        the failedPackageDescriptionsByPath
      • getFailedSchemaDescriptionsByPath

        public java.util.Map<java.lang.String,​java.lang.String> getFailedSchemaDescriptionsByPath()
        Returns list of schema description documents that fail to register
        Specified by:
        getFailedSchemaDescriptionsByPath in interface Registry
        Returns:
        the failedSchemaDescriptionsByPath