001    package org.apache.archiva.rest.api.services;
002    /*
003     * Licensed to the Apache Software Foundation (ASF) under one
004     * or more contributor license agreements.  See the NOTICE file
005     * distributed with this work for additional information
006     * regarding copyright ownership.  The ASF licenses this file
007     * to you under the Apache License, Version 2.0 (the
008     * "License"); you may not use this file except in compliance
009     * with the License.  You may obtain a copy of the License at
010     *
011     *   http://www.apache.org/licenses/LICENSE-2.0
012     *
013     * Unless required by applicable law or agreed to in writing,
014     * software distributed under the License is distributed on an
015     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016     * KIND, either express or implied.  See the License for the
017     * specific language governing permissions and limitations
018     * under the License.
019     */
020    
021    import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
022    import org.apache.archiva.admin.model.beans.LdapConfiguration;
023    import org.apache.archiva.redback.authorization.RedbackAuthorization;
024    import org.apache.archiva.rest.api.model.RBACManagerImplementationInformation;
025    import org.apache.archiva.rest.api.model.RedbackImplementationsInformations;
026    import org.apache.archiva.rest.api.model.UserManagerImplementationInformation;
027    import org.apache.archiva.security.common.ArchivaRoleConstants;
028    
029    import javax.ws.rs.Consumes;
030    import javax.ws.rs.GET;
031    import javax.ws.rs.POST;
032    import javax.ws.rs.PUT;
033    import javax.ws.rs.Path;
034    import javax.ws.rs.Produces;
035    import javax.ws.rs.core.MediaType;
036    import java.util.List;
037    
038    /**
039     * @author Olivier Lamy
040     * @since 1.4-M4
041     */
042    @Path("/redbackRuntimeConfigurationService/")
043    public interface RedbackRuntimeConfigurationService
044    {
045        @Path("redbackRuntimeConfiguration")
046        @GET
047        @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
048        @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
049        RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
050            throws ArchivaRestServiceException;
051    
052        @Path("redbackRuntimeConfiguration")
053        @PUT
054        @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
055        @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
056        @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
057        Boolean updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
058            throws ArchivaRestServiceException;
059    
060        @Path("userManagerImplementationInformations")
061        @GET
062        @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
063        @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
064        List<UserManagerImplementationInformation> getUserManagerImplementationInformations()
065            throws ArchivaRestServiceException;
066    
067        @Path("rbacManagerImplementationInformations")
068        @GET
069        @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
070        @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
071        List<RBACManagerImplementationInformation> getRbacManagerImplementationInformations()
072            throws ArchivaRestServiceException;
073    
074    
075        @Path("redbackImplementationsInformations")
076        @GET
077        @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
078        @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
079        RedbackImplementationsInformations getRedbackImplementationsInformations()
080            throws ArchivaRestServiceException;
081    
082        @Path( "checkLdapConnection" )
083        @GET
084        @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
085        @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
086        Boolean checkLdapConnection()
087            throws ArchivaRestServiceException;
088    
089        @Path("checkLdapConnection")
090        @POST
091        @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
092        @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
093        @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
094        Boolean checkLdapConnection( LdapConfiguration ldapConfiguration )
095            throws ArchivaRestServiceException;
096    }