Package 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`, `Iterable<TdbGridReplicaSetMember>`

public class TdbGridReplicaSet extends TdbMessageProvider implements com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider, Iterable<TdbGridReplicaSetMember>
TdbGridReplicaSet encapsulates a particular replica set on the grid, and provides operations to manipulate that set.

- ## Constructor Summary

  Constructors
  Constructor
  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

  Modifier and Type
  Method
  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(String name, String comment)`
  Create a new grid replica set.
  `void`
  `get()`
  Retrieve the current replication set from the grid.
  `void`
  `get(String name)`
  Refresh the contents of the named replica set from the grid.
  `String`
  `getComment()`
  Retrieve the description of the replica set
  `TdbControlObject`
  `getControlObject()`
  Retrieve the underlying control object for the replica set
  `String`
  `getName()`
  Retrieve the name of the replica set
  `Iterator<TdbGridReplicaSetMember>`
  `iterator()`
  Retrieve an iterator on the membership list
  `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(String name)`
  Delete an existing replica set.
  `void`
  `rename(String newname)`
  Rename an existing replica set.
  `void`
  `setComment(String comment)`
  Establish the description of the replica set
  `void`
  `setName(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 java.lang.Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### 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 Details

  - ### getName

    public String getName()
    Retrieve the name of the replica set
    Returns:
      Replica set name

  - ### setName

    public void setName(String name)
    Establish the name of the replica set
    Parameters:
      `name` - Replica set name

  - ### getComment

    public String getComment()
    Retrieve the description of the replica set
    Returns:
      Replica set description, if any

  - ### setComment

    public void setComment(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 Iterator<TdbGridReplicaSetMember> iterator()
    Retrieve an iterator on the membership list
    Specified by:
      `iterator` in interface `Iterable<TdbGridReplicaSetMember>`
    Returns:
      An iterator over the collection of members

  - ### members

    public 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(String name, 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(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(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(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`