org.apache.geode.cache

## Class RequiredRoles

- java.lang.Object
- - org.apache.geode.cache.RequiredRoles

- Deprecated.
  this feature is scheduled to be removed

      public class RequiredRoles
      extends java.lang.Object

  Provides information on presence or absence of a `Region`'s required roles. Configuration of required roles is accomplished using the `Region`'s `MembershipAttributes`. A `Role` may be present in the distributed system even if it the `Role` is not present in the `Region` membership. This would occur if none of the members filling that `Role` currently have a `Cache` or the specific `Region` created. In this case the `Role` is considered to be absent for that `Region`.
  See Also:
    `Role`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequiredRoles()` Deprecated.

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Set<Role>` | `checkForRequiredRoles(Region<?,?> region)` Deprecated. Returns a set of any currently missing required roles for the specified region.
    `static boolean` | `isRoleInRegionMembership(Region<?,?> region, Role role)` Deprecated. Returns true if the `Role` is currently present in the `Region` membership.
    `static java.util.Set<Role>` | `waitForRequiredRoles(Region<?,?> region, long timeout)` Deprecated. Returns a set of any currently missing required roles for the specified region.

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

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

- - ### Constructor Detail

    - #### RequiredRoles

          public RequiredRoles()

      Deprecated.

  - ### Method Detail

    - #### checkForRequiredRoles

          public static java.util.Set<Role> checkForRequiredRoles(Region<?,?> region)

      Deprecated.
      Returns a set of any currently missing required roles for the specified region. If the region is not configured to require roles an empty set will always be returned.
      Parameters:
        `region` - the region to check for missing required roles
      Returns:
        set of required roles that are currently missing
      Throws:
        `java.lang.IllegalStateException` - if region is not configured with required roles

    - #### waitForRequiredRoles

          public static java.util.Set<Role> waitForRequiredRoles(Region<?,?> region,
                                                                 long timeout)
                                                          throws java.lang.InterruptedException

      Deprecated.
      Returns a set of any currently missing required roles for the specified region. This will wait the specified timeout in milliseconds for any missing required roles to be filled. If there are no missing required roles or if the region is not configured to require any roles then an empty set will immediately be returned.
      Parameters:
        `region` - the region to check for missing required roles
        `timeout` - milliseconds to wait for any missing required roles
      Returns:
        set of required roles that are currently missing
      Throws:
        `java.lang.NullPointerException` - if region is null
        `java.lang.InterruptedException` - if thread is interrupted while waiting
        `java.lang.IllegalStateException` - if region is not configured with required roles

    - #### isRoleInRegionMembership

          public static boolean isRoleInRegionMembership(Region<?,?> region,
                                                         Role role)

      Deprecated.
      Returns true if the `Role` is currently present in the `Region` membership. This returns true only if one or more members filling this role actually have the region currently created. The role may be present in the distributed system even if the role is not present in the region membership.
      Parameters:
        `region` - the region whose membership will be searched
        `role` - the role to check for