Class CommandRegistry

java.lang.Object
org.aksw.vshell.registry.CommandRegistry
All Implemented Interfaces:
CommandCatalog

public class CommandRegistry extends Object implements CommandCatalog
Registry / cache for whether a command is available on a certain exec site. Should only be used with resolved commands such as /bin/foo in contrast to names such as foo.
  • Constructor Details

    • CommandRegistry

      public CommandRegistry()
  • Method Details

    • getKnownExecSites

      public Optional<com.google.common.collect.Multimap<ExecSite,String>> getKnownExecSites(String command)
      Return a snapshot of the set of exec sites where the command is known to be present. Return null if there is no entry for the command. Empty map if there is an entry with no known locations.
    • getAvailability

      public Optional<Set<String>> getAvailability(String command, ExecSite execSite)
    • put

      public CommandRegistry put(String command, ExecSite execSite, String cmd)
    • putAll

      public CommandRegistry putAll(String command, com.google.common.collect.Multimap<ExecSite,String> cmdMap)
    • get

      public com.google.common.collect.Multimap<ExecSite,String> get(String virtualCommandName)
      Description copied from interface: CommandCatalog
      Return all known locations for a command. Candidate locations where the command is unavailable (e.g. on the host) must have been filtered out.
      Specified by:
      get in interface CommandCatalog