@Override public String toString() { return "Member:[id='" + getId() + "', userId='" + userId + "', voId='" + voId + "', status='" + status + "', type='" + membershipType + "', sourceGroupId='" + sourceGroupId + "', sponsored='" + sponsored+ "']"; } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getId(); result = prime * result; return result; }
public static void setAttribute(RpcCaller rpcCaller, Member member, Attribute attribute) throws PrivilegeException, InternalErrorException, MemberNotExistsException, AttributeNotExistsException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { Map<String, Object> params = new HashMap<String, Object>(); params.put("member", member.getId()); params.put("attribute", attribute); try { rpcCaller.call("attributesManager", "setAttribute", params); } catch (WrongReferenceAttributeValueException e) { throw e; } catch (WrongAttributeAssignmentException e) { throw e; } catch (WrongAttributeValueException e) { throw e; } catch (AttributeNotExistsException e) { throw e; } catch (MemberNotExistsException e) { throw e; } catch (PrivilegeException e) { throw e; } catch (InternalErrorException e) { throw e; } catch (PerunException e) { throw new ConsistencyErrorException(e); } }
public static List<Attribute> getAttributes(RpcCaller rpcCaller, Member member) throws PrivilegeException, InternalErrorException, MemberNotExistsException { Map<String, Object> params = new HashMap<String, Object>(); params.put("member", member.getId()); try { return rpcCaller.call("attributesManager", "getAttributes", params).readList(Attribute.class); } catch (MemberNotExistsException e) { throw e; } catch (PrivilegeException e) { throw e; } catch (InternalErrorException e) { throw e; } catch (PerunException e) { throw new ConsistencyErrorException(e); } }
public static List<Group> getAllMemberGroups(RpcCaller rpcCaller, Member member) throws InternalErrorException, PrivilegeException, MemberNotExistsException { Map<String, Object> params = new HashMap<String, Object>(); params.put("member", member.getId()); try { return rpcCaller.call("groupsManager", "getAllMemberGroups", params).readList(Group.class); } catch (MemberNotExistsException e) { throw e; } catch (PrivilegeException e) { throw e; } catch (InternalErrorException e) { throw e; } catch (PerunException e) { throw new ConsistencyErrorException(e); } } }
public static List<Group> getMemberGroups(RpcCaller rpcCaller, Member member) throws InternalErrorException, PrivilegeException, MemberNotExistsException { Map<String, Object> params = new HashMap<String, Object>(); params.put("member", member.getId()); try { return rpcCaller.call("groupsManager", "getMemberGroups", params).readList(Group.class); } catch (MemberNotExistsException e) { throw e; } catch (PrivilegeException e) { throw e; } catch (InternalErrorException e) { throw e; } catch (PerunException e) { throw new ConsistencyErrorException(e); } }
public static RichMember getRichMemberWithAttributes(RpcCaller rpcCaller, Member member) throws PrivilegeException, InternalErrorException, MemberNotExistsException { Map<String, Object> params = new HashMap<String, Object>(); params.put("id", member.getId()); try { return rpcCaller.call("membersManager", "getRichMemberWithAttributes", params).read(RichMember.class); } catch (MemberNotExistsException e) { throw e; } catch (PrivilegeException e) { throw e; } catch (InternalErrorException e) { throw e; } catch (PerunException e) { throw new ConsistencyErrorException(e); } }
public static User getUserByMember(RpcCaller rpcCaller, Member member) throws InternalErrorException, MemberNotExistsException, PrivilegeException { Map<String, Object> params = new HashMap<String, Object>(); params.put("member", member.getId()); try { return rpcCaller.call("usersManager", "getUserByMember", params).read(User.class); } catch (MemberNotExistsException e) { throw e; } catch (PrivilegeException e) { throw e; } catch (InternalErrorException e) { throw e; } catch (PerunException e) { throw new ConsistencyErrorException(e); } }
public static List<Resource> getAllowedResources(RpcCaller rpcCaller, Member member) throws InternalErrorException, MemberNotExistsException, PrivilegeException { Map<String, Object> params = new HashMap<String, Object>(); params.put("member", member.getId()); try { return rpcCaller.call("resourcesManager", "getAllowedResources", params).readList(Resource.class); } catch (MemberNotExistsException e) { throw e; } catch (PrivilegeException e) { throw e; } catch (InternalErrorException e) { throw e; } catch (PerunException e) { throw new ConsistencyErrorException(e); } } }
private List<MemberSCIM> mapPerunMembersToScimMembers(List<Member> perunMembers) { List<MemberSCIM> scimMembers = new ArrayList(); for (Member perunMember : perunMembers) { User perunUser; try { perunUser = perunBl.getUsersManagerBl().getUserByMember(session, perunMember); MemberSCIM member = new MemberSCIM(); String id = String.valueOf(perunMember.getId()); member.setDisplay(perunUser.getDisplayName()); member.setValue(id); member.setRef(BASE_PATH + USERS_PATH + id); scimMembers.add(member); } catch (InternalErrorException ex) { log.error("Cannot find user with id " + perunMember.getUserId(), ex); } } return scimMembers; } }
@Override public String serializeToString() { return this.getClass().getSimpleName() + ":[" + "id=<" + getId() + ">" + ", userId=<" + getUserId() + ">" + ", voId=<" + getVoId() + ">" + ", status=<" + (getStatus() == null ? "\\0" : BeansUtils.createEscaping(getStatus().toString())) + ">" + ", type=<" + (getMembershipType() == null ? "\\0" : BeansUtils.createEscaping(getMembershipType().toString())) + ">" + ", sourceGroupId=<" + (getSourceGroupId() == null ? "\\0" : getSourceGroupId().toString()) + ">" + ", sponsored=<" + sponsored + ">" + ']'; }
.getAllowedResources(perunSession, member); } catch (MemberNotExistsException ex) { log.warn("Non-existing member found while resolving event. id={}", member.getId());
} catch (AlreadyMemberException ex) { throw new RegistrarException("User is already member of your VO/group with ID:"+ex.getMember().getId()+" (user joined his identities after sending new application). You can reject this application and re-validate old member to keep old data (e.g. login,email).", ex); } catch (MemberNotExistsException ex) { throw new RegistrarException("To approve application user must already be member of VO.", ex);
public RichMember(User user, Member member, List<UserExtSource> userExtSources) { super(member.getId(), member.getUserId(), member.getVoId(), member.getStatus(), member.getCreatedAt(), member.getCreatedBy(), member.getModifiedAt(), member.getModifiedBy(), member.getCreatedByUid(), member.getModifiedByUid()); setMembershipType(member.getMembershipType()); setSponsored(member.isSponsored()); this.setGroupsStatuses(member.getGroupStatuses()); this.user = user; this.userExtSources = userExtSources; this.userAttributes = null; this.memberAttributes = null; }
throw new ConsistencyErrorException("User ID hasn't been associated with the application " + appId + ", because more than one application exists under the same ID."); log.info("Member {} created for: {} / {}", member.getId(), app.getCreatedBy(), app.getExtSourceName()); member = groupsManager.getGroupMemberById(registrarSession, app.getGroup(), member.getId());
member = groupsManager.getGroupMemberById(registrarSession, group, member.getId());