Package io.continual.iam.impl.common
Class CommonJsonGroup
- java.lang.Object
-
- io.continual.iam.impl.common.CommonJsonObject
-
- io.continual.iam.impl.common.CommonJsonGroup
-
- All Implemented Interfaces:
Group,UserDataHolder
public class CommonJsonGroup extends CommonJsonObject implements Group
-
-
Constructor Summary
Constructors Constructor Description CommonJsonGroup(CommonJsonDb<?,?> db, String id, org.json.JSONObject groupData)Deprecated.Use the other form, which is more similar to the identity constructorCommonJsonGroup(String id, org.json.JSONObject groupData, CommonJsonDb<?,?> db)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUser(String userId)protected org.json.JSONObjectgetDataRecord()StringgetId()Get an identifier for this groupSet<String>getMembers()Get members of the groupStringgetName()Get a readable name for this groupstatic org.json.JSONObjectinitializeGroup(String name)booleanisMember(String userId)Is the given user a member of this group?voidreload()reload this object from the servervoidremoveUser(String userId)protected voidstore()-
Methods inherited from class io.continual.iam.impl.common.CommonJsonObject
getAllUserData, getUserData, getValue, getValue, putUserData, removeUserData, removeValue, setValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.continual.iam.identity.UserDataHolder
getAllUserData, getUserData, putUserData, removeUserData
-
-
-
-
Constructor Detail
-
CommonJsonGroup
@Deprecated public CommonJsonGroup(CommonJsonDb<?,?> db, String id, org.json.JSONObject groupData)
Deprecated.Use the other form, which is more similar to the identity constructorConstruct a group- Parameters:
db- an identity databaseid- the group's IDgroupData- additional group data
-
CommonJsonGroup
public CommonJsonGroup(String id, org.json.JSONObject groupData, CommonJsonDb<?,?> db)
-
-
Method Detail
-
initializeGroup
public static org.json.JSONObject initializeGroup(String name)
-
getId
public String getId()
Description copied from interface:GroupGet an identifier for this group
-
getName
public String getName()
Description copied from interface:GroupGet a readable name for this group
-
isMember
public boolean isMember(String userId) throws IamSvcException
Description copied from interface:GroupIs the given user a member of this group?- Specified by:
isMemberin interfaceGroup- Parameters:
userId- a user ID- Returns:
- true if the user is a member
- Throws:
IamSvcException- if there's a problem in the IAM service
-
getMembers
public Set<String> getMembers() throws IamSvcException
Description copied from interface:GroupGet members of the group- Specified by:
getMembersin interfaceGroup- Returns:
- a set of 0 or more user IDs
- Throws:
IamSvcException- if there's a problem in the IAM service
-
addUser
public void addUser(String userId) throws IamSvcException
- Throws:
IamSvcException
-
removeUser
public void removeUser(String userId) throws IamSvcException
- Throws:
IamSvcException
-
reload
public void reload() throws IamSvcExceptionDescription copied from interface:UserDataHolderreload this object from the server- Specified by:
reloadin interfaceUserDataHolder- Specified by:
reloadin classCommonJsonObject- Throws:
IamSvcException- if there's a problem in the IAM service
-
getDataRecord
protected org.json.JSONObject getDataRecord()
- Specified by:
getDataRecordin classCommonJsonObject
-
store
protected void store() throws IamSvcException- Specified by:
storein classCommonJsonObject- Throws:
IamSvcException
-
-