public GroupQueryBuilder setNameAndType(String name, String type) { groupKey = new GroupKey(name, type); groupName = name; groupType = type; return this; }
private void prepare() { if (groupKey == null && (groupName != null && groupType != null)) { groupKey = new GroupKey(groupName, groupType); } }
public GroupQueryBuilder setKey(String id) { groupKey = new GroupKey(id); return this; }
protected Group createGroupFromId(String id) { return new SimpleGroup(new GroupKey(id)); }
protected Group createGroupFromId(String id) { return new SimpleGroup(new GroupKey(id)); }
public SimpleGroup(String name, String groupType) { this.name = name; this.groupType = groupType; this.id = new GroupKey(name, groupType).getKey(); }
public RoleQueryBuilder setGroup(String id) { checkNotNullArgument(id, "Group id"); this.group = new SimpleGroup(new GroupKey(id)); return this; }
public static String parseKey(String name, String type) { GroupKey gid = new GroupKey(name, type); String id = gid.getKey(); gid = null; return id; }
public GroupQueryBuilder addAssociatedGroup(String id, boolean parent) { checkNotNullArgument(id, "Group id"); Group group = new SimpleGroup(new GroupKey(id)); if (parent) { associatedParentGroups.add(group); } else { associatedChildGroups.add(group); } return this; }
public void addMember(String id) { if (GroupKey.validateKey(id)) { members.add(new SimpleGroup(new GroupKey(id))); return; } members.add(new SimpleUser(id)); }
public GroupQueryBuilder addAssociatedGroupsKeys(Collection<String> ids, boolean parent) { checkNotNullArgument(ids, "Groups ids"); for (String groupId : ids) { Group group = new SimpleGroup(new GroupKey(groupId)); if (parent) { associatedParentGroups.add(group); } else { associatedChildGroups.add(group); } } return this; }
public void addParent(String id) { if (GroupKey.validateKey(id)) { parents.add(new SimpleGroup(new GroupKey(id))); return; } parents.add(new SimpleUser(id)); }
protected IdentityType createIdentityTypeFromId(String id) { if (GroupKey.validateKey(id)) { GroupKey groupKey = new GroupKey(id); return new SimpleGroup(groupKey); } else { return new SimpleUser(id); } }
protected IdentityType createIdentityTypeFromId(String id) { if (GroupKey.validateKey(id)) { GroupKey groupKey = new GroupKey(id); return new SimpleGroup(groupKey); } else { return new SimpleUser(id); } }
protected IdentityObject createIdentityObject(String id) { if (GroupKey.validateKey(id)) { GroupKey groupKey = new GroupKey(id); return createIdentityObjectForGroupId(id); } else { return createIdentityObjectForUserName(id); } }
public void removeGroup(String groupId, boolean force) throws IdentityException { try { checkNotNullArgument(groupId, "Group Id"); //TODO: force preRemove(new SimpleGroup(new GroupKey(groupId))); getRepository().removeIdentityObject(getInvocationContext(), createIdentityObjectForGroupId(groupId)); if (cache != null) { cache.invalidate(cacheNS); } postRemove(new SimpleGroup(new GroupKey(groupId))); } catch (IdentityException e) { if (log.isLoggable(Level.FINER)) { log.log(Level.FINER, "Exception occurred: ", e); } throw e; } }
public void associateGroupsByKeys(String parentId, String memberId) throws IdentityException { try { checkNotNullArgument(parentId, "Parent Id"); checkNotNullArgument(memberId, "Member Id"); Group parent = new SimpleGroup(new GroupKey(parentId)); Group member = new SimpleGroup(new GroupKey(memberId)); preGroupAssociationCreate(parent, member); getRepository().createRelationship(getInvocationContext(), createIdentityObjectForGroupId(parentId), createIdentityObjectForGroupId(memberId), MEMBER, null, true); if (cache != null) { cache.invalidateAllQueries(cacheNS); cache.invalidateAllSearches(cacheNS); } postGroupAssociationCreate(parent, member); } catch (IdentityException e) { if (log.isLoggable(Level.FINER)) { log.log(Level.FINER, "Exception occurred: ", e); } throw e; } }
public String createGroupKey(String groupName, String groupType) { checkNotNullArgument(groupName, "Group name"); checkNotNullArgument(groupType, "Group type"); checkObjectName(groupName); checkObjectName(groupType); return new GroupKey(groupName, groupType).getKey(); }
protected IdentityObject createIdentityObjectForGroupId(String groupId) { GroupKey key = new GroupKey(groupId); IdentityObjectType iot = getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(key.getType()); return new SimpleIdentityObject(key.getName(), null, iot); }
public Group findGroupByKey(String id) throws IdentityException { checkNotNullArgument(id, "Group id"); if (!GroupKey.validateKey(id)) { throw new IdentityException("Provided group id is not valid: " + id + "; " + "Please use PersistenceManager.createGroupKey() to obtain valid group id"); } GroupKey groupKey = new GroupKey(id); return findGroup(groupKey.getName(), groupKey.getType()); }