Search in sources :

Example 1 with MembershipAttributesData

use of org.apache.geode.management.MembershipAttributesData in project geode by apache.

the class RegionMBeanCompositeDataFactory method getMembershipAttributesData.

public static MembershipAttributesData getMembershipAttributesData(RegionAttributes regAttrs) {
    MembershipAttributes memAttrs = regAttrs.getMembershipAttributes();
    Set<String> requiredRoles = new HashSet<String>();
    Iterator<Role> it = memAttrs.getRequiredRoles().iterator();
    while (it.hasNext()) {
        requiredRoles.add(it.next().getName());
    }
    String lossAction = memAttrs.getLossAction().toString();
    String resumptionAction = memAttrs.getResumptionAction().toString();
    MembershipAttributesData membershipAttributesData = new MembershipAttributesData(requiredRoles, lossAction, resumptionAction);
    return membershipAttributesData;
}
Also used : Role(org.apache.geode.distributed.Role) MembershipAttributesData(org.apache.geode.management.MembershipAttributesData) MembershipAttributes(org.apache.geode.cache.MembershipAttributes) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 MembershipAttributes (org.apache.geode.cache.MembershipAttributes)1 Role (org.apache.geode.distributed.Role)1 MembershipAttributesData (org.apache.geode.management.MembershipAttributesData)1