This project has retired. For details please refer to its Attic page.
LdapGroupMappingService xref
View Javadoc

1   package org.apache.archiva.redback.rest.api.services;
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   * http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  
21  import org.apache.archiva.redback.authorization.RedbackAuthorization;
22  import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants;
23  import org.apache.archiva.redback.rest.api.model.LdapGroupMapping;
24  import org.apache.archiva.redback.rest.api.model.LdapGroupMappingUpdateRequest;
25  import org.apache.archiva.redback.rest.api.model.StringList;
26  
27  import javax.ws.rs.Consumes;
28  import javax.ws.rs.DELETE;
29  import javax.ws.rs.GET;
30  import javax.ws.rs.POST;
31  import javax.ws.rs.PUT;
32  import javax.ws.rs.Path;
33  import javax.ws.rs.PathParam;
34  import javax.ws.rs.Produces;
35  import javax.ws.rs.QueryParam;
36  import javax.ws.rs.core.MediaType;
37  import java.util.List;
38  
39  /**
40   * @author Olivier Lamy
41   * @since 2.1
42   */
43  @Path("/ldapGroupMappingService/")
44  public interface LdapGroupMappingService
45  {
46      @Path("ldapGroups")
47      @GET
48      @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
49      @RedbackAuthorization(permissions = RedbackRoleConstants.CONFIGURATION_EDIT_OPERATION)
50      StringList getLdapGroups()
51          throws RedbackServiceException;
52  
53  
54      @GET
55      @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
56      @RedbackAuthorization(permissions = RedbackRoleConstants.CONFIGURATION_EDIT_OPERATION)
57      List<LdapGroupMapping> getLdapGroupMappings()
58          throws RedbackServiceException;
59  
60  
61      @PUT
62      @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
63      @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
64      @RedbackAuthorization(permissions = RedbackRoleConstants.CONFIGURATION_EDIT_OPERATION)
65      Boolean addLdapGroupMapping( LdapGroupMapping ldapGroupMapping )
66          throws RedbackServiceException;
67  
68      @DELETE
69      @Path("{group}")
70      @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
71      @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
72      @RedbackAuthorization(permissions = RedbackRoleConstants.CONFIGURATION_EDIT_OPERATION)
73      Boolean removeLdapGroupMapping( @PathParam("group") String group )
74          throws RedbackServiceException;
75  
76      @POST
77      @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
78      @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
79      @RedbackAuthorization(permissions = RedbackRoleConstants.CONFIGURATION_EDIT_OPERATION)
80      Boolean updateLdapGroupMapping( LdapGroupMappingUpdateRequest ldapGroupMappingUpdateRequest )
81          throws RedbackServiceException;
82  
83  }