com.tietoenator.trip.jxp.grid

## Class TdbGridReplicaSet

- java.lang.Object
- - com.tietoenator.trip.jxp.session.TdbSessionObject
  - - com.tietoenator.trip.jxp.TdbMessageProvider
    - - com.tietoenator.trip.jxp.grid.TdbGridReplicaSet

- All Implemented Interfaces:
    com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider, java.lang.Iterable<TdbGridReplicaSetMember>

      public class TdbGridReplicaSet
      extends TdbMessageProvider
      implements com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider, java.lang.Iterable<TdbGridReplicaSetMember>

  TdbGridReplicaSet encapsulates a particular replica set on the grid, and provides operations to manipulate that set.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TdbGridReplicaSet(TdbSession session)` Constructor, creates a blank instance
    `TdbGridReplicaSet(TdbSession session, TdbControlObject ob)` Constructor, creates an instance for the replica set referenced

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(TdbGridReplicaSetMember member)` Add a new member to the replica set
    `boolean` | `contains(TdbGridReplicaSetMember member)` Check if the replica set already contains a given member
    `void` | `create()` Create a new grid replica set -- this method uses the information from the Control object provided during construction to create the replica set.
    `void` | `create(java.lang.String name, java.lang.String comment)` Create a new grid replica set.
    `void` | `get()` Retrieve the current replication set from the grid.
    `void` | `get(java.lang.String name)` Refresh the contents of the named replica set from the grid.
    `java.lang.String` | `getComment()` Retrieve the description of the replica set
    `TdbControlObject` | `getControlObject()` Retrieve the underlying control object for the replica set
    `java.lang.String` | `getName()` Retrieve the name of the replica set
    `java.util.Iterator<TdbGridReplicaSetMember>` | `iterator()` Retrieve an iterator on the membership list
    `java.util.List<TdbGridReplicaSetMember>` | `members()` Retrieve a collection of members for the replica set
    `void` | `put()` Store the contents of the replica set to the grid.
    `void` | `remove()` Delete an existing replica set -- this method uses the information from the Control object provided during construction to name the replica set.
    `void` | `remove(java.lang.String name)` Delete an existing replica set.
    `void` | `rename(java.lang.String newname)` Rename an existing replica set.
    `void` | `setComment(java.lang.String comment)` Establish the description of the replica set
    `void` | `setName(java.lang.String name)` Establish the name of the replica set

    - ### Methods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider

      `codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages`

    - ### Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject

      `cancel, getSession, isCancelable, setCancelable`

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.tietoenator.trip.jxp.internal.utils.DOMSink

      `sinkNode`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Constructor Detail

    - #### TdbGridReplicaSet

          public TdbGridReplicaSet(TdbSession session)
                            throws TdbException

      Constructor, creates a blank instance
      Parameters:
        `session` - Active session
      Throws:
        `TdbException`

    - #### TdbGridReplicaSet

          public TdbGridReplicaSet(TdbSession session,
                                   TdbControlObject ob)
                            throws TdbException

      Constructor, creates an instance for the replica set referenced
      Parameters:
        `session` - Active session
        `ob` - Control object reference for the replica set
      Throws:
        `TdbException`

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Retrieve the name of the replica set
      Returns:
        Replica set name

    - #### setName

          public void setName(java.lang.String name)

      Establish the name of the replica set
      Parameters:
        `name` - Replica set name

    - #### getComment

          public java.lang.String getComment()

      Retrieve the description of the replica set
      Returns:
        Replica set description, if any

    - #### setComment

          public void setComment(java.lang.String comment)

      Establish the description of the replica set
      Parameters:
        `comment` - Replica set description

    - #### getControlObject

          public TdbControlObject getControlObject()

      Retrieve the underlying control object for the replica set
      Specified by:
        `getControlObject` in interface `TdbControlObjectProvider`
      Returns:
        Control object reference that was used to construct the instance

    - #### contains

          public boolean contains(TdbGridReplicaSetMember member)

      Check if the replica set already contains a given member
      Parameters:
        `member` - The replica set member to check for containment
      Returns:
        true if the replica set contains the provided member

    - #### iterator

          public java.util.Iterator<TdbGridReplicaSetMember> iterator()

      Retrieve an iterator on the membership list
      Specified by:
        `iterator` in interface `java.lang.Iterable<TdbGridReplicaSetMember>`
      Returns:
        An iterator over the collection of members

    - #### members

          public java.util.List<TdbGridReplicaSetMember> members()

      Retrieve a collection of members for the replica set
      Returns:
        A collection of members

    - #### add

          public void add(TdbGridReplicaSetMember member)

      Add a new member to the replica set
      Parameters:
        `member` - The new member to add to the replica set

    - #### create

          public void create(java.lang.String name,
                             java.lang.String comment)
                      throws TdbException

      Create a new grid replica set.

      This method causes network I/O.

      Parameters:
        `name` - The name of the new replica set
        `comment` - A comment to store along with the replica set
      Throws:
        `TdbException`

    - #### create

          public void create()
                      throws TdbException

      Create a new grid replica set -- this method uses the information from the Control object provided during construction to create the replica set.

      This method causes network I/O.

      Throws:
        `TdbException`

    - #### remove

          public void remove(java.lang.String name)
                      throws TdbException

      Delete an existing replica set.

      This method causes network I/O.

      Parameters:
        `name` - Name of the replica set to remove
      Throws:
        `TdbException`

    - #### remove

          public void remove()
                      throws TdbException

      Delete an existing replica set -- this method uses the information from the Control object provided during construction to name the replica set.

      This method causes network I/O.

      Throws:
        `TdbException`

    - #### rename

          public void rename(java.lang.String newname)
                      throws TdbException

      Rename an existing replica set.

      This method causes network I/O.

      Parameters:
        `newname` - The new name of the replica set
      Throws:
        `TdbException`

    - #### get

          public void get(java.lang.String name)
                   throws TdbException

      Refresh the contents of the named replica set from the grid.

      This method causes network I/O.

      Parameters:
        `name` - The name of the replica set to retrieve
      Throws:
        `TdbException`

    - #### get

          public void get()
                   throws TdbException

      Retrieve the current replication set from the grid.

      This method causes network I/O.

      Throws:
        `TdbException`

    - #### put

          public void put()
                   throws TdbException

      Store the contents of the replica set to the grid.

      This method causes network I/O.

      Throws:
        `TdbException`