This project has retired. For details please refer to its
Attic page.
UserService xref
1 package org.apache.archiva.redback.rest.api.services;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.archiva.redback.authorization.RedbackAuthorization;
23 import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants;
24 import org.apache.archiva.redback.rest.api.model.Operation;
25 import org.apache.archiva.redback.rest.api.model.Permission;
26 import org.apache.archiva.redback.rest.api.model.RegistrationKey;
27 import org.apache.archiva.redback.rest.api.model.ResetPasswordRequest;
28 import org.apache.archiva.redback.rest.api.model.User;
29 import org.apache.archiva.redback.rest.api.model.UserRegistrationRequest;
30
31 import javax.ws.rs.Consumes;
32 import javax.ws.rs.GET;
33 import javax.ws.rs.POST;
34 import javax.ws.rs.Path;
35 import javax.ws.rs.PathParam;
36 import javax.ws.rs.Produces;
37 import javax.ws.rs.core.MediaType;
38 import java.util.Collection;
39 import java.util.List;
40
41 @Path( "/userService/" )
42 public interface UserService
43 {
44 @Path( "getUser/{userName}" )
45 @GET
46 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
47 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
48 User getUser( @PathParam( "userName" ) String username )
49 throws RedbackServiceException;
50
51
52 @Path( "getUsers" )
53 @GET
54 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
55 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_LIST_OPERATION )
56 List<User> getUsers()
57 throws RedbackServiceException;
58
59 @Path( "createUser" )
60 @POST
61 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
62 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
63 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_CREATE_OPERATION )
64 Boolean createUser( User user )
65 throws RedbackServiceException;
66
67
68
69
70
71 @Path( "createAdminUser" )
72 @POST
73 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
74 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
75 @RedbackAuthorization( noRestriction = true )
76 Boolean createAdminUser( User user )
77 throws RedbackServiceException;
78
79 @Path( "isAdminUserExists" )
80 @GET
81 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
82 @RedbackAuthorization( noRestriction = true )
83 Boolean isAdminUserExists()
84 throws RedbackServiceException;
85
86
87 @Path( "deleteUser/{userName}" )
88 @GET
89 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
90 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_DELETE_OPERATION )
91 Boolean deleteUser( @PathParam( "userName" ) String username )
92 throws RedbackServiceException;
93
94 @Path( "updateUser" )
95 @POST
96 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
97 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
98 Boolean updateUser( User user )
99 throws RedbackServiceException;
100
101
102
103
104 @Path( "lockUser/{username}" )
105 @GET
106 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
107 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
108 Boolean lockUser( @PathParam( "username" ) String username )
109 throws RedbackServiceException;
110
111
112
113
114 @Path( "unlockUser/{username}" )
115 @GET
116 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
117 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
118 Boolean unlockUser( @PathParam( "username" ) String username )
119 throws RedbackServiceException;
120
121
122
123
124
125 @Path( "passwordChangeRequired/{username}" )
126 @GET
127 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
128 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
129 Boolean passwordChangeRequired( @PathParam( "username" ) String username )
130 throws RedbackServiceException;
131
132
133
134
135 @Path( "passwordChangeNotRequired/{username}" )
136 @GET
137 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
138 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
139 Boolean passwordChangeNotRequired( @PathParam( "username" ) String username )
140 throws RedbackServiceException;
141
142
143
144
145
146
147
148 @Path( "updateMe" )
149 @POST
150 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
151 @RedbackAuthorization( noRestriction = false, noPermission = true )
152 Boolean updateMe( User user )
153 throws RedbackServiceException;
154
155 @Path( "ping" )
156 @GET
157 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
158 @RedbackAuthorization( noRestriction = true )
159 Boolean ping()
160 throws RedbackServiceException;
161
162 @Path( "removeFromCache/{userName}" )
163 @GET
164 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
165 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
166 int removeFromCache( @PathParam( "userName" ) String username )
167 throws RedbackServiceException;
168
169 @Path( "getGuestUser" )
170 @GET
171 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
172 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
173 User getGuestUser()
174 throws RedbackServiceException;
175
176 @Path( "createGuestUser" )
177 @GET
178 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
179 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_EDIT_OPERATION )
180 User createGuestUser()
181 throws RedbackServiceException;
182
183
184
185
186
187 @Path( "registerUser" )
188 @POST
189 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
190 @RedbackAuthorization( noRestriction = true, noPermission = true )
191 RegistrationKey registerUser( UserRegistrationRequest userRegistrationRequest )
192 throws RedbackServiceException;
193
194
195
196
197
198
199
200
201 @Path( "validateKey/{key}" )
202 @GET
203 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
204 @RedbackAuthorization( noRestriction = true, noPermission = true )
205 Boolean validateUserFromKey( @PathParam( "key" ) String key )
206 throws RedbackServiceException;
207
208
209
210
211
212
213 @Path( "resetPassword" )
214 @POST
215 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
216 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
217 @RedbackAuthorization( noRestriction = true, noPermission = true )
218 Boolean resetPassword( ResetPasswordRequest resetPasswordRequest )
219 throws RedbackServiceException;
220
221
222
223
224 @Path( "getUserPermissions/{userName}" )
225 @GET
226 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
227 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_LIST_OPERATION )
228 Collection<Permission> getUserPermissions( @PathParam( "userName" ) String userName )
229 throws RedbackServiceException;
230
231
232
233
234 @Path( "getUserOperations/{userName}" )
235 @GET
236 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
237 @RedbackAuthorization( permissions = RedbackRoleConstants.USER_MANAGEMENT_USER_LIST_OPERATION )
238 Collection<Operation> getUserOperations( @PathParam( "userName" ) String userName )
239 throws RedbackServiceException;
240
241
242
243
244
245 @Path( "getCurrentUserPermissions" )
246 @GET
247 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
248 @RedbackAuthorization( noRestriction = true, noPermission = true )
249 Collection<Permission> getCurrentUserPermissions()
250 throws RedbackServiceException;
251
252
253
254
255
256 @Path( "getCurrentUserOperations" )
257 @GET
258 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
259 @RedbackAuthorization( noRestriction = true, noPermission = true )
260 Collection<Operation> getCurrentUserOperations()
261 throws RedbackServiceException;
262
263 }