Class ServerScope

java.lang.Object
jenkins.plugins.openstack.compute.ServerScope
Direct Known Subclasses:
ServerScope.Build, ServerScope.Node, ServerScope.Time, ServerScope.Unlimited

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public abstract class ServerScope extends Object
Server can be scoped to certain Jenkins entities to constrain its lifetime. Openstack plugin will clean the instance after it is considered out of scope.
  • Field Details

    • METADATA_KEY

      public static final String METADATA_KEY
      Name of the openstack metadata key
      See Also:
    • name

      @Nonnull protected final String name
    • specifier

      @Nonnull protected final String specifier
  • Method Details

    • parse

      public static ServerScope parse(String scope) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • extract

      @Nonnull public static ServerScope extract(org.openstack4j.model.compute.Server server) throws IllegalStateException
      Get the scope of a server.
      Returns:
      The scope or null if there is none declared.
      Throws:
      IllegalStateException - In case the scope can not be parsed.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getValue

      public String getValue()
      Get Metadata value that represent this scope.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • _equals

      protected boolean _equals(ServerScope o)
      Contribute additional criteria for equality. This is mostly useful for testing as the implementations are not expected to have mutable state or any state not represented by specifier.
    • isOutOfScope

      public abstract boolean isOutOfScope(@Nonnull org.openstack4j.model.compute.Server server)
      Determine whether the server is out of scope or not.