Class 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 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