KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > usermanager > JahiaSiteUserManagerService


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12

13 package org.jahia.services.usermanager;
14
15 import org.jahia.data.JahiaDOMObject;
16 import org.jahia.exceptions.JahiaException;
17 import org.jahia.services.JahiaService;
18
19 import java.util.Hashtable JavaDoc;
20 import java.util.Vector JavaDoc;
21
22
23 /**
24  * Manage users memberhip in a multi site context
25  *
26  * @author Khue Ng
27  */

28 public abstract class JahiaSiteUserManagerService extends JahiaService {
29
30
31     /**
32      * Create a new membership for a user on a gived site
33      *
34      * @param siteID the site identifier
35      * @param user the user to add as member
36      */

37     public abstract boolean addMember (int siteID, JahiaUser user) throws JahiaException;
38
39
40     /**
41      * Remove a user's membership from a site, doesn't delete the user
42      *
43      * @param siteID the site identifier
44      * @param user reference on the user to be removed from the site.
45      */

46     public abstract boolean removeMember (int siteID, JahiaUser user) throws JahiaException;
47
48
49     /**
50      * Remove a user's membership from all sites, doesn't delete the user
51      *
52      * @param user the user to be removed from the site.
53      */

54     public abstract boolean removeMember (JahiaUser user) throws JahiaException;
55
56
57     /**
58      * Remove all users of a site ( only the membership, not the user )
59      *
60      * @param siteID the identifier of the site.
61      */

62     public abstract boolean removeMembers (int siteID) throws JahiaException;
63
64
65     /**
66      * This method returns an hashtable of username/usr_id couples of members of the requested site
67      *
68      * @param siteID the site identifier
69      *
70      * @return Return an Hashtable of username/usrid couples members of this site.
71      */

72     public abstract Hashtable JavaDoc getMembersMap (int siteID) throws JahiaException;
73
74
75     /**
76      * This method returns the list of all members of this site.
77      *
78      * @param siteID the site identifier
79      *
80      * @return Vector of members of this site.
81      */

82     public abstract Vector JavaDoc getMembers (int siteID) throws JahiaException;
83
84
85     /**
86      * Check if a user has or not access on a site.
87      *
88      * @param siteID the site identifier
89      * @param username the site identifier
90      *
91      * @return Return the user if not null.
92      */

93     public abstract JahiaUser getMember (int siteID, String JavaDoc username) throws JahiaException;
94
95
96     /**
97      * return a DOM document of all users membership of a site
98      *
99      * @param siteID the site id
100      *
101      * @return JahiaDOMObject a DOM representation of this object
102      */

103     public abstract JahiaDOMObject getUserMembershipsAsDOM (int siteID)
104             throws JahiaException;
105
106
107     /**
108      * return a DOM document of external users ( from other site )
109      * that have membership access on this site
110      *
111      * @param siteID the site id
112      *
113      * @return JahiaDOMObject a DOM representation of this object
114      */

115     public abstract JahiaDOMObject getAuthExternalUsersAsDOM (int siteID)
116             throws JahiaException;
117
118
119     public abstract void refreshUser(int id, String JavaDoc username);
120 }
121
Popular Tags