Class FileBasedKieServerTemplateStorage

  • All Implemented Interfaces:
    org.kie.server.controller.api.storage.KieServerTemplateStorage

    public class FileBasedKieServerTemplateStorage
    extends Object
    implements org.kie.server.controller.api.storage.KieServerTemplateStorage
    • Field Detail

      • DEFAULT_SERVER_TEMPLATE_FILENAME

        public static final String DEFAULT_SERVER_TEMPLATE_FILENAME
    • Constructor Detail

      • FileBasedKieServerTemplateStorage

        protected FileBasedKieServerTemplateStorage()
        Default constructor
      • FileBasedKieServerTemplateStorage

        protected FileBasedKieServerTemplateStorage​(String templatesLocation)
        Constructor that takes a template location argument
        Parameters:
        templatesLocation - A string value that indicates where the server templates should be stored. A null value indicates that the value should be retrieved from the system properties.
    • Method Detail

      • init

        protected void init​(String templatesLocation)
        Initializes the class instance
        Parameters:
        templatesLocation - A string value that indicates where the server templates should be stored. A null value indicates that the value should be retrieved from the system properties.
      • loadTemplateMapsFromFile

        public void loadTemplateMapsFromFile()
        Loads the map of server templates from the file pointed at by the templatesLocation
      • store

        public org.kie.server.controller.api.model.spec.ServerTemplate store​(org.kie.server.controller.api.model.spec.ServerTemplate serverTemplate)
        Specified by:
        store in interface org.kie.server.controller.api.storage.KieServerTemplateStorage
      • loadKeys

        public List<org.kie.server.controller.api.model.spec.ServerTemplateKey> loadKeys()
        Specified by:
        loadKeys in interface org.kie.server.controller.api.storage.KieServerTemplateStorage
      • getTemplateKey

        public org.kie.server.controller.api.model.spec.ServerTemplateKey getTemplateKey​(String id)
        Returns the ServerTemplateKey object associated with a server template's id
        Parameters:
        id - The server template id that points to the ServerTemplateKey
        Returns:
        The ServerTemplateKey that is associated with the id, or null if the id does exist in the templateKeyMap
      • load

        public List<org.kie.server.controller.api.model.spec.ServerTemplate> load()
        Specified by:
        load in interface org.kie.server.controller.api.storage.KieServerTemplateStorage
      • load

        public org.kie.server.controller.api.model.spec.ServerTemplate load​(String identifier)
        Specified by:
        load in interface org.kie.server.controller.api.storage.KieServerTemplateStorage
      • exists

        public boolean exists​(String identifier)
        Specified by:
        exists in interface org.kie.server.controller.api.storage.KieServerTemplateStorage
      • update

        public org.kie.server.controller.api.model.spec.ServerTemplate update​(org.kie.server.controller.api.model.spec.ServerTemplate serverTemplate)
        Specified by:
        update in interface org.kie.server.controller.api.storage.KieServerTemplateStorage
      • delete

        public org.kie.server.controller.api.model.spec.ServerTemplate delete​(String identifier)
        Specified by:
        delete in interface org.kie.server.controller.api.storage.KieServerTemplateStorage
      • clearTemplateMaps

        public void clearTemplateMaps()
      • setTemplatesLocation

        public void setTemplatesLocation​(String templatesLocation)
      • getTemplatesLocation

        public String getTemplatesLocation()
      • close

        public void close()
        Specified by:
        close in interface org.kie.server.controller.api.storage.KieServerTemplateStorage