org.jwarp.service.groups
Interface IGroupService
- All Superinterfaces:
- IConfigurable, IExceptionProvider, IService
- public interface IGroupService
- extends IService
|
Method Summary |
int |
addGroup(java.lang.Object data,
ITicket ticket)
Create a new group with the setings given. |
int |
addItem(java.lang.Object data)
Create a new user with the setings given. |
void |
addMember(int item,
int group,
ITicket ticket)
Add a user to a group |
IItem |
getItem(int id,
ITicket ticket)
Returns the user with the given id. |
java.util.Iterator |
getItems(ITicket ticket)
Returns all defined items. |
java.util.Iterator |
getMembers(int ref,
ITicket ticket)
Returns all members of a group. |
boolean |
isMember(int item,
int group,
ITicket ticket)
Is an item member of a group or one of its subgroups. |
IItem |
removeItem(int item,
ITicket ticket)
Removes the item. |
void |
removeMember(int member,
int target,
ITicket ticket)
Remove a user from a group |
| Methods inherited from interface org.jwarp.service.IService |
checkContext, getDependencies, getLogLevel, getName, getStatus, getType, resume, setContext, setDependencies, setLogLevel, shutdown, start, suspend |
SERVICE_TYPE
public static final java.lang.String SERVICE_TYPE
addItem
public int addItem(java.lang.Object data)
- Create a new user with the setings given. The relationID is used to have a reference
to whatever data the user needs, e.g. the primary key in the enterpise's personal db
or a more complex string containing several infos.
- Parameters:
uid - The user's identificationpwd - The user's passwordname - The user's namedescription - An optional descriptionrelationID - An optional relation IDadmin - The user who tries to create the new user- Throws:
java.lang.SecurityException - If the creation failed.
removeItem
public IItem removeItem(int item,
ITicket ticket)
- Removes the item. If the item was removed its instance is returned.
- Parameters:
item - The item to be removed- Returns:
- The item removed or null
addGroup
public int addGroup(java.lang.Object data,
ITicket ticket)
- Create a new group with the setings given. The relationID is used to have a reference
to whatever data the user needs, e.g. the primary key in the enterpise's db
or a more complex string containing several infos.
- Parameters:
name - The user's namedescription - An optional descriptionrelationID - An optional relation IDadmin - The user who tries to create the new user- Throws:
java.lang.SecurityException - If the creation failed.
addMember
public void addMember(int item,
int group,
ITicket ticket)
- Add a user to a group
- Parameters:
user - The usergroup - The groupadmin - The admin user- Throws:
java.lang.SecurityException - If the setting failed.
removeMember
public void removeMember(int member,
int target,
ITicket ticket)
- Remove a user from a group
- Parameters:
user - The usergroup - The groupadmin - The admin user- Throws:
java.lang.SecurityException - If the setting failed.
getItem
public IItem getItem(int id,
ITicket ticket)
- Returns the user with the given id.
- Returns:
- The corresponding user or null
getItems
public java.util.Iterator getItems(ITicket ticket)
- Returns all defined items.
getMembers
public java.util.Iterator getMembers(int ref,
ITicket ticket)
- Returns all members of a group.
- Parameters:
ref - The group reference
isMember
public boolean isMember(int item,
int group,
ITicket ticket)
- Is an item member of a group or one of its subgroups.
- Parameters:
item - The item to be lookedupgroup - The group- Returns:
- true If the item is a member of the group