## Provided Capabilities (1)

Name | Dynamic | Other provider points
--- | --- | ---
org.wildfly.clustering.singleton-policy.election | true | /subsystem=singleton/singleton-policy=*/election-policy=random

## Attributes (3)

- name-preferences - The list of preferred node names

  Type | LIST
  Is the attribute nillable? | true
  Does the attribute allow expression? | true
  Where is the attribute stored? | configuration
  Access Type | read-write
  Is restarted required? | resource-services
  Stability Level | default
  Raw DMR model |
      {
          "type" : {
              "TYPE_MODEL_VALUE" : "LIST"
          },
          "description" : "The list of preferred node names",
          "expressions-allowed" : true,
          "required" : false,
          "nillable" : true,
          "alternatives" : ["socket-binding-preferences"],
          "min-length" : 0,
          "max-length" : 2147483647,
          "stability" : "default",
          "value-type" : {
              "TYPE_MODEL_VALUE" : "STRING"
          },
          "access-type" : "read-write",
          "storage" : "configuration",
          "restart-required" : "resource-services",
          "capability-reference" : null
      }

- position - The position in the membership list from which the primary singleton provider will be chosen

  Type | INT
  Default Value | 0
  Is the attribute nillable? | true
  Does the attribute allow expression? | true
  Where is the attribute stored? | configuration
  Access Type | read-write
  Is restarted required? | resource-services
  Stability Level | default
  Raw DMR model |
      {
          "type" : {
              "TYPE_MODEL_VALUE" : "INT"
          },
          "description" : "The position in the membership list from which the primary singleton provider will be chosen",
          "expressions-allowed" : true,
          "required" : false,
          "nillable" : true,
          "default" : 0,
          "stability" : "default",
          "access-type" : "read-write",
          "storage" : "configuration",
          "restart-required" : "resource-services",
          "capability-reference" : null
      }

- socket-binding-preferences - The list of preferred node socket bindings

  Type | LIST
  Is the attribute nillable? | true
  Where is the attribute stored? | configuration
  Access Type | read-write
  Is restarted required? | resource-services
  Stability Level | default
  Raw DMR model |
      {
          "type" : {
              "TYPE_MODEL_VALUE" : "LIST"
          },
          "description" : "The list of preferred node socket bindings",
          "expressions-allowed" : false,
          "required" : false,
          "nillable" : true,
          "alternatives" : ["name-preferences"],
          "capability-reference" : "org.wildfly.network.outbound-socket-binding",
          "min-length" : 0,
          "max-length" : 2147483647,
          "stability" : "default",
          "value-type" : {
              "TYPE_MODEL_VALUE" : "STRING"
          },
          "access-type" : "read-write",
          "storage" : "configuration",
          "restart-required" : "resource-services"
      }

## Operations (2)

- add - A simple election policy

  Request Parameter | Type | Required | Expressions Allowed | Default value | Description
  --- | --- | --- | --- | --- | ---
  name-preferences | LIST | false | true |  | The list of preferred node names
  position | INT | false | true | 0 | The position in the membership list from which the primary singleton provider will be chosen
  socket-binding-preferences | LIST | false | false |  | The list of preferred node socket bindings

  Raw DMR model |
      {
          "operation-name" : "add",
          "description" : "A simple election policy",
          "request-properties" : {
              "name-preferences" : {
                  "type" : {
                      "TYPE_MODEL_VALUE" : "LIST"
                  },
                  "description" : "The list of preferred node names",
                  "expressions-allowed" : true,
                  "required" : false,
                  "nillable" : true,
                  "alternatives" : ["socket-binding-preferences"],
                  "min-length" : 0,
                  "max-length" : 2147483647,
                  "stability" : "default",
                  "value-type" : {
                      "TYPE_MODEL_VALUE" : "STRING"
                  }
              },
              "position" : {
                  "type" : {
                      "TYPE_MODEL_VALUE" : "INT"
                  },
                  "description" : "The position in the membership list from which the primary singleton provider will be chosen",
                  "expressions-allowed" : true,
                  "required" : false,
                  "nillable" : true,
                  "default" : 0,
                  "stability" : "default"
              },
              "socket-binding-preferences" : {
                  "type" : {
                      "TYPE_MODEL_VALUE" : "LIST"
                  },
                  "description" : "The list of preferred node socket bindings",
                  "expressions-allowed" : false,
                  "required" : false,
                  "nillable" : true,
                  "alternatives" : ["name-preferences"],
                  "capability-reference" : "org.wildfly.network.outbound-socket-binding",
                  "min-length" : 0,
                  "max-length" : 2147483647,
                  "stability" : "default",
                  "value-type" : {
                      "TYPE_MODEL_VALUE" : "STRING"
                  }
              }
          },
          "reply-properties" : {},
          "stability" : "default",
          "read-only" : false,
          "runtime-only" : false
      }

- remove - Removes a simple election policy

  Raw DMR model |
      {
          "operation-name" : "remove",
          "description" : "Removes a simple election policy",
          "request-properties" : {},
          "reply-properties" : {},
          "stability" : "default",
          "read-only" : false,
          "restart-required" : "resource-services",
          "runtime-only" : false
      }

## Galleon Features

Galleon features are to be used when creating Galleon feature-packs.

- subsystem.singleton.singleton-policy.election-policy.simple

      <feature spec="subsystem.singleton.singleton-policy.election-policy.simple">
        <param name="singleton-policy" value="{resource name}"/>
        <param name="name-preferences" value="{value}"/>
        <param name="position" value="{value}"/>
        <param name="socket-binding-preferences" value="{value}"/>
      <feature/>