com.h3c.sdn.team

## Interface TeamingService

-     public interface TeamingService

  A team designates a set of application / service instances running on a controller cluster. Application ID uniquely identifies an application / service type. `TeamingService` is used to join / leave a controller team. Applications / services that wish to be part of a team should implement `TeamListener` to receive team status change notifications.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<String>` | `getHealthyMembers()` Get healthy team members.
    `boolean` | `isMemberHealthy()` Check team member health.
    `void` | `joinTeam(String appId, TeamListener listener)` Joins an application instance to team.
    `void` | `leaveTeam(String appId, TeamListener listener)` Gracefully leave team.
    `boolean` | `runElection()` Run election in team.

- - ### Method Detail

    - #### joinTeam

          void joinTeam(String appId,
                      TeamListener listener)
                        throws TeamingExceptions.MemberExists

      Joins an application instance to team.
      Parameters:
        `appId` - Application ID
        `listener` - team listener for listening to changes to team
      Throws:
        `TeamingExceptions.MemberExists` - listener is already registered for application

    - #### leaveTeam

          void leaveTeam(String appId,
                       TeamListener listener)
                         throws TeamingExceptions.MemberNotFound

      Gracefully leave team.
      Parameters:
        `appId` - application ID
        `listener` - listener leaving team
      Throws:
        `TeamingExceptions.MemberNotFound` - listener not registered for application

    - #### runElection

          boolean runElection()

      Run election in team.
      Returns:
        true if election was run successfully

    - #### isMemberHealthy

          boolean isMemberHealthy()

      Check team member health.
      Returns:
        true if team member is healthy

    - #### getHealthyMembers

          Collection<String> getHealthyMembers()

      Get healthy team members. Includes self if healthy
      Returns:
        instance ids of healthy team members

Copyright © 2014. All Rights Reserved.