/**
   * @param le
   * @param sequence
   * @return
   * @throws LdapException
   */
  private Group unloadLdapEntry(Entry le, long sequence) throws LdapInvalidAttributeValueException {
    Group entity = new ObjectFactory().createGroup();
    entity.setName(getAttribute(le, SchemaConstants.CN_AT));
    entity.setDescription(getAttribute(le, SchemaConstants.DESCRIPTION_AT));
    String typeAsString = getAttribute(le, GlobalIds.TYPE);
    if (StringUtils.isNotEmpty(typeAsString)) {
      entity.setType(Group.Type.valueOf(typeAsString.toUpperCase()));
    }
    entity.setProtocol(getAttribute(le, GROUP_PROTOCOL_ATTR_IMPL));
    entity.setMembers(getAttributes(le, SchemaConstants.MEMBER_AT));
    entity.setMemberDn(true);
    entity.setProperties(PropUtil.getProperties(getAttributes(le, GROUP_PROPERTY_ATTR_IMPL), '='));
    entity.setSequenceId(sequence);

    return entity;
  }
  /** {@inheritDoc} */
  @Override
  public Group add(Group group) throws org.apache.directory.fortress.core.SecurityException {
    String methodName = "add";
    assertContext(CLS_NM, methodName, group, GlobalErrIds.GROUP_NULL);
    checkAccess(CLS_NM, methodName);

    if (!group.isMemberDn()) {
      if (group.getType() == Group.Type.ROLE) {
        loadRoleDns(group);
      } else {
        loadUserDns(group);
      }
      group.setMemberDn(true);
    }

    return GROUP_P.add(group);
  }