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()); }
public void addMember(String id) { if (GroupKey.validateKey(id)) { members.add(new SimpleGroup(new GroupKey(id))); return; } members.add(new SimpleUser(id)); }
public GroupQueryBuilder setNameAndType(String name, String type) { groupKey = new GroupKey(name, type); groupName = name; groupType = type; return this; }
public void removeGroup(String ns, String groupType, String groupName) { Fqn nodeFqn = getFqn(ns, NODE_GROUPS, GroupKey.parseKey(groupName, groupType)); removeNode(nodeFqn); if (log.isLoggable(Level.FINER)) { log.finer(this.toString() + "Group removed from cache: id= " + GroupKey.parseKey(groupName, groupType) + ";namespace=" + ns); } }
public GroupKey(String id) { if (id == null) { throw new IllegalArgumentException("id is null"); } String[] parts = id.split(SEPARATOR_REGEX); if (!validateKey(id)) { throw new IllegalArgumentException("group id not following required format: " + PREFIX + SEPARATOR + "groupType" + SEPARATOR + "name : " + id); } name = parts[2]; type = parts[1]; }
public void addParent(String id) { if (GroupKey.validateKey(id)) { parents.add(new SimpleGroup(new GroupKey(id))); return; } parents.add(new SimpleUser(id)); }
private void prepare() { if (groupKey == null && (groupName != null && groupType != null)) { groupKey = new GroupKey(groupName, groupType); } }
public Group getGroup(String ns, String groupType, String groupName) { Fqn nodeFqn = getFqn(ns, NODE_GROUPS, GroupKey.parseKey(groupName, groupType)); Node node = getNode(nodeFqn); if (node != null) { Group group = (Group)node.get(NODE_OBJECT_KEY); if (log.isLoggable(Level.FINER) && group != null) { log.finer(this.toString() + "Group found in cache: id=" + group.getKey() + ";namespace=" + ns); } return group; } return null; }
protected IdentityType createIdentityTypeFromId(String id) { if (GroupKey.validateKey(id)) { GroupKey groupKey = new GroupKey(id); return new SimpleGroup(groupKey); } else { return new SimpleUser(id); } }
public GroupQueryBuilder setKey(String id) { groupKey = new GroupKey(id); return this; }
protected IdentityType createIdentityTypeFromId(String id) { if (GroupKey.validateKey(id)) { GroupKey groupKey = new GroupKey(id); return new SimpleGroup(groupKey); } else { return new SimpleUser(id); } }
protected Group createGroupFromId(String id) { return new SimpleGroup(new GroupKey(id)); }
protected IdentityObject createIdentityObject(String id) { if (GroupKey.validateKey(id)) { GroupKey groupKey = new GroupKey(id); return createIdentityObjectForGroupId(id); } else { return createIdentityObjectForUserName(id); } }
protected Group createGroupFromId(String id) { return new SimpleGroup(new GroupKey(id)); }