Class FileBasedServerConfigStoreConnector

All Implemented Interfaces:
OMAGServerConfigStore, OMAGServerConfigStoreRetrieveAll, SecureConnectorExtension

public class FileBasedServerConfigStoreConnector extends OMAGServerConfigStoreConnectorBase implements OMAGServerConfigStoreRetrieveAll
FileBasedServerConfigStoreConnector provides a connector that manages a configuration document for an OMAG Server in a file
  • Constructor Details

    • FileBasedServerConfigStoreConnector

      public FileBasedServerConfigStoreConnector()
      Default constructor
  • Method Details

    • start

      public void start() throws ConnectorCheckedException
      Set up the name of the file store
      start in class ConnectorBase
      ConnectorCheckedException - something went wrong
    • saveServerConfig

      public void saveServerConfig(OMAGServerConfig omagServerConfig)
      Save the server configuration.
      Specified by:
      saveServerConfig in interface OMAGServerConfigStore
      omagServerConfig - - configuration properties to save
    • retrieveServerConfig

      public OMAGServerConfig retrieveServerConfig()
      Retrieve the configuration saved from a previous run of the server.
      Specified by:
      retrieveServerConfig in interface OMAGServerConfigStore
      server configuration
    • removeServerConfig

      public void removeServerConfig()
      Remove the server configuration.
      Specified by:
      removeServerConfig in interface OMAGServerConfigStore
    • retrieveAllServerConfigs

      public Set<OMAGServerConfig> retrieveAllServerConfigs()
      Retrieve all the stored server configurations
      Specified by:
      retrieveAllServerConfigs in interface OMAGServerConfigStoreRetrieveAll
      the set of server configurations present in this OMAG Server Config store
    • getFileNames

      protected Set<String> getFileNames(String templateString, String methodName)
      Get filenames from the file system that match the store template. Only supports 1 or 2 inserts in the template and they need to be in different url segments. When a file is matched on the file system, the match for the insert is the serverName.
      templateString - string that defines the shape of the file name
      methodName - callers name for diagnostics
      set of filenames from the file System that match the template
    • disconnect

      public void disconnect()
      Close the config file
      disconnect in class ConnectorBase