org.jwarp.service.groups
Interface IGroupService

All Superinterfaces:
IConfigurable, IExceptionProvider, IService

public interface IGroupService
extends IService


Field Summary
static java.lang.String SERVICE_TYPE
           
 
Fields inherited from interface org.jwarp.service.IService
SERVICE_STATUS_CREATED, SERVICE_STATUS_NOT_AVAILABLE, SERVICE_STATUS_READY, SERVICE_STATUS_RESUMING, SERVICE_STATUS_RUNNING, SERVICE_STATUS_STARTING, SERVICE_STATUS_STOPPED, SERVICE_STATUS_STOPPING, SERVICE_STATUS_SUSPENDED
 
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
 
Methods inherited from interface org.jwarp.service.configuration.IConfigurable
configure
 
Methods inherited from interface org.jwarp.common.IExceptionProvider
addExceptionListener, getExceptionListeners, removeAllExceptionListeners, removeExceptionListener
 

Field Detail

SERVICE_TYPE

public static final java.lang.String SERVICE_TYPE
Method Detail

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 identification
pwd - The user's password
name - The user's name
description - An optional description
relationID - An optional relation ID
admin - 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 name
description - An optional description
relationID - An optional relation ID
admin - 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 user
group - The group
admin - 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 user
group - The group
admin - 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 lookedup
group - The group
Returns:
true If the item is a member of the group

©   O R C A   S y s t e m s