com.elastisys.scale.cloudpool.api.types

## Class MembershipStatus

- java.lang.Object
- - com.elastisys.scale.cloudpool.api.types.MembershipStatus

    public class MembershipStatus
    extends Object

The pool membership status indicates if a `Machine` needs to be given special treatment.

The membership status for a machine can, for example, be set to protect the machine from being terminated (by settings its evictability status) or to mark a machine as being in need of replacement by flagging it as an inactive pool member.

See Also:
  `Machine`, `MachinePool`, `CloudPool`

### Constructor Summary

Constructors
Constructor and Description
`MembershipStatus()` Creates a default `MembershipStatus` that marks a machine both active and evictable.
`MembershipStatus(boolean active, boolean evictable)` Creates a `MembershipStatus` for a machine.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static MembershipStatus` `awaitingService()` Creates a `MembershipStatus` that marks a machine as being non-functional (i.e.
`static MembershipStatus` `blessed()` Creates a `MembershipStatus` that marks a machine as blessed (or a permanent pool member that cannot be evicted).
`static MembershipStatus` `defaultStatus()` Creates a default `MembershipStatus` that marks a machine both active and evictable.
`static MembershipStatus` `disposable()` Creates a `MembershipStatus` that marks a machine as being non-functional (i.e.
`boolean` `equals(Object obj)`
`int` `hashCode()`
`boolean` `isActive()` Indicates if this is an active (working) `MachinePool` member.
`boolean` `isEvictable()` Indicates if this `Machine` is a blessed member of the `MachinePool`.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### MembershipStatus

    public MembershipStatus()

Creates a default `MembershipStatus` that marks a machine both active and evictable.

#### MembershipStatus

    public MembershipStatus(boolean active,
                            boolean evictable)

Creates a `MembershipStatus` for a machine.

Parameters:
  `active` - Indicates if this is an active (working) `MachinePool` member. A `false` value, indicates to the `CloudPool` that a replacement machine needs to be launched for this pool member (at least until this machine has been troubleshooted and had its `active` flag set back to `true`).
  `evictable` - Indicates if this `Machine` is a blessed member of the `MachinePool`. If `true`, the `CloudPool` may not terminate this machine.

### Method Detail

#### defaultStatus

    public static MembershipStatus defaultStatus()

Creates a default `MembershipStatus` that marks a machine both active and evictable.

Returns:

#### blessed

    public static MembershipStatus blessed()

Creates a `MembershipStatus` that marks a machine as blessed (or a permanent pool member that cannot be evicted).

Returns:

#### awaitingService

    public static MembershipStatus awaitingService()

Creates a `MembershipStatus` that marks a machine as being non-functional (i.e. inactive) and in need of service. The `Machine` should be replaced and should not be terminated (it is kept alive for troubleshooting).

Returns:

#### disposable

    public static MembershipStatus disposable()

Creates a `MembershipStatus` that marks a machine as being non-functional (i.e. inactive) and in need of replacement. The `Machine` should be replaced and can be terminated.

Returns:

#### isActive

    public boolean isActive()

Indicates if this is an active (working) `MachinePool` member. A `false` value, indicates to the `CloudPool` that a replacement machine needs to be launched for this pool member (at least until this machine has been troubleshooted and had its `active` flag set back to `true`).

Returns:

#### isEvictable

    public boolean isEvictable()

Indicates if this `Machine` is a blessed member of the `MachinePool`. If `true`, the `CloudPool` may not terminate this machine.

Returns:

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`