Class SshSemaphoreFactory

java.lang.Object
org.sentrysoftware.metricshub.engine.telemetry.SshSemaphoreFactory

public class SshSemaphoreFactory extends Object
A factory class for managing SSH semaphores associated with hostnames.
  • Constructor Details

    • SshSemaphoreFactory

      public SshSemaphoreFactory()
  • Method Details

    • createOrGetSempahore

      public Semaphore createOrGetSempahore(String hostname)
      Gets the Semaphore associated with the hostname, creating it if it does not exist.
      Parameters:
      hostname - The hostname for which to retrieve the Semaphore.
      Returns:
      The Semaphore associated with the hostname.
    • getInstance

      public static SshSemaphoreFactory getInstance()
      Gets the static instance containing all semaphores
      Returns:
      the static instance containing all semaphores
    • deleteSemaphore

      public void deleteSemaphore(String hostname)
      Removes the host-semaphore key-value pair for the specified hostname.
      Parameters:
      hostname - The hostname for which to delete the Semaphore.