This project has retired. For details please refer to its Attic page.
Source code
001package 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
021import org.apache.archiva.redback.authorization.RedbackAuthorization;
022import org.apache.archiva.rest.api.model.CacheEntry;
023import org.apache.archiva.rest.api.model.QueueEntry;
024import org.apache.archiva.rest.api.model.RepositoryScannerStatistics;
025import org.apache.archiva.security.common.ArchivaRoleConstants;
026
027import javax.ws.rs.GET;
028import javax.ws.rs.Path;
029import javax.ws.rs.PathParam;
030import javax.ws.rs.Produces;
031import javax.ws.rs.core.MediaType;
032import java.util.List;
033
034/**
035 * @author Olivier Lamy
036 * @since 1.4-M3
037 */
038@Path( "/systemStatusService/" )
039public interface SystemStatusService
040{
041    @Path( "memoryStatus" )
042    @GET
043    @Produces( MediaType.TEXT_PLAIN )
044    @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
045    String getMemoryStatus()
046        throws ArchivaRestServiceException;
047
048    @Path( "currentServerTime/{locale}" )
049    @GET
050    @Produces( MediaType.TEXT_PLAIN )
051    @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
052    String getCurrentServerTime( @PathParam( "locale" ) String locale )
053        throws ArchivaRestServiceException;
054
055    @Path( "queueEntries" )
056    @GET
057    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
058    @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
059    List<QueueEntry> getQueueEntries()
060        throws ArchivaRestServiceException;
061
062    @Path( "cacheEntries" )
063    @GET
064    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
065    @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
066    List<CacheEntry> getCacheEntries()
067        throws ArchivaRestServiceException;
068
069    @Path( "clearCache/{key}" )
070    @GET
071    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
072    @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
073    Boolean clearCache( @PathParam( "key" ) String cacheKey )
074        throws ArchivaRestServiceException;
075
076    @Path( "clearAllCaches" )
077    @GET
078    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
079    @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
080    Boolean clearAllCaches()
081        throws ArchivaRestServiceException;
082
083
084    @Path( "repositoryScannerStatistics" )
085    @GET
086    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
087    @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
088    List<RepositoryScannerStatistics> getRepositoryScannerStatistics()
089        throws ArchivaRestServiceException;
090
091}