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
      Overrides:
      start in class ConnectorBase
      Throws:
      ConnectorCheckedException - something went wrong
    • saveServerConfig

      public void saveServerConfig(OMAGServerConfig omagServerConfig)
      Save the server configuration.
      Specified by:
      saveServerConfig in interface OMAGServerConfigStore
      Parameters:
      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
      Returns:
      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
      Returns:
      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.
      Parameters:
      templateString - string that defines the shape of the file name
      methodName - callers name for diagnostics
      Returns:
      set of filenames from the file System that match the template
    • disconnect

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