]> source.dussan.org Git - archiva.git/commitdiff
Adapting to new cxf version. Using result objects instead of simple types in REST...
authorMartin Stockhammer <martin_s@apache.org>
Tue, 30 Jun 2020 06:05:07 +0000 (08:05 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Tue, 30 Jun 2020 06:05:07 +0000 (08:05 +0200)
48 files changed:
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ActionStatus.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/AvailabilityStatus.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileStatus.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/PermissionStatus.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ScanStatus.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ValidationStatus.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaRuntimeConfigurationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/BrowseService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ManagedRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/NetworkProxyService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorRuleService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RedbackRuntimeConfigurationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RemoteRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoryGroupService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SystemStatusService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaRuntimeConfigurationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultManagedRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultNetworkProxyService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorRuleService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRedbackRuntimeConfigurationService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/cxf/org.apache.cxf.Logger [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ArchivaAdministrationServiceTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/CommonServicesTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/CopyArtifactTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/ManagedRepositoriesServiceTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactFromQueryTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/RemoteRepositoryConnectivityCheckTest.java
pom.xml

diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ActionStatus.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ActionStatus.java
new file mode 100644 (file)
index 0000000..5620f4f
--- /dev/null
@@ -0,0 +1,55 @@
+package org.apache.archiva.rest.api.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.swing.*;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Simple result for actions that are triggered by the web service.
+ * @author Martin Stockhammer <martin_s@apache.org>
+ */
+@XmlRootElement(name = "actionStatus")
+public class ActionStatus
+{
+    private boolean success = false;
+
+    public static final ActionStatus SUCCESS = new ActionStatus( true );
+    public static final ActionStatus FAIL = new ActionStatus( false );
+
+    public ActionStatus() {
+
+    }
+
+    public ActionStatus( boolean success) {
+        this.success = success;
+    }
+
+    public boolean isSuccess( )
+    {
+        return success;
+    }
+
+    public void setSuccess( boolean success )
+    {
+        this.success = success;
+    }
+
+
+}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/AvailabilityStatus.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/AvailabilityStatus.java
new file mode 100644 (file)
index 0000000..001c69f
--- /dev/null
@@ -0,0 +1,51 @@
+package org.apache.archiva.rest.api.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * The availability status of some service.
+ *
+ * @author Martin Stockhammer <martin_s@apache.org>
+ */
+@XmlRootElement(name = "availabilityStatus")
+public class AvailabilityStatus
+{
+
+    boolean available = false;
+
+    public AvailabilityStatus() {
+
+    }
+
+    public AvailabilityStatus( boolean available) {
+        this.available = available;
+    }
+
+    public boolean isAvailable( )
+    {
+        return available;
+    }
+
+    public void setAvailable( boolean available )
+    {
+        this.available = available;
+    }
+}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileStatus.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileStatus.java
new file mode 100644 (file)
index 0000000..e53a96f
--- /dev/null
@@ -0,0 +1,50 @@
+package org.apache.archiva.rest.api.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Status result of a given file
+ *
+ * @author Martin Stockhammer <martin_s@apache.org>
+ */
+@XmlRootElement(name = "fileStatus")
+public class FileStatus
+{
+    boolean exists = false;
+
+    public FileStatus() {
+
+    }
+
+    public FileStatus(boolean exists) {
+        this.exists = exists;
+    }
+
+    public boolean isExists( )
+    {
+        return exists;
+    }
+
+    public void setExists( boolean exists )
+    {
+        this.exists = exists;
+    }
+}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/PermissionStatus.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/PermissionStatus.java
new file mode 100644 (file)
index 0000000..78412de
--- /dev/null
@@ -0,0 +1,51 @@
+package org.apache.archiva.rest.api.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Current permission status for some object
+ *
+ * @author Martin Stockhammer <martin_s@apache.org>
+ */
+@XmlRootElement(name = "permissionStatus")
+public class PermissionStatus
+{
+    boolean authorizedToDeleteArtifacts = false;
+
+    PermissionStatus() {
+
+    }
+
+    public PermissionStatus( boolean authorizedToDeleteArtifacts )
+    {
+        this.authorizedToDeleteArtifacts = authorizedToDeleteArtifacts;
+    }
+
+    public boolean isAuthorizedToDeleteArtifacts( )
+    {
+        return authorizedToDeleteArtifacts;
+    }
+
+    public void setAuthorizedToDeleteArtifacts( boolean authorizedToDeleteArtifacts )
+    {
+        this.authorizedToDeleteArtifacts = authorizedToDeleteArtifacts;
+    }
+}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ScanStatus.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ScanStatus.java
new file mode 100644 (file)
index 0000000..e7c09c8
--- /dev/null
@@ -0,0 +1,52 @@
+package org.apache.archiva.rest.api.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * The current status of repository scanning
+ *
+ * @author Martin Stockhammer <martin_s@apache.org>
+ */
+@XmlRootElement(name = "scanStatus")
+public class ScanStatus
+{
+    boolean isAlreadyScanning = false;
+
+
+    public ScanStatus() {
+
+    }
+
+    public ScanStatus( boolean isAlreadyScanning )
+    {
+        this.isAlreadyScanning = isAlreadyScanning;
+    }
+
+    public boolean isAlreadyScanning( )
+    {
+        return isAlreadyScanning;
+    }
+
+    public void setAlreadyScanning( boolean alreadyScanning )
+    {
+        isAlreadyScanning = alreadyScanning;
+    }
+}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ValidationStatus.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ValidationStatus.java
new file mode 100644 (file)
index 0000000..197d3f5
--- /dev/null
@@ -0,0 +1,51 @@
+package org.apache.archiva.rest.api.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Returns true, if a test is valid.
+ *
+ * @author Martin Stockhammer <martin_s@apache.org>
+ */
+@XmlRootElement(name="validationStatus")
+public class ValidationStatus
+{
+    boolean valid;
+
+    public ValidationStatus() {
+
+    }
+
+    public ValidationStatus( boolean valid )
+    {
+        this.valid = valid;
+    }
+
+    public boolean isValid( )
+    {
+        return valid;
+    }
+
+    public void setValid( boolean valid )
+    {
+        this.valid = valid;
+    }
+}
index 77544cc8ee90150b35386c4e51835b60de72aa54..60d40087e165335d096379cb16763ced75d99719 100644 (file)
@@ -27,6 +27,7 @@ import org.apache.archiva.admin.model.beans.NetworkConfiguration;
 import org.apache.archiva.admin.model.beans.OrganisationInformation;
 import org.apache.archiva.admin.model.beans.UiConfiguration;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
@@ -59,22 +60,22 @@ public interface ArchivaAdministrationService
     @GET
     @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
+    ActionStatus deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
         throws ArchivaRestServiceException;
 
     @Path( "addFileTypePattern" )
     @GET
     @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
+    ActionStatus addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
         throws ArchivaRestServiceException;
 
     @Path( "removeFileTypePattern" )
     @GET
     @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
-                                   @QueryParam( "pattern" ) String pattern )
+    ActionStatus removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
+                                        @QueryParam( "pattern" ) String pattern )
         throws ArchivaRestServiceException;
 
     @Path( "getFileType" )
@@ -103,14 +104,14 @@ public interface ArchivaAdministrationService
     @GET
     @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
+    ActionStatus removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
         throws ArchivaRestServiceException;
 
     @Path( "enabledKnownContentConsumer/{knownContentConsumer}" )
     @GET
     @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean enabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
+    ActionStatus enabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
         throws ArchivaRestServiceException;
 
     @Path( "enabledKnownContentConsumers" )
@@ -125,14 +126,14 @@ public interface ArchivaAdministrationService
     @GET
     @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean disabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
+    ActionStatus disabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
         throws ArchivaRestServiceException;
 
     @Path( "enabledInvalidContentConsumer/{invalidContentConsumer}" )
     @GET
     @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean enabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
+    ActionStatus enabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
         throws ArchivaRestServiceException;
 
     @Path( "enabledInvalidContentConsumers" )
@@ -146,7 +147,7 @@ public interface ArchivaAdministrationService
     @GET
     @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean disabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
+    ActionStatus disabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
         throws ArchivaRestServiceException;
 
     @Path( "getFileTypes" )
@@ -211,13 +212,6 @@ public interface ArchivaAdministrationService
     UiConfiguration getUiConfiguration( )
         throws ArchivaRestServiceException;
 
-    @Path( "registrationDisabled" )
-    @GET
-    @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
-    @RedbackAuthorization( noRestriction = true, noPermission = true )
-    Boolean registrationDisabled( )
-        throws ArchivaRestServiceException;
-
     @Path( "setUiConfiguration" )
     @POST
     @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
index ba1f9466b03535859800548f6cb038b3e0cf23cc..a53c06d99722f24031b84fafb11403ca1ff61c9f 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.rest.api.services;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
 import javax.ws.rs.Consumes;
@@ -50,6 +51,6 @@ public interface ArchivaRuntimeConfigurationService
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean updateArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
+    ActionStatus updateArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
         throws ArchivaRestServiceException;
 }
index 43d2d52dec85aeb2edbf689b20fefaa41ebf7e7f..c957c14fcdb813da42be9f4194d5e530285d27a5 100644 (file)
@@ -24,8 +24,10 @@ import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.maven2.model.TreeEntry;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.ArtifactContent;
 import org.apache.archiva.rest.api.model.ArtifactContentEntry;
+import org.apache.archiva.rest.api.model.AvailabilityStatus;
 import org.apache.archiva.rest.api.model.BrowseResult;
 import org.apache.archiva.rest.api.model.Entry;
 import org.apache.archiva.rest.api.model.MetadataAddRequest;
@@ -148,24 +150,24 @@ public interface BrowseService
     @PUT
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @RedbackAuthorization(noPermission = false, noRestriction = false, permissions = "archiva-add-metadata")
-    Boolean addMetadata( @PathParam("g") String groupId, @PathParam("a") String artifactId,
-                         @PathParam("v") String version, @PathParam("key") String key, @PathParam("value") String value,
-                         @QueryParam("repositoryId") String repositoryId )
+    ActionStatus addMetadata( @PathParam("g") String groupId, @PathParam("a") String artifactId,
+                              @PathParam("v") String version, @PathParam("key") String key, @PathParam("value") String value,
+                              @QueryParam("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
 
     @Path("metadata/{g}/{a}/{v}/{key}")
     @DELETE
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @RedbackAuthorization(noPermission = false, noRestriction = false, permissions = "archiva-add-metadata")
-    Boolean deleteMetadata( @PathParam("g") String groupId, @PathParam("a") String artifactId,
-                            @PathParam("v") String version, @PathParam("key") String key,
-                            @QueryParam("repositoryId") String repositoryId )
+    ActionStatus deleteMetadata( @PathParam("g") String groupId, @PathParam("a") String artifactId,
+                                 @PathParam("v") String version, @PathParam("key") String key,
+                                 @QueryParam("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
 
     @Path("importMetadata")
     @POST
     @RedbackAuthorization(noPermission = false, noRestriction = false, permissions = "archiva-add-metadata")
-    Boolean importMetadata( MetadataAddRequest metadataAddRequest, @QueryParam("repository") String repository )
+    ActionStatus importMetadata( MetadataAddRequest metadataAddRequest, @QueryParam("repository") String repository )
         throws ArchivaRestServiceException;
 
     @Path("artifactContentEntries/{g}/{a}/{v}")
@@ -211,8 +213,8 @@ public interface BrowseService
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @RedbackAuthorization(noPermission = true, noRestriction = true)
-    Boolean artifactAvailable( @PathParam("g") String groupId, @PathParam("a") String artifactId,
-                               @PathParam("v") String version, @QueryParam("repositoryId") String repositoryId )
+    AvailabilityStatus artifactAvailable( @PathParam("g") String groupId, @PathParam("a") String artifactId,
+                                          @PathParam("v") String version, @QueryParam("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
 
     /**
@@ -224,9 +226,9 @@ public interface BrowseService
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization( noPermission = true, noRestriction = true )
-    Boolean artifactAvailable( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
-                               @PathParam( "v" ) String version, @PathParam( "c" ) String classifier,
-                               @QueryParam( "repositoryId" ) String repositoryId )
+    AvailabilityStatus artifactAvailable( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
+                                          @PathParam( "v" ) String version, @PathParam( "c" ) String classifier,
+                                          @QueryParam( "repositoryId" ) String repositoryId )
         throws ArchivaRestServiceException;
 
     /**
index 9589a103b24cceefd6df88a20c6a3453c2e1ab60..68d827fa138dc10c27e82e015f0ae5d344866aa4 100644 (file)
@@ -20,6 +20,8 @@ package org.apache.archiva.rest.api.services;
 
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
+import org.apache.archiva.rest.api.model.ValidationStatus;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -68,7 +70,7 @@ public interface CommonServices
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization( noRestriction = true )
-    Boolean validateCronExpression( @QueryParam( "cronExpression" ) String cronExpression )
+    ValidationStatus validateCronExpression( @QueryParam( "cronExpression" ) String cronExpression )
         throws ArchivaRestServiceException;
 
 }
index c2df28337b1e35cfcf13bac9e46861552eedb9c6..208f24f09eddb9157c01016facdc4dba788b4da1 100644 (file)
@@ -23,7 +23,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.tags.Tags;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.ArchivaRepositoryStatistics;
+import org.apache.archiva.rest.api.model.FileStatus;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
 import javax.ws.rs.Consumes;
@@ -65,8 +67,8 @@ public interface ManagedRepositoriesService
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean deleteManagedRepository( @QueryParam( "repositoryId" ) String repositoryId,
-                                     @QueryParam( "deleteContent" ) boolean deleteContent )
+    ActionStatus deleteManagedRepository( @QueryParam( "repositoryId" ) String repositoryId,
+                                          @QueryParam( "deleteContent" ) boolean deleteContent )
         throws ArchivaRestServiceException;
 
 
@@ -84,17 +86,17 @@ public interface ManagedRepositoriesService
     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean updateManagedRepository( ManagedRepository managedRepository )
+    ActionStatus updateManagedRepository( ManagedRepository managedRepository )
         throws ArchivaRestServiceException;
 
     /**
-     * @since 1.4-M3
+     * @since 3.0
      */
     @Path( "fileLocationExists" )
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean fileLocationExists( @QueryParam( "fileLocation" ) String fileLocation )
+    FileStatus getFileStatus( @QueryParam( "fileLocation" ) String fileLocation )
         throws ArchivaRestServiceException;
 
     /**
index be5489e1dc044649d11fc287e1f70bbb99078d87..24ef02d8d90936925aaf0fe561e460ec3cc5c229 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.rest.api.services;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.NetworkProxy;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
 import javax.ws.rs.Consumes;
@@ -74,6 +75,6 @@ public interface NetworkProxyService
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean deleteNetworkProxy( @PathParam( "networkProxyId" ) String networkProxyId )
+    ActionStatus deleteNetworkProxy( @PathParam( "networkProxyId" ) String networkProxyId )
         throws ArchivaRestServiceException;
 }
index 1399effd9b9f7860d2510c0fc00f6687a097cced..da7c66268ab73f1a38419613c1aaef6949d82aac 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.rest.api.services;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.ProxyConnectorRule;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
 import javax.ws.rs.Consumes;
@@ -53,7 +54,7 @@ public interface ProxyConnectorRuleService
     @Consumes ( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces ( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization ( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean addProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
+    ActionStatus addProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
         throws ArchivaRestServiceException;
 
     @Path ( "deleteProxyConnectorRule" )
@@ -61,7 +62,7 @@ public interface ProxyConnectorRuleService
     @Consumes ( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces ( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization ( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean deleteProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
+    ActionStatus deleteProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
         throws ArchivaRestServiceException;
 
     /**
@@ -72,6 +73,6 @@ public interface ProxyConnectorRuleService
     @Consumes ( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces ( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization ( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean updateProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
+    ActionStatus updateProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
         throws ArchivaRestServiceException;
 }
index b370d237e4520c541ccb09f8ee101fd7416993a5..2dd6b2db516fc6fcda274596cefbbf81e39f9047 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.rest.api.services;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.ProxyConnector;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.PolicyInformation;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
@@ -63,7 +64,7 @@ public interface ProxyConnectorService
     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean addProxyConnector( ProxyConnector proxyConnector )
+    ActionStatus addProxyConnector( ProxyConnector proxyConnector )
         throws ArchivaRestServiceException;
 
     @Path( "deleteProxyConnector" )
@@ -71,7 +72,7 @@ public interface ProxyConnectorService
     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean deleteProxyConnector( ProxyConnector proxyConnector )
+    ActionStatus deleteProxyConnector( ProxyConnector proxyConnector )
         throws ArchivaRestServiceException;
 
     /**
@@ -81,7 +82,7 @@ public interface ProxyConnectorService
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean removeProxyConnector( @QueryParam( "sourceRepoId" ) String sourceRepoId,
+    ActionStatus removeProxyConnector( @QueryParam( "sourceRepoId" ) String sourceRepoId,
                                   @QueryParam( "targetRepoId" ) String targetRepoId )
         throws ArchivaRestServiceException;
 
@@ -96,7 +97,7 @@ public interface ProxyConnectorService
     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean updateProxyConnector( ProxyConnector proxyConnector )
+    ActionStatus updateProxyConnector( ProxyConnector proxyConnector )
         throws ArchivaRestServiceException;
 
     @Path( "allPolicies" )
index 67f44ee0969b828913d849f58d83544bd50f8a38..bbd656a9354eba262346debd0d1f534b37653888 100644 (file)
@@ -22,6 +22,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.LdapConfiguration;
 import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.RBACManagerImplementationInformation;
 import org.apache.archiva.rest.api.model.RedbackImplementationsInformations;
 import org.apache.archiva.rest.api.model.UserManagerImplementationInformation;
@@ -56,7 +57,7 @@ public interface RedbackRuntimeConfigurationService
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
-    Boolean updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
+    ActionStatus updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
         throws ArchivaRestServiceException;
 
     @Path("userManagerImplementationInformations")
@@ -85,7 +86,7 @@ public interface RedbackRuntimeConfigurationService
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean checkLdapConnection()
+    ActionStatus checkLdapConnection()
         throws ArchivaRestServiceException;
 
     @Path("checkLdapConnection")
@@ -93,6 +94,6 @@ public interface RedbackRuntimeConfigurationService
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
-    Boolean checkLdapConnection( LdapConfiguration ldapConfiguration )
+    ActionStatus checkLdapConnection( LdapConfiguration ldapConfiguration )
         throws ArchivaRestServiceException;
 }
index 632c8ff5171add24849c29b5d560efcc1f14319c..69e5f85ad196fe52921018a9979687acf8099d7a 100644 (file)
@@ -23,6 +23,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.tags.Tags;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
 import javax.ws.rs.Consumes;
@@ -63,7 +64,7 @@ public interface RemoteRepositoriesService
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
-    Boolean deleteRemoteRepository( @PathParam("repositoryId") String repositoryId )
+    ActionStatus deleteRemoteRepository( @PathParam("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
 
 
@@ -72,7 +73,7 @@ public interface RemoteRepositoriesService
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
-    Boolean addRemoteRepository( RemoteRepository remoteRepository )
+    ActionStatus addRemoteRepository( RemoteRepository remoteRepository )
         throws ArchivaRestServiceException;
 
 
@@ -81,13 +82,13 @@ public interface RemoteRepositoriesService
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
-    Boolean updateRemoteRepository( RemoteRepository remoteRepository )
+    ActionStatus updateRemoteRepository( RemoteRepository remoteRepository )
         throws ArchivaRestServiceException;
 
     @Path("checkRemoteConnectivity/{repositoryId}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
-    Boolean checkRemoteConnectivity( @PathParam( "repositoryId" ) String repositoryId )
+    ActionStatus checkRemoteConnectivity( @PathParam( "repositoryId" ) String repositoryId )
         throws ArchivaRestServiceException;
 }
index 75e46701045a9b888116a760c2d65f27e1ea6af4..156827547db69d43d44fc807f6099302e073e1f6 100644 (file)
@@ -23,7 +23,10 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
+import org.apache.archiva.rest.api.model.PermissionStatus;
+import org.apache.archiva.rest.api.model.ScanStatus;
 import org.apache.archiva.rest.api.model.StringList;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
@@ -53,8 +56,8 @@ public interface RepositoriesService
     @GET
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
-    Boolean scanRepository( @QueryParam ("repositoryId") String repositoryId,
-                            @QueryParam ("fullScan") boolean fullScan )
+    ActionStatus scanRepository( @QueryParam ("repositoryId") String repositoryId,
+                                 @QueryParam ("fullScan") boolean fullScan )
         throws ArchivaRestServiceException;
 
 
@@ -70,25 +73,32 @@ public interface RepositoriesService
         throws ArchivaRestServiceException;
 
 
+    /**
+     * Returns the scan status of the given repository
+     * @param repositoryId the repository identifier
+     * @return the status
+     * @throws ArchivaRestServiceException
+     * @since 3.0
+     */
     @Path ("alreadyScanning/{repositoryId}")
     @GET
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
-    Boolean alreadyScanning( @PathParam ("repositoryId") String repositoryId )
+    ScanStatus getScanStatus( @PathParam ("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
 
     @Path ("removeScanningTaskFromQueue/{repositoryId}")
     @GET
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
-    Boolean removeScanningTaskFromQueue( @PathParam ("repositoryId") String repositoryId )
+    ActionStatus removeScanningTaskFromQueue( @PathParam ("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
 
     @Path ("scanRepositoryNow")
     @GET
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
-    Boolean scanRepositoryNow( @QueryParam ("repositoryId") String repositoryId,
+    ActionStatus scanRepositoryNow( @QueryParam ("repositoryId") String repositoryId,
                                @QueryParam ("fullScan") boolean fullScan )
         throws ArchivaRestServiceException;
 
@@ -101,14 +111,14 @@ public interface RepositoriesService
     @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (noPermission = true)
-    Boolean copyArtifact( ArtifactTransferRequest artifactTransferRequest )
+    ActionStatus copyArtifact( ArtifactTransferRequest artifactTransferRequest )
         throws ArchivaRestServiceException;
 
     @Path ("scheduleDownloadRemoteIndex")
     @GET
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
-    Boolean scheduleDownloadRemoteIndex( @QueryParam ("repositoryId") String repositoryId,
+    ActionStatus scheduleDownloadRemoteIndex( @QueryParam ("repositoryId") String repositoryId,
                                          @QueryParam ("now") boolean now,
                                          @QueryParam ("fullDownload") boolean fullDownload )
         throws ArchivaRestServiceException;
@@ -123,7 +133,7 @@ public interface RepositoriesService
     @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (noPermission = true)
-    Boolean deleteArtifact( Artifact artifact )
+    ActionStatus deleteArtifact( Artifact artifact )
         throws ArchivaRestServiceException;
 
     /**
@@ -134,16 +144,23 @@ public interface RepositoriesService
     @DELETE
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (noPermission = true)
-    Boolean removeProjectVersion( @PathParam ( "repositoryId" ) String repositoryId,
+    ActionStatus removeProjectVersion( @PathParam ( "repositoryId" ) String repositoryId,
                                   @PathParam ( "namespace" ) String namespace, @PathParam ( "projectId" ) String projectId,
                                   @PathParam ( "version" ) String version )
         throws ArchivaRestServiceException;
 
+    /**
+     * Returns the permission status for the current user and the given repository.
+     * @param repoId the repository identifier
+     * @return the status
+     * @throws ArchivaRestServiceException
+     * @since 3.0
+     */
     @Path ("isAuthorizedToDeleteArtifacts/{repositoryId}")
     @GET
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (noPermission = true, noRestriction = true)
-    Boolean isAuthorizedToDeleteArtifacts( @PathParam ("repositoryId") String repoId )
+    PermissionStatus getPermissionStatus( @PathParam ("repositoryId") String repoId )
         throws ArchivaRestServiceException;
 
     /**
@@ -154,7 +171,7 @@ public interface RepositoriesService
     @GET
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (noPermission = true)
-    Boolean deleteGroupId( @QueryParam ("groupId") String groupId, @QueryParam ("repositoryId") String repositoryId )
+    ActionStatus deleteGroupId( @QueryParam ("groupId") String groupId, @QueryParam ("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
 
     /**
@@ -165,7 +182,7 @@ public interface RepositoriesService
     @DELETE
     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
     @RedbackAuthorization (noPermission = true)
-    Boolean deleteProject( @PathParam ("groupId") String groupId, @PathParam ("projectId") String projectId,
+    ActionStatus deleteProject( @PathParam ("groupId") String groupId, @PathParam ("projectId") String projectId,
                            @PathParam ("repositoryId") String repositoryId )
         throws ArchivaRestServiceException;
 
index 2daedc1956ef1efb347dfdf37e434c7bb8b6d46b..0208f8eb199ec08771c080f115441a12430e59c8 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.rest.api.services;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.admin.model.beans.RepositoryGroup;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 
 import javax.ws.rs.Consumes;
@@ -60,7 +61,7 @@ public interface RepositoryGroupService
     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean addRepositoryGroup( RepositoryGroup repositoryGroup )
+    ActionStatus addRepositoryGroup( RepositoryGroup repositoryGroup )
         throws ArchivaRestServiceException;
 
     @Path( "updateRepositoryGroup" )
@@ -68,21 +69,21 @@ public interface RepositoryGroupService
     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean updateRepositoryGroup( RepositoryGroup repositoryGroup )
+    ActionStatus updateRepositoryGroup( RepositoryGroup repositoryGroup )
         throws ArchivaRestServiceException;
 
     @Path( "deleteRepositoryGroup/{repositoryGroupId}" )
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean deleteRepositoryGroup( @PathParam( "repositoryGroupId" ) String repositoryGroupId )
+    ActionStatus deleteRepositoryGroup( @PathParam( "repositoryGroupId" ) String repositoryGroupId )
         throws ArchivaRestServiceException;
 
     @Path( "addRepositoryToGroup" )
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean addRepositoryToGroup( @QueryParam( "repositoryGroupId" ) String repositoryGroupId,
+    ActionStatus addRepositoryToGroup( @QueryParam( "repositoryGroupId" ) String repositoryGroupId,
                                   @QueryParam( "repositoryId" ) String repositoryId )
         throws ArchivaRestServiceException;
 
@@ -90,7 +91,7 @@ public interface RepositoryGroupService
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean deleteRepositoryFromGroup( @QueryParam( "repositoryGroupId" ) String repositoryGroupId,
+    ActionStatus deleteRepositoryFromGroup( @QueryParam( "repositoryGroupId" ) String repositoryGroupId,
                                        @QueryParam( "repositoryId" ) String repositoryId )
         throws ArchivaRestServiceException;
 
index 96fe1d8667d181509666937ca2bd988875cfa309..c6b43328cacef90b644b0d4d1dcddc4a51f3fff4 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.archiva.rest.api.services;
 
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.CacheEntry;
 import org.apache.archiva.rest.api.model.QueueEntry;
 import org.apache.archiva.rest.api.model.RepositoryScannerStatistics;
@@ -72,14 +73,14 @@ public interface SystemStatusService
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean clearCache( @PathParam( "key" ) String cacheKey )
+    ActionStatus clearCache( @PathParam( "key" ) String cacheKey )
         throws ArchivaRestServiceException;
 
     @Path( "clearAllCaches" )
     @GET
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
-    Boolean clearAllCaches()
+    ActionStatus clearAllCaches()
         throws ArchivaRestServiceException;
 
 
index a5c914b835197dff2937f367965923511525b7d3..d8fed9482d6067c4f90f0391891c7d97b7869893 100644 (file)
     <dependency>
       <groupId>com.fasterxml.jackson.jaxrs</groupId>
       <artifactId>jackson-jaxrs-json-provider</artifactId>
+      <version>2.10.4</version>
     </dependency>
     <dependency>
       <groupId>com.fasterxml.jackson.jaxrs</groupId>
       <artifactId>jackson-jaxrs-xml-provider</artifactId>
-      <scope>runtime</scope>
+      <version>2.10.4</version>
     </dependency>
     <dependency>
       <groupId>org.apache.cxf</groupId>
       <groupId>org.apache.cxf</groupId>
       <artifactId>cxf-rt-transports-http</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>org.apache.cxf</groupId>
       <artifactId>cxf-rt-rs-client</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-features-logging</artifactId>
+    </dependency>
 
     <!-- TEST Scope -->
     <dependency>
               <exclude>src/test/repo-with-osgi-stage/**</exclude>
               <exclude>src/test/repo-with-classifier-only/**</exclude>
               <exclude>src/test/repo-with-snapshots/**</exclude>
+              <exclude>src/main/resources/META-INF/cxf/org.apache.cxf.Logger</exclude>
             </excludes>
           </configuration>
         </plugin>
index 18d14807f6b2409399a2d02fb6ca2fa094bf313b..dabab53ea8ac2a062574989cbae59eeb4e437bb0 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.admin.ArchivaAdministration;
 import org.apache.archiva.admin.model.beans.*;
 import org.apache.archiva.repository.scanner.RepositoryContentConsumers;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
 import org.apache.archiva.rest.api.services.ArchivaAdministrationService;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
@@ -68,13 +69,13 @@ public class DefaultArchivaAdministrationService
 
 
     @Override
-    public Boolean deleteLegacyArtifactPath( String path )
+    public ActionStatus deleteLegacyArtifactPath( String path )
         throws ArchivaRestServiceException
     {
         try
         {
             archivaAdministration.deleteLegacyArtifactPath( path, getAuditInformation() );
-            return Boolean.TRUE;
+            return new ActionStatus( true );
         }
         catch ( RepositoryAdminException e )
         {
@@ -84,13 +85,13 @@ public class DefaultArchivaAdministrationService
 
 
     @Override
-    public Boolean addFileTypePattern( String fileTypeId, String pattern )
+    public ActionStatus addFileTypePattern( String fileTypeId, String pattern )
         throws ArchivaRestServiceException
     {
         try
         {
             archivaAdministration.addFileTypePattern( fileTypeId, pattern, getAuditInformation() );
-            return Boolean.TRUE;
+            return new ActionStatus(true);
         }
         catch ( RepositoryAdminException e )
         {
@@ -99,13 +100,13 @@ public class DefaultArchivaAdministrationService
     }
 
     @Override
-    public Boolean removeFileTypePattern( String fileTypeId, String pattern )
+    public ActionStatus removeFileTypePattern( String fileTypeId, String pattern )
         throws ArchivaRestServiceException
     {
         try
         {
             archivaAdministration.removeFileTypePattern( fileTypeId, pattern, getAuditInformation() );
-            return Boolean.TRUE;
+            return new ActionStatus(true);
         }
         catch ( RepositoryAdminException e )
         {
@@ -142,13 +143,13 @@ public class DefaultArchivaAdministrationService
     }
 
     @Override
-    public Boolean removeFileType( String fileTypeId )
+    public ActionStatus removeFileType( String fileTypeId )
         throws ArchivaRestServiceException
     {
         try
         {
             archivaAdministration.removeFileType( fileTypeId, getAuditInformation() );
-            return Boolean.TRUE;
+            return new ActionStatus(true);
         }
         catch ( RepositoryAdminException e )
         {
@@ -157,13 +158,13 @@ public class DefaultArchivaAdministrationService
     }
 
     @Override
-    public Boolean enabledKnownContentConsumer( String knownContentConsumer )
+    public ActionStatus enabledKnownContentConsumer( String knownContentConsumer )
         throws ArchivaRestServiceException
     {
         try
         {
             archivaAdministration.addKnownContentConsumer( knownContentConsumer, getAuditInformation() );
-            return Boolean.TRUE;
+            return new ActionStatus(true);
         }
         catch ( RepositoryAdminException e )
         {
@@ -186,13 +187,13 @@ public class DefaultArchivaAdministrationService
     }
 
     @Override
-    public Boolean disabledKnownContentConsumer( String knownContentConsumer )
+    public ActionStatus disabledKnownContentConsumer( String knownContentConsumer )
         throws ArchivaRestServiceException
     {
         try
         {
             archivaAdministration.removeKnownContentConsumer( knownContentConsumer, getAuditInformation() );
-            return Boolean.TRUE;
+            return new ActionStatus(true);
         }
         catch ( RepositoryAdminException e )
         {
@@ -201,13 +202,13 @@ public class DefaultArchivaAdministrationService
     }
 
     @Override
-    public Boolean enabledInvalidContentConsumer( String invalidContentConsumer )
+    public ActionStatus enabledInvalidContentConsumer( String invalidContentConsumer )
         throws ArchivaRestServiceException
     {
         try
         {
             archivaAdministration.addInvalidContentConsumer( invalidContentConsumer, getAuditInformation() );
-            return Boolean.TRUE;
+            return new ActionStatus(true);
         }
         catch ( RepositoryAdminException e )
         {
@@ -230,13 +231,13 @@ public class DefaultArchivaAdministrationService
     }
 
     @Override
-    public Boolean disabledInvalidContentConsumer( String invalidContentConsumer )
+    public ActionStatus disabledInvalidContentConsumer( String invalidContentConsumer )
         throws ArchivaRestServiceException
     {
         try
         {
             archivaAdministration.removeInvalidContentConsumer( invalidContentConsumer, getAuditInformation() );
-            return Boolean.TRUE;
+            return new ActionStatus(true);
         }
         catch ( RepositoryAdminException e )
         {
@@ -319,12 +320,6 @@ public class DefaultArchivaAdministrationService
         }
     }
 
-    @Override
-    public Boolean registrationDisabled()
-        throws ArchivaRestServiceException
-    {
-        return getUiConfiguration().isDisableRegistration();
-    }
 
     @Override
     public UiConfiguration getUiConfiguration()
index a799462edb493e931c79dd74b11232ccb37175ca..6d012ad72f888f1d1375b4c4dd51b6bc3e699288 100644 (file)
@@ -25,6 +25,7 @@ import org.apache.archiva.admin.model.beans.FileLockConfiguration;
 import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.components.cache.Cache;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.ArchivaRuntimeConfigurationService;
 import org.springframework.stereotype.Service;
@@ -67,7 +68,7 @@ public class DefaultArchivaRuntimeConfigurationService
     }
 
     @Override
-    public Boolean updateArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
+    public ActionStatus updateArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
         throws ArchivaRestServiceException
     {
         try
@@ -95,6 +96,6 @@ public class DefaultArchivaRuntimeConfigurationService
         {
             throw new ArchivaRestServiceException( e.getMessage(), e );
         }
-        return Boolean.TRUE;
+        return ActionStatus.SUCCESS;
     }
 }
index 76fd075c010e28fe61a2975d6959f20cb645262a..912b24ba4468f22654b0592f89ff6388c46e2b3b 100644 (file)
@@ -613,8 +613,8 @@ public class DefaultBrowseService
     }
 
     @Override
-    public Boolean addMetadata( String groupId, String artifactId, String version, String key, String value,
-                                String repositoryId )
+    public ActionStatus addMetadata( String groupId, String artifactId, String version, String key, String value,
+                                     String repositoryId )
         throws ArchivaRestServiceException
     {
         ProjectVersionMetadata projectVersionMetadata =
@@ -622,7 +622,7 @@ public class DefaultBrowseService
 
         if ( projectVersionMetadata == null )
         {
-            return Boolean.FALSE;
+            return new ActionStatus( false );
         }
 
         Map<String, String> properties = new HashMap<>();
@@ -672,11 +672,11 @@ public class DefaultBrowseService
         {
             repositorySession.close();
         }
-        return Boolean.TRUE;
+        return new ActionStatus( true );
     }
 
     @Override
-    public Boolean deleteMetadata( String groupId, String artifactId, String version, String key, String repositoryId )
+    public ActionStatus deleteMetadata( String groupId, String artifactId, String version, String key, String repositoryId )
         throws ArchivaRestServiceException
     {
         ProjectVersionMetadata projectVersionMetadata =
@@ -684,7 +684,7 @@ public class DefaultBrowseService
 
         if ( projectVersionMetadata == null )
         {
-            return Boolean.FALSE;
+            return new ActionStatus( false );
         }
 
         GenericMetadataFacet metadataFacet =
@@ -698,7 +698,7 @@ public class DefaultBrowseService
         }
         else
         {
-            return Boolean.TRUE;
+            return new ActionStatus( true );
         }
 
         RepositorySession repositorySession = null;
@@ -729,7 +729,7 @@ public class DefaultBrowseService
         {
             repositorySession.close();
         }
-        return Boolean.TRUE;
+        return new ActionStatus( true );
     }
 
     @Override
@@ -883,8 +883,8 @@ public class DefaultBrowseService
     }
 
     @Override
-    public Boolean artifactAvailable( String groupId, String artifactId, String version, String classifier,
-                                      String repositoryId )
+    public AvailabilityStatus artifactAvailable( String groupId, String artifactId, String version, String classifier,
+                                                 String repositoryId )
         throws ArchivaRestServiceException
     {
         List<String> selectedRepos = getSelectedRepos( repositoryId );
@@ -920,7 +920,7 @@ public class DefaultBrowseService
 
                 if ( file != null && file.exists() )
                 {
-                    return true;
+                    return new AvailabilityStatus( true );
                 }
 
                 // in case of SNAPSHOT we can have timestamped version locally !
@@ -946,7 +946,7 @@ public class DefaultBrowseService
                         log.debug( "try to find timestamped snapshot version file: {}", timeStampFile.getPath() );
                         if ( timeStampFile.exists() )
                         {
-                            return true;
+                            return new AvailabilityStatus( true );
                         }
                     }
                 }
@@ -960,7 +960,7 @@ public class DefaultBrowseService
                     // download pom now
                     String pomPath = StringUtils.substringBeforeLast( path, ".jar" ) + ".pom";
                     proxyHandler.fetchFromProxies( managedRepositoryContent.getRepository(), pomPath );
-                    return true;
+                    return new AvailabilityStatus( true );
                 }
             }
         } catch ( RepositoryException e )
@@ -970,11 +970,11 @@ public class DefaultBrowseService
                                                    Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e );
         }
 
-        return false;
+        return new AvailabilityStatus( false );
     }
 
     @Override
-    public Boolean artifactAvailable( String groupId, String artifactId, String version, String repositoryId )
+    public AvailabilityStatus artifactAvailable( String groupId, String artifactId, String version, String repositoryId )
         throws ArchivaRestServiceException
     {
         return artifactAvailable( groupId, artifactId, version, null, repositoryId );
@@ -1093,16 +1093,16 @@ public class DefaultBrowseService
     }
 
     @Override
-    public Boolean importMetadata( MetadataAddRequest metadataAddRequest, String repositoryId )
+    public ActionStatus importMetadata( MetadataAddRequest metadataAddRequest, String repositoryId )
         throws ArchivaRestServiceException
     {
-        boolean result = true;
+        ActionStatus result = new ActionStatus( true );
         for ( Map.Entry<String, String> metadata : metadataAddRequest.getMetadatas().entrySet() )
         {
             result = addMetadata( metadataAddRequest.getGroupId(), metadataAddRequest.getArtifactId(),
                                   metadataAddRequest.getVersion(), metadata.getKey(), metadata.getValue(),
                                   repositoryId );
-            if ( !result )
+            if ( !result.isSuccess() )
             {
                 break;
             }
index 2005a445097d9cc7a6ed8556050b6866ac560969..25ee182f7dd6a2ea65c9e072e9debc47c725213a 100644 (file)
@@ -21,6 +21,8 @@ package org.apache.archiva.rest.services;
 import org.apache.archiva.components.scheduler.CronExpressionValidator;
 import org.apache.archiva.redback.rest.api.services.RedbackServiceException;
 import org.apache.archiva.redback.rest.api.services.UtilServices;
+import org.apache.archiva.rest.api.model.ActionStatus;
+import org.apache.archiva.rest.api.model.ValidationStatus;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.CommonServices;
 import org.apache.commons.lang3.StringUtils;
@@ -30,6 +32,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
+import javax.validation.Valid;
 import javax.ws.rs.core.Response;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -187,9 +190,9 @@ public class DefaultCommonServices
 
 
     @Override
-    public Boolean validateCronExpression( String cronExpression )
+    public ValidationStatus validateCronExpression( String cronExpression )
         throws ArchivaRestServiceException
     {
-        return cronExpressionValidator.validate( cronExpression );
+        return new ValidationStatus(cronExpressionValidator.validate( cronExpression ));
     }
 }
index ca55135450e78d553d6eb532ecb7102acd5ef879..6aec318dae204bf68ada9e0fc3b8dbdbfc0d692b 100644 (file)
@@ -27,7 +27,9 @@ import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.metadata.repository.stats.model.RepositoryStatistics;
 import org.apache.archiva.metadata.repository.stats.model.RepositoryStatisticsManager;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.ArchivaRepositoryStatistics;
+import org.apache.archiva.rest.api.model.FileStatus;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.ManagedRepositoriesService;
 import org.apache.commons.lang3.StringEscapeUtils;
@@ -95,13 +97,13 @@ public class DefaultManagedRepositoriesService
 
 
     @Override
-    public Boolean deleteManagedRepository( String repoId, boolean deleteContent )
+    public ActionStatus deleteManagedRepository( String repoId, boolean deleteContent )
         throws ArchivaRestServiceException
     {
 
         try
         {
-            return managedRepositoryAdmin.deleteManagedRepository( repoId, getAuditInformation(), deleteContent );
+            return new ActionStatus( managedRepositoryAdmin.deleteManagedRepository( repoId, getAuditInformation( ), deleteContent ) );
         }
         catch ( RepositoryAdminException e )
         {
@@ -134,16 +136,16 @@ public class DefaultManagedRepositoriesService
 
 
     @Override
-    public Boolean updateManagedRepository( ManagedRepository managedRepository )
+    public ActionStatus updateManagedRepository( ManagedRepository managedRepository )
         throws ArchivaRestServiceException
     {
 
         try
         {
-            return managedRepositoryAdmin.updateManagedRepository( managedRepository,
-                                                                   managedRepository.isStageRepoNeeded(),
-                                                                   getAuditInformation(),
-                                                                   managedRepository.isResetStats() );
+            return new ActionStatus( managedRepositoryAdmin.updateManagedRepository( managedRepository,
+                managedRepository.isStageRepoNeeded( ),
+                getAuditInformation( ),
+                managedRepository.isResetStats( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
@@ -152,11 +154,11 @@ public class DefaultManagedRepositoriesService
     }
 
     @Override
-    public Boolean fileLocationExists( String fileLocation )
+    public FileStatus getFileStatus( String fileLocation )
         throws ArchivaRestServiceException
     {
         String location = repositoryCommonValidator.removeExpressions( fileLocation );
-        return Files.exists( Paths.get( location ));
+        return new FileStatus( Files.exists( Paths.get( location ) ) );
     }
 
     @Override
index 6e3c0fec8ad752bfbee63dcda9c80ad4d518faf3..4d06e39bd489e2f7516c462c79c8d3ad63301265 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.rest.services;
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.NetworkProxy;
 import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.NetworkProxyService;
 import org.springframework.stereotype.Service;
@@ -106,13 +107,13 @@ public class DefaultNetworkProxyService
     }
 
     @Override
-    public Boolean deleteNetworkProxy( String networkProxyId )
+    public ActionStatus deleteNetworkProxy( String networkProxyId )
         throws ArchivaRestServiceException
     {
         try
         {
             getNetworkProxyAdmin().deleteNetworkProxy( networkProxyId, getAuditInformation() );
-            return Boolean.TRUE;
+            return ActionStatus.SUCCESS;
         }
         catch ( RepositoryAdminException e )
         {
index b21b8235f4ce34dfdb7f344b268c874dd51eab57..1972a2009fbfd4b871dd417867009081081d55d5 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.rest.services;
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.ProxyConnectorRule;
 import org.apache.archiva.admin.model.proxyconnectorrule.ProxyConnectorRuleAdmin;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.ProxyConnectorRuleService;
 import org.apache.commons.lang3.StringUtils;
@@ -87,7 +88,7 @@ public class DefaultProxyConnectorRuleService
     }
 
     @Override
-    public Boolean addProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
+    public ActionStatus addProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
         throws ArchivaRestServiceException
     {
 
@@ -96,7 +97,7 @@ public class DefaultProxyConnectorRuleService
         try
         {
             proxyConnectorRuleAdmin.addProxyConnectorRule( proxyConnectorRule, getAuditInformation() );
-            return Boolean.TRUE;
+            return ActionStatus.SUCCESS;
         }
         catch ( RepositoryAdminException e )
         {
@@ -105,13 +106,13 @@ public class DefaultProxyConnectorRuleService
     }
 
     @Override
-    public Boolean deleteProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
+    public ActionStatus deleteProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
         throws ArchivaRestServiceException
     {
         try
         {
             proxyConnectorRuleAdmin.deleteProxyConnectorRule( proxyConnectorRule, getAuditInformation() );
-            return Boolean.TRUE;
+            return ActionStatus.SUCCESS;
         }
         catch ( RepositoryAdminException e )
         {
@@ -120,13 +121,13 @@ public class DefaultProxyConnectorRuleService
     }
 
     @Override
-    public Boolean updateProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
+    public ActionStatus updateProxyConnectorRule( ProxyConnectorRule proxyConnectorRule )
         throws ArchivaRestServiceException
     {
         try
         {
             proxyConnectorRuleAdmin.updateProxyConnectorRule( proxyConnectorRule, getAuditInformation() );
-            return Boolean.TRUE;
+            return ActionStatus.SUCCESS;
         }
         catch ( RepositoryAdminException e )
         {
index 88ebe961681443655ef3ec05185323ca0f9249a6..e8bc8e9d834e1fd0f64f040637c300e917b14352 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.ProxyConnector;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
 import org.apache.archiva.policies.Policy;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.PolicyInformation;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.ProxyConnectorService;
@@ -80,16 +81,16 @@ public class DefaultProxyConnectorService
     }
 
     @Override
-    public Boolean addProxyConnector( ProxyConnector proxyConnector )
+    public ActionStatus addProxyConnector( ProxyConnector proxyConnector )
         throws ArchivaRestServiceException
     {
         if ( proxyConnector == null )
         {
-            return Boolean.FALSE;
+            return ActionStatus.FAIL;
         }
         try
         {
-            return proxyConnectorAdmin.addProxyConnector( proxyConnector, getAuditInformation() );
+            return new ActionStatus( proxyConnectorAdmin.addProxyConnector( proxyConnector, getAuditInformation( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
@@ -98,16 +99,16 @@ public class DefaultProxyConnectorService
     }
 
     @Override
-    public Boolean deleteProxyConnector( ProxyConnector proxyConnector )
+    public ActionStatus deleteProxyConnector( ProxyConnector proxyConnector )
         throws ArchivaRestServiceException
     {
         if ( proxyConnector == null )
         {
-            return Boolean.FALSE;
+            return ActionStatus.FAIL;
         }
         try
         {
-            return proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getAuditInformation() );
+            return new ActionStatus( proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getAuditInformation( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
@@ -116,7 +117,7 @@ public class DefaultProxyConnectorService
     }
 
     @Override
-    public Boolean removeProxyConnector( String sourceRepoId, String targetRepoId )
+    public ActionStatus removeProxyConnector( String sourceRepoId, String targetRepoId )
         throws ArchivaRestServiceException
     {
         ProxyConnector proxyConnector = getProxyConnector( sourceRepoId, targetRepoId );
@@ -130,16 +131,16 @@ public class DefaultProxyConnectorService
     }
 
     @Override
-    public Boolean updateProxyConnector( ProxyConnector proxyConnector )
+    public ActionStatus updateProxyConnector( ProxyConnector proxyConnector )
         throws ArchivaRestServiceException
     {
         if ( proxyConnector == null )
         {
-            return Boolean.FALSE;
+            return ActionStatus.FAIL;
         }
         try
         {
-            return proxyConnectorAdmin.updateProxyConnector( proxyConnector, getAuditInformation() );
+            return new ActionStatus( proxyConnectorAdmin.updateProxyConnector( proxyConnector, getAuditInformation( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
index 96b544f8e6df40e3d4ea3cf74c03d2b64ac9e460..c45b1da2f564e582a4b23e46947ebef2f67dc0e7 100644 (file)
@@ -34,6 +34,7 @@ import org.apache.archiva.redback.policy.PasswordRule;
 import org.apache.archiva.redback.rbac.RBACManager;
 import org.apache.archiva.redback.role.RoleManager;
 import org.apache.archiva.redback.users.UserManager;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.RBACManagerImplementationInformation;
 import org.apache.archiva.rest.api.model.RedbackImplementationsInformations;
 import org.apache.archiva.rest.api.model.UserManagerImplementationInformation;
@@ -112,7 +113,7 @@ public class DefaultRedbackRuntimeConfigurationService
     }
 
     @Override
-    public Boolean updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
+    public ActionStatus updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
         throws ArchivaRestServiceException
     {
         try
@@ -221,9 +222,7 @@ public class DefaultRedbackRuntimeConfigurationService
             }
 
 
-
-
-            return Boolean.TRUE;
+            return ActionStatus.SUCCESS;
         }
         catch (ArchivaRestServiceException e) {
             log.error(e.getMessage(), e);
@@ -303,7 +302,7 @@ public class DefaultRedbackRuntimeConfigurationService
     }
 
     @Override
-    public Boolean checkLdapConnection()
+    public ActionStatus checkLdapConnection()
         throws ArchivaRestServiceException
     {
         LdapConnection ldapConnection = null;
@@ -325,11 +324,11 @@ public class DefaultRedbackRuntimeConfigurationService
             }
         }
 
-        return Boolean.TRUE;
+        return ActionStatus.SUCCESS;
     }
 
     @Override
-    public Boolean checkLdapConnection( LdapConfiguration ldapConfiguration )
+    public ActionStatus checkLdapConnection( LdapConfiguration ldapConfiguration )
         throws ArchivaRestServiceException
     {
         LdapConnection ldapConnection = null;
@@ -380,7 +379,7 @@ public class DefaultRedbackRuntimeConfigurationService
             }
         }
 
-        return Boolean.TRUE;
+        return ActionStatus.SUCCESS;
     }
 
     private Properties toProperties( Map<String, String> map )
index f32ddde32e8f5841c70a93d2e8c6936b1236de2e..1e9a39c270be6e2db8d82081c95ae3c23b05aee0 100644 (file)
@@ -26,6 +26,7 @@ import org.apache.archiva.proxy.ProxyRegistry;
 import org.apache.archiva.proxy.maven.WagonFactory;
 import org.apache.archiva.proxy.maven.WagonFactoryRequest;
 import org.apache.archiva.proxy.model.NetworkProxy;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.RemoteRepositoriesService;
 import org.apache.commons.lang3.StringUtils;
@@ -91,10 +92,10 @@ public class DefaultRemoteRepositoriesService
     }
 
     @Override
-    public Boolean deleteRemoteRepository(String repositoryId)
+    public ActionStatus deleteRemoteRepository( String repositoryId)
             throws ArchivaRestServiceException {
         try {
-            return remoteRepositoryAdmin.deleteRemoteRepository(repositoryId, getAuditInformation());
+            return new ActionStatus( remoteRepositoryAdmin.deleteRemoteRepository( repositoryId, getAuditInformation( ) ) );
         } catch (RepositoryAdminException e) {
             log.error(e.getMessage(), e);
             throw new ArchivaRestServiceException(e.getMessage(), e.getFieldName(), e);
@@ -102,10 +103,10 @@ public class DefaultRemoteRepositoriesService
     }
 
     @Override
-    public Boolean addRemoteRepository(RemoteRepository remoteRepository)
+    public ActionStatus addRemoteRepository(RemoteRepository remoteRepository)
             throws ArchivaRestServiceException {
         try {
-            return remoteRepositoryAdmin.addRemoteRepository(remoteRepository, getAuditInformation());
+            return new ActionStatus( remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getAuditInformation( ) ) );
         } catch (RepositoryAdminException e) {
             log.error(e.getMessage(), e);
             throw new ArchivaRestServiceException(e.getMessage(), e.getFieldName(), e);
@@ -113,10 +114,10 @@ public class DefaultRemoteRepositoriesService
     }
 
     @Override
-    public Boolean updateRemoteRepository(RemoteRepository remoteRepository)
+    public ActionStatus updateRemoteRepository(RemoteRepository remoteRepository)
             throws ArchivaRestServiceException {
         try {
-            return remoteRepositoryAdmin.updateRemoteRepository(remoteRepository, getAuditInformation());
+            return new ActionStatus( remoteRepositoryAdmin.updateRemoteRepository( remoteRepository, getAuditInformation( ) ) );
         } catch (RepositoryAdminException e) {
             log.error(e.getMessage(), e);
             throw new ArchivaRestServiceException(e.getMessage(), e.getFieldName(), e);
@@ -124,13 +125,13 @@ public class DefaultRemoteRepositoriesService
     }
 
     @Override
-    public Boolean checkRemoteConnectivity(String repositoryId)
+    public ActionStatus checkRemoteConnectivity( String repositoryId)
             throws ArchivaRestServiceException {
         try {
             RemoteRepository remoteRepository = remoteRepositoryAdmin.getRemoteRepository(repositoryId);
             if (remoteRepository == null) {
                 log.warn("Remote repository {} does not exist. Connectivity check returns false.", repositoryId);
-                return Boolean.FALSE;
+                return ActionStatus.FAIL;
             }
             NetworkProxy networkProxy = null;
             if (StringUtils.isNotBlank(remoteRepository.getRemoteDownloadNetworkProxyId())) {
@@ -175,22 +176,22 @@ public class DefaultRemoteRepositoriesService
             // MRM-1933, there are certain servers that do not allow browsing
             if (!(StringUtils.isEmpty(remoteRepository.getCheckPath()) ||
                     "/".equals(remoteRepository.getCheckPath()))) {
-                return wagon.resourceExists(remoteRepository.getCheckPath());
+                return new ActionStatus( wagon.resourceExists( remoteRepository.getCheckPath( ) ) );
             } else {
                 // we only check connectivity as remote repo can be empty
                 // MRM-1909: Wagon implementation appends a slash already
                 wagon.getFileList("");
             }
 
-            return Boolean.TRUE;
+            return ActionStatus.SUCCESS;
         } catch (TransferFailedException e) {
             log.info("TransferFailedException :{}", e.getMessage());
-            return Boolean.FALSE;
+            return ActionStatus.FAIL;
         } catch (Exception e) {
             // This service returns either true or false, Exception cannot be handled by the clients
             log.debug("Exception occured on connectivity test.", e);
             log.info("Connection exception: {}", e.getMessage());
-            return Boolean.FALSE;
+            return ActionStatus.FAIL;
         }
 
     }
index 3967d12dfc5546a196726d289925a592b4a7822c..f99b06db7915f718d7bcbf667f829c2cdc443cdf 100644 (file)
@@ -71,7 +71,10 @@ import org.apache.archiva.repository.scanner.RepositoryScannerInstance;
 import org.apache.archiva.repository.storage.RepositoryStorage;
 import org.apache.archiva.repository.storage.StorageAsset;
 import org.apache.archiva.repository.storage.fs.FsStorageUtil;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
+import org.apache.archiva.rest.api.model.PermissionStatus;
+import org.apache.archiva.rest.api.model.ScanStatus;
 import org.apache.archiva.rest.api.model.StringList;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.RepositoriesService;
@@ -156,42 +159,42 @@ public class DefaultRepositoriesService
     private List<ChecksumAlgorithm> algorithms = Arrays.asList(ChecksumAlgorithm.SHA256, ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 );
 
     @Override
-    public Boolean scanRepository( String repositoryId, boolean fullScan )
+    public ActionStatus scanRepository( String repositoryId, boolean fullScan )
     {
-        return doScanRepository( repositoryId, fullScan );
+        return new ActionStatus( doScanRepository( repositoryId, fullScan ) );
     }
 
     @Override
-    public Boolean alreadyScanning( String repositoryId )
+    public ScanStatus getScanStatus( String repositoryId )
     {
         // check queue first to make sure it doesn't get dequeued between calls
         if ( repositoryTaskScheduler.isProcessingRepositoryTask( repositoryId ) )
         {
-            return true;
+            return new ScanStatus( true );
         }
         for ( RepositoryScannerInstance scan : repoScanner.getInProgressScans() )
         {
             if ( scan.getRepository().getId().equals( repositoryId ) )
             {
-                return true;
+                return new ScanStatus( true );
             }
         }
-        return false;
+        return new ScanStatus( false );
     }
 
     @Override
-    public Boolean removeScanningTaskFromQueue( String repositoryId )
+    public ActionStatus removeScanningTaskFromQueue( String repositoryId )
     {
         RepositoryTask task = new RepositoryTask();
         task.setRepositoryId( repositoryId );
         try
         {
-            return repositoryTaskScheduler.unQueueTask( task );
+            return new ActionStatus( repositoryTaskScheduler.unQueueTask( task ) );
         }
         catch ( TaskQueueException e )
         {
             log.error( "failed to unschedule scanning of repo with id {}", repositoryId, e );
-            return false;
+            return ActionStatus.FAIL;
         }
     }
 
@@ -205,7 +208,7 @@ public class DefaultRepositoriesService
     }
 
     @Override
-    public Boolean scanRepositoryNow( String repositoryId, boolean fullScan )
+    public ActionStatus scanRepositoryNow( String repositoryId, boolean fullScan )
         throws ArchivaRestServiceException
     {
 
@@ -225,7 +228,7 @@ public class DefaultRepositoriesService
 
             scheduler.queueTask( new RepositoryTask( repositoryId, fullScan ) );
 
-            return Boolean.TRUE;
+            return ActionStatus.SUCCESS;
         }
         catch ( Exception e )
         {
@@ -235,7 +238,7 @@ public class DefaultRepositoriesService
     }
 
     @Override
-    public Boolean scheduleDownloadRemoteIndex( String repositoryId, boolean now, boolean fullDownload )
+    public ActionStatus scheduleDownloadRemoteIndex( String repositoryId, boolean now, boolean fullDownload )
         throws ArchivaRestServiceException
     {
         try
@@ -247,11 +250,11 @@ public class DefaultRepositoriesService
             log.error( e.getMessage(), e );
             throw new ArchivaRestServiceException( e.getMessage(), e );
         }
-        return Boolean.TRUE;
+        return ActionStatus.SUCCESS;
     }
 
     @Override
-    public Boolean copyArtifact( ArtifactTransferRequest artifactTransferRequest )
+    public ActionStatus copyArtifact( ArtifactTransferRequest artifactTransferRequest )
         throws ArchivaRestServiceException
     {
         // check parameters
@@ -487,7 +490,7 @@ public class DefaultRepositoriesService
             log.error( "IOException: {}", e.getMessage(), e );
             throw new ArchivaRestServiceException( e.getMessage(), e );
         }
-        return true;
+        return ActionStatus.SUCCESS;
     }
 
     private void queueRepositoryTask( String repositoryId, StorageAsset localFile )
@@ -616,7 +619,7 @@ public class DefaultRepositoriesService
     }
 
     @Override
-    public Boolean removeProjectVersion( String repositoryId, String namespace, String projectId, String version )
+    public ActionStatus removeProjectVersion( String repositoryId, String namespace, String projectId, String version )
         throws ArchivaRestServiceException
     {
         // if not a generic we can use the standard way to delete artifact
@@ -633,7 +636,7 @@ public class DefaultRepositoriesService
             throw new ArchivaRestServiceException( "repositoryId cannot be null", 400, null );
         }
 
-        if ( !isAuthorizedToDeleteArtifacts( repositoryId ) )
+        if ( !getPermissionStatus( repositoryId ).isAuthorizedToDeleteArtifacts() )
         {
             throw new ArchivaRestServiceException( "not authorized to delete artifacts", 403, null );
         }
@@ -707,11 +710,11 @@ public class DefaultRepositoriesService
         }
 
 
-        return Boolean.TRUE;
+        return ActionStatus.SUCCESS;
     }
 
     @Override
-    public Boolean deleteArtifact( Artifact artifact )
+    public ActionStatus deleteArtifact( Artifact artifact )
         throws ArchivaRestServiceException
     {
 
@@ -727,7 +730,7 @@ public class DefaultRepositoriesService
             throw new ArchivaRestServiceException( "repositoryId cannot be null", 400, null );
         }
 
-        if ( !isAuthorizedToDeleteArtifacts( repositoryId ) )
+        if ( !getPermissionStatus( repositoryId ).isAuthorizedToDeleteArtifacts() )
         {
             throw new ArchivaRestServiceException( "not authorized to delete artifacts", 403, null );
         }
@@ -825,7 +828,7 @@ public class DefaultRepositoriesService
                     //throw new ContentNotFoundException(
                     //    artifact.getNamespace() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion() );
                     log.warn( "targetPath {} not found skip file deletion", targetPath );
-                    return false;
+                    return ActionStatus.FAIL;
                 }
 
                 // TODO: this should be in the storage mechanism so that it is all tied together
@@ -981,11 +984,11 @@ public class DefaultRepositoriesService
 
             repositorySession.close();
         }
-        return Boolean.TRUE;
+        return ActionStatus.SUCCESS;
     }
 
     @Override
-    public Boolean deleteGroupId( String groupId, String repositoryId )
+    public ActionStatus deleteGroupId( String groupId, String repositoryId )
         throws ArchivaRestServiceException
     {
         if ( StringUtils.isEmpty( repositoryId ) )
@@ -993,7 +996,7 @@ public class DefaultRepositoriesService
             throw new ArchivaRestServiceException( "repositoryId cannot be null", 400, null );
         }
 
-        if ( !isAuthorizedToDeleteArtifacts( repositoryId ) )
+        if ( !getPermissionStatus( repositoryId ).isAuthorizedToDeleteArtifacts() )
         {
             throw new ArchivaRestServiceException( "not authorized to delete artifacts", 403, null );
         }
@@ -1051,11 +1054,11 @@ public class DefaultRepositoriesService
 
             repositorySession.close();
         }
-        return true;
+        return ActionStatus.SUCCESS;
     }
 
     @Override
-    public Boolean deleteProject( String groupId, String projectId, String repositoryId )
+    public ActionStatus deleteProject( String groupId, String projectId, String repositoryId )
         throws ArchivaRestServiceException
     {
         if ( StringUtils.isEmpty( repositoryId ) )
@@ -1063,7 +1066,7 @@ public class DefaultRepositoriesService
             throw new ArchivaRestServiceException( "repositoryId cannot be null", 400, null );
         }
 
-        if ( !isAuthorizedToDeleteArtifacts( repositoryId ) )
+        if ( !getPermissionStatus( repositoryId ).isAuthorizedToDeleteArtifacts() )
         {
             throw new ArchivaRestServiceException( "not authorized to delete artifacts", 403, null );
         }
@@ -1131,12 +1134,12 @@ public class DefaultRepositoriesService
 
             repositorySession.close();
         }
-        return true;
+        return ActionStatus.SUCCESS;
 
     }
 
     @Override
-    public Boolean isAuthorizedToDeleteArtifacts( String repoId )
+    public PermissionStatus getPermissionStatus( String repoId )
         throws ArchivaRestServiceException
     {
         String userName =
@@ -1144,7 +1147,7 @@ public class DefaultRepositoriesService
 
         try
         {
-            return userRepositories.isAuthorizedToDeleteArtifacts( userName, repoId );
+            return new PermissionStatus( userRepositories.isAuthorizedToDeleteArtifacts( userName, repoId ) );
         }
         catch ( ArchivaSecurityException e )
         {
index 1f33314b1fa5e2ffd43390ddf4827f2c96bdc51c..9053f00e50f50af50464dcef6e9781ca39fac20e 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.rest.services;
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.RepositoryGroup;
 import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.archiva.rest.api.services.RepositoryGroupService;
 import org.apache.commons.lang3.StringUtils;
@@ -79,16 +80,16 @@ public class DefaultRepositoryGroupService
     }
 
     @Override
-    public Boolean addRepositoryGroup( RepositoryGroup repoGroup )
+    public ActionStatus addRepositoryGroup( RepositoryGroup repoGroup )
         throws ArchivaRestServiceException
     {
         try
         {
-            return repositoryGroupAdmin.addRepositoryGroup(
-                new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<>(
-                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl(
-                    repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ),
-                getAuditInformation() );
+            return new ActionStatus( repositoryGroupAdmin.addRepositoryGroup(
+                new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId( ), new ArrayList<>(
+                    repoGroup.getRepositories( ) ) ).mergedIndexPath( repoGroup.getMergedIndexPath( ) ).mergedIndexTtl(
+                    repoGroup.getMergedIndexTtl( ) ).cronExpression( repoGroup.getCronExpression( ) ),
+                getAuditInformation( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
@@ -97,16 +98,16 @@ public class DefaultRepositoryGroupService
     }
 
     @Override
-    public Boolean updateRepositoryGroup( RepositoryGroup repoGroup )
+    public ActionStatus updateRepositoryGroup( RepositoryGroup repoGroup )
         throws ArchivaRestServiceException
     {
         try
         {
-            return repositoryGroupAdmin.updateRepositoryGroup(
-                new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<>(
-                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl(
-                    repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ),
-                getAuditInformation() );
+            return new ActionStatus( repositoryGroupAdmin.updateRepositoryGroup(
+                new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId( ), new ArrayList<>(
+                    repoGroup.getRepositories( ) ) ).mergedIndexPath( repoGroup.getMergedIndexPath( ) ).mergedIndexTtl(
+                    repoGroup.getMergedIndexTtl( ) ).cronExpression( repoGroup.getCronExpression( ) ),
+                getAuditInformation( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
@@ -115,12 +116,12 @@ public class DefaultRepositoryGroupService
     }
 
     @Override
-    public Boolean deleteRepositoryGroup( String repositoryGroupId )
+    public ActionStatus deleteRepositoryGroup( String repositoryGroupId )
         throws ArchivaRestServiceException
     {
         try
         {
-            return repositoryGroupAdmin.deleteRepositoryGroup( repositoryGroupId, getAuditInformation() );
+            return new ActionStatus( repositoryGroupAdmin.deleteRepositoryGroup( repositoryGroupId, getAuditInformation( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
@@ -129,12 +130,12 @@ public class DefaultRepositoryGroupService
     }
 
     @Override
-    public Boolean addRepositoryToGroup( String repositoryGroupId, String repositoryId )
+    public ActionStatus addRepositoryToGroup( String repositoryGroupId, String repositoryId )
         throws ArchivaRestServiceException
     {
         try
         {
-            return repositoryGroupAdmin.addRepositoryToGroup( repositoryGroupId, repositoryId, getAuditInformation() );
+            return new ActionStatus( repositoryGroupAdmin.addRepositoryToGroup( repositoryGroupId, repositoryId, getAuditInformation( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
@@ -143,13 +144,13 @@ public class DefaultRepositoryGroupService
     }
 
     @Override
-    public Boolean deleteRepositoryFromGroup( String repositoryGroupId, String repositoryId )
+    public ActionStatus deleteRepositoryFromGroup( String repositoryGroupId, String repositoryId )
         throws ArchivaRestServiceException
     {
         try
         {
-            return repositoryGroupAdmin.deleteRepositoryFromGroup( repositoryGroupId, repositoryId,
-                                                                   getAuditInformation() );
+            return new ActionStatus( repositoryGroupAdmin.deleteRepositoryFromGroup( repositoryGroupId, repositoryId,
+                getAuditInformation( ) ) );
         }
         catch ( RepositoryAdminException e )
         {
index e62cdc99ed4b17866a5b4ffde096a72783c8a553..775664662e1008898d95f7bad8d76cb5606e06e4 100644 (file)
@@ -26,6 +26,7 @@ import org.apache.archiva.components.taskqueue.TaskQueue;
 import org.apache.archiva.components.taskqueue.TaskQueueException;
 import org.apache.archiva.repository.scanner.RepositoryScanner;
 import org.apache.archiva.repository.scanner.RepositoryScannerInstance;
+import org.apache.archiva.rest.api.model.ActionStatus;
 import org.apache.archiva.rest.api.model.CacheEntry;
 import org.apache.archiva.rest.api.model.ConsumerScanningStatistics;
 import org.apache.archiva.rest.api.model.QueueEntry;
@@ -165,7 +166,7 @@ public class DefaultSystemStatusService
     }
 
     @Override
-    public Boolean clearCache( String cacheKey )
+    public ActionStatus clearCache( String cacheKey )
         throws ArchivaRestServiceException
     {
         Cache cache = caches.get( cacheKey );
@@ -176,18 +177,18 @@ public class DefaultSystemStatusService
         }
 
         cache.clear();
-        return Boolean.TRUE;
+        return ActionStatus.SUCCESS;
     }
 
     @Override
-    public Boolean clearAllCaches()
+    public ActionStatus clearAllCaches()
         throws ArchivaRestServiceException
     {
         for ( Cache cache : caches.values() )
         {
             cache.clear();
         }
-        return Boolean.TRUE;
+        return ActionStatus.SUCCESS;
     }
 
     @Override
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/cxf/org.apache.cxf.Logger b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/cxf/org.apache.cxf.Logger
new file mode 100644 (file)
index 0000000..27dd788
--- /dev/null
@@ -0,0 +1 @@
+org.apache.cxf.common.logging.Slf4jLogger
\ No newline at end of file
index 3373b12dc52a173fb3adc8d618f71d2bac77c9ba..ede2fe6c09b05f748d26ce301605a3916be7b841 100644 (file)
       base-package="org.apache.archiva.rest.services,org.apache.archiva.redback.rest.services"/>
 
 
+  <bean id="eventSender" class="org.apache.cxf.ext.logging.slf4j.Slf4jVerboseEventSender">
+    <property name="loggingLevel" value="DEBUG" />
+  </bean>
+
+
   <jaxrs:server id="archivaServices" address="/archivaServices" >
 
     <jaxrs:providers>
       <bean class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
+      <bean class="com.fasterxml.jackson.jaxrs.xml.JacksonJaxbXMLProvider"/>
       <ref bean="authenticationInterceptor#rest"/>
       <ref bean="permissionInterceptor#rest"/>
       <ref bean="requestValidationInterceptor#rest" />
       <ref bean="redbackRuntimeConfigurationService#rest"/>
     </jaxrs:serviceBeans>
 
+    <jaxrs:features>
+      <bean class="org.apache.cxf.ext.logging.LoggingFeature">
+        <property name="sender" ref="eventSender"/>
+      </bean>
+    </jaxrs:features>
+
+
   </jaxrs:server>
 
   <bean name="browse#versionMetadata" class="org.apache.archiva.components.cache.ehcache.EhcacheCache"
index 80172e294985c6386b72f95695c00fc5be277d8c..efd48408d6d0e04059242961234202f8b064096d 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.archiva.rest.services;
 
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
+import com.fasterxml.jackson.jaxrs.xml.JacksonJaxbXMLProvider;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.redback.rest.api.services.RedbackServiceException;
 import org.apache.archiva.redback.rest.services.AbstractRestServicesTest;
@@ -50,7 +51,6 @@ import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.runner.RunWith;
-import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.core.MediaType;
 import java.io.IOException;
@@ -58,11 +58,10 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.time.LocalTime;
-import java.util.Collections;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.Locale;
 import java.util.concurrent.atomic.AtomicReference;
-import java.util.function.Function;
 
 /**
  * @author Olivier Lamy
@@ -238,7 +237,7 @@ public abstract class AbstractArchivaRestTest
     protected <T> T getService( Class<T> clazz, String authzHeader )
     {
         T service = JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", clazz,
-                                               Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                               Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
 
         if ( authzHeader != null )
         {
@@ -296,7 +295,7 @@ public abstract class AbstractArchivaRestTest
     {
         return JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                           RepositoryGroupService.class,
-                                          Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                          Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
     }
 
     protected ProxyConnectorService getProxyConnectorService()
@@ -304,7 +303,7 @@ public abstract class AbstractArchivaRestTest
         ProxyConnectorService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                        ProxyConnectorService.class,
-                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                       Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
 
         WebClient.client( service ).header( "Authorization", authorizationHeader );
         WebClient.client(service).header("Referer","http://localhost:"+getServerPort());
@@ -319,7 +318,7 @@ public abstract class AbstractArchivaRestTest
         NetworkProxyService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                        NetworkProxyService.class,
-                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                       Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
 
         WebClient.client( service ).header( "Authorization", authorizationHeader );
         WebClient.client(service).header("Referer","http://localhost:"+getServerPort());
@@ -334,7 +333,7 @@ public abstract class AbstractArchivaRestTest
         ArchivaAdministrationService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                        ArchivaAdministrationService.class,
-                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                       Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
 
         WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
         WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
@@ -351,7 +350,7 @@ public abstract class AbstractArchivaRestTest
         RedbackRuntimeConfigurationService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                        RedbackRuntimeConfigurationService.class,
-                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                       Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
 
         WebClient.client( service ).accept( MediaType.APPLICATION_JSON_TYPE );
         WebClient.client( service ).type( MediaType.APPLICATION_JSON_TYPE );
@@ -368,7 +367,7 @@ public abstract class AbstractArchivaRestTest
         BrowseService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                        BrowseService.class,
-                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                       Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
         // to add authentification
         if ( authzHeader != null )
         {
@@ -399,7 +398,7 @@ public abstract class AbstractArchivaRestTest
         SearchService service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                        SearchService.class,
-                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                       Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
         // to add authentification
         if ( authzHeader != null )
         {
@@ -422,7 +421,7 @@ public abstract class AbstractArchivaRestTest
         CommonServices service =
             JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                        CommonServices.class,
-                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );
+                                       Arrays.asList( new JacksonJaxbJsonProvider( ), new JacksonJaxbXMLProvider( ) )  );
 
         if ( authzHeader != null )
         {
@@ -664,7 +663,7 @@ public abstract class AbstractArchivaRestTest
     protected void waitForScanToComplete( String repoId )
         throws ArchivaRestServiceException, InterruptedException
     {
-        while ( getRepositoriesService( authorizationHeader ).alreadyScanning( repoId ) ) {
+        while ( getRepositoriesService( authorizationHeader ).getScanStatus( repoId ).isAlreadyScanning() ) {
             // Would be better to cancel, if we had that capacity
             Thread.sleep( 100 );
         }
index 77eb008f84fdde126ca382cb7994f0903c1d63db..0c34b1d2c2d69a8843f8262787794fba9992338b 100644 (file)
@@ -22,7 +22,6 @@ import org.apache.archiva.admin.model.beans.FileType;
 import org.apache.archiva.admin.model.beans.OrganisationInformation;
 import org.apache.archiva.admin.model.beans.UiConfiguration;
 import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
-import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
 
index eac5aa98377181b995266bf42be3accb001e9b4a..ff5e86350553571b34ffb0494cd2ac9805565ebf 100644 (file)
@@ -32,7 +32,7 @@ public class CommonServicesTest
         throws Exception
     {
         CommonServices commonServices = getCommonServices( null );
-        assertTrue( commonServices.validateCronExpression( "0 0,30 * * * ?" ) );
+        assertTrue( commonServices.validateCronExpression( "0 0,30 * * * ?" ).isValid() );
     }
 
     @Test
@@ -40,6 +40,6 @@ public class CommonServicesTest
         throws Exception
     {
         CommonServices commonServices = getCommonServices( null );
-        assertFalse( commonServices.validateCronExpression( "0,30 * * * ?" ) );
+        assertFalse( commonServices.validateCronExpression( "0,30 * * * ?" ).isValid() );
     }
 }
index 51ee1cd865de15346515d7d9802833398f942e57..62fc7c04470ef3c641cc60427283c7f9409f1a67 100644 (file)
@@ -56,7 +56,7 @@ public class CopyArtifactTest
             // retrieve the service
             RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
             // copy the artifact
-            Boolean res = repositoriesService.copyArtifact( artifactTransferRequest );
+            Boolean res = repositoriesService.copyArtifact( artifactTransferRequest ).isSuccess();
             // END SNIPPET: copy-artifact
             assertTrue( res );
 
index 41296cb2b6246ea17904f0f35f5318f0332f3519..8838c461cbdbd72de91fc61b042ee73aee0dce14 100644 (file)
@@ -26,7 +26,6 @@ import org.apache.archiva.rest.api.services.RepositoriesService;
 import org.junit.Test;
 
 import java.nio.file.Path;
-import java.nio.file.Paths;
 
 
 /**
@@ -58,7 +57,7 @@ public class ManagedRepositoriesServiceTest
         RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
 
         int timeout = 20000;
-        while ( timeout > 0 && repositoriesService.alreadyScanning( repo.getId() ) )
+        while ( timeout > 0 && repositoriesService.getScanStatus( repo.getId() ).isAlreadyScanning() )
         {
             Thread.sleep( 500 );
             timeout -= 500;
@@ -85,7 +84,7 @@ public class ManagedRepositoriesServiceTest
         RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
 
         int timeout = 20000;
-        while ( timeout > 0 && repositoriesService.alreadyScanning( repo.getId() ) )
+        while ( timeout > 0 && repositoriesService.getScanStatus( repo.getId() ).isAlreadyScanning() )
         {
             Thread.sleep( 500 );
             timeout -= 500;
@@ -104,7 +103,7 @@ public class ManagedRepositoriesServiceTest
         assertEquals( "toto", repo.getName() );
 
         timeout = 20000;
-        while ( timeout > 0 && repositoriesService.alreadyScanning( repo.getId() ) )
+        while ( timeout > 0 && repositoriesService.getScanStatus( repo.getId() ).isAlreadyScanning() )
         {
             Thread.sleep( 500 );
             timeout -= 500;
@@ -122,10 +121,10 @@ public class ManagedRepositoriesServiceTest
         ManagedRepositoriesService service = getManagedRepositoriesService( authorizationHeader );
         Path target = getProjectDirectory().resolve( "target" );
 
-        assertTrue( service.fileLocationExists( target.toAbsolutePath().toString() ) );
+        assertTrue( service.getFileStatus( target.toAbsolutePath().toString() ).isExists() );
 
         // normally should not exists :-)
-        assertFalse( service.fileLocationExists( "/fooofofof/foddfdofd/dedede/kdeo" ) );
+        assertFalse( service.getFileStatus( "/fooofofof/foddfdofd/dedede/kdeo" ).isExists() );
 
     }
 
@@ -151,7 +150,7 @@ public class ManagedRepositoriesServiceTest
         repositoriesService.scanRepositoryDirectoriesNow( testRepoId );
 
         int timeout = 20000;
-        while ( timeout > 0 && repositoriesService.alreadyScanning( testRepoId ) )
+        while ( timeout > 0 && repositoriesService.getScanStatus( testRepoId ).isAlreadyScanning() )
         {
             Thread.sleep( 500 );
             timeout -= 500;
index b2471edfe8e9937e78341a05ab8f84d39d9dd4b7..ed5b731c8f94ca5eb02bd5d6a01c7967b573f5ca 100644 (file)
@@ -176,7 +176,7 @@ public class RemoteRepositoriesServiceTest
 
             service.addRemoteRepository(getRemoteRepository());
 
-            assertTrue(service.checkRemoteConnectivity("id-new"));
+            assertTrue(service.checkRemoteConnectivity("id-new").isSuccess());
         } finally {
             removeRemoteRepositories("id-new");
         }
@@ -198,7 +198,7 @@ public class RemoteRepositoriesServiceTest
 
             service.addRemoteRepository(getRemoteMavenRepository());
 
-            assertTrue(service.checkRemoteConnectivity("id-maven1"));
+            assertTrue(service.checkRemoteConnectivity("id-maven1").isSuccess());
         } finally {
             removeRemoteRepositories("id-maven1");
         }
@@ -222,7 +222,7 @@ public class RemoteRepositoriesServiceTest
 
             service.addRemoteRepository(getRemoteOracleRepository());
 
-            assertTrue(service.checkRemoteConnectivity("id-oracle"));
+            assertTrue(service.checkRemoteConnectivity("id-oracle").isSuccess());
         } finally {
             removeRemoteRepositories("id-oracle");
         }
index 7b765c2b1a1b2d05643752e69535bd382aa2da6d..fd14b026edd5d3028a824fdbf1df12ad225b0334 100644 (file)
@@ -21,7 +21,6 @@ package org.apache.archiva.rest.services;
 
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.maven2.model.Artifact;
-import org.apache.archiva.redback.rest.api.services.RedbackServiceException;
 import org.apache.archiva.redback.rest.api.services.UserService;
 import org.apache.archiva.rest.api.model.BrowseResult;
 import org.apache.archiva.rest.api.model.BrowseResultEntry;
@@ -37,7 +36,6 @@ import javax.ws.rs.ForbiddenException;
 import javax.ws.rs.core.Response;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.List;
 import java.util.Locale;
 
@@ -77,13 +75,13 @@ public class RepositoriesServiceTest
         String repoId = managedRepositoriesService.getManagedRepositories().get( 0 ).getId();
 
         int timeout = 20000;
-        while ( timeout > 0 && service.alreadyScanning( repoId ) )
+        while ( timeout > 0 && service.getScanStatus( repoId ).isAlreadyScanning() )
         {
             Thread.sleep( 500 );
             timeout -= 500;
         }
 
-        assertTrue( service.scanRepository( repoId, true ) );
+        assertTrue( service.scanRepository( repoId, true ).isSuccess() );
     }
 
     @Test( expected = ForbiddenException.class )
@@ -393,7 +391,7 @@ public class RepositoriesServiceTest
         {
             getManagedRepositoriesService( authorizationHeader ).addManagedRepository( managedRepository );
             RepositoriesService repositoriesService = getRepositoriesService( authorizationHeader );
-            assertTrue( repositoriesService.isAuthorizedToDeleteArtifacts( managedRepository.getId() ) );
+            assertTrue( repositoriesService.getPermissionStatus( managedRepository.getId() ).isAuthorizedToDeleteArtifacts() );
         }
         finally
         {
@@ -413,7 +411,7 @@ public class RepositoriesServiceTest
         {
             getManagedRepositoriesService( authorizationHeader ).addManagedRepository( managedRepository );
             RepositoriesService repositoriesService = getRepositoriesService(  );
-            assertFalse( repositoriesService.isAuthorizedToDeleteArtifacts( managedRepository.getId() ) );
+            assertFalse( repositoriesService.getPermissionStatus( managedRepository.getId() ).isAuthorizedToDeleteArtifacts() );
         }
         finally
         {
index 11a7b902272d60566115f3348690d6f762388396..8e0fce6e07ce836359475ccacbab843d9da6792c 100644 (file)
@@ -49,7 +49,8 @@
     <logger name="org.apache.archiva.rest.services" level="info"/>
     <logger name="org.springframework" level="error"/>
     <logger name="org.apache.commons.configuration" level="info"/>
-    <logger name="org.apache.archiva.metadata.repository.storage.maven2" level="error" />
+    <logger name="org.apache.archiva.metadata" level="error" />
+    <logger name="org.apache.cxf" level="debug" />
 
     <root level="info">
       <appender-ref ref="console"/>
index b13e2472207f0c50e46c58c18e36fd59a82a11a0..183839c1e1c5ff524fdacc2ce87bcb848b609dcf 100644 (file)
@@ -38,7 +38,6 @@ import java.io.IOException;
 import java.net.URI;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.Locale;
 
 /**
@@ -129,7 +128,7 @@ public class DownloadArtifactFromQueryTest
 
         // wait a bit to ensure index is finished
         int timeout = 20000;
-        while ( timeout > 0 && repositoriesService.alreadyScanning( id ) )
+        while ( timeout > 0 && repositoriesService.getScanStatus( id ).isAlreadyScanning() )
         {
             Thread.sleep( 500 );
             timeout -= 500;
index ebe5f9f49c1a3b8e8aefc8ff51840d496cf1250f..a0d5ff3d1d1d2f41c7bcfcdd813fc8bcf075223c 100644 (file)
@@ -43,10 +43,6 @@ import org.junit.runner.RunWith;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
@@ -145,7 +141,7 @@ public class DownloadMergedIndexNonDefaultPathTest
 
         // wait a bit to ensure index is finished
         int timeout = 20000;
-        while ( timeout > 0 && repositoriesService.alreadyScanning( id ) )
+        while ( timeout > 0 && repositoriesService.getScanStatus( id ).isAlreadyScanning() )
         {
             Thread.sleep( 500 );
             timeout -= 500;
index 5e27eeb141f54855414a753d3490120fda9e41a0..01b2cb6bf2c6eaedec12046dff78c64516c8ab3e 100644 (file)
@@ -43,7 +43,6 @@ import org.junit.runner.RunWith;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
@@ -136,7 +135,7 @@ public class DownloadMergedIndexTest
 
         // wait a bit to ensure index is finished
         int timeout = 20000;
-        while ( timeout > 0 && repositoriesService.alreadyScanning( id ) )
+        while ( timeout > 0 && repositoriesService.getScanStatus( id ).isAlreadyScanning() )
         {
             Thread.sleep( 500 );
             timeout -= 500;
index 435f51de58c476b9374b43b17752e10c55f86d49..084a38cea32f463fd727cd79ff636183a628c274 100644 (file)
@@ -37,7 +37,6 @@ import org.junit.Test;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.Locale;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -110,7 +109,7 @@ public class RemoteRepositoryConnectivityCheckTest
 
             service.addRemoteRepository( repo );
 
-            assertThat( service.checkRemoteConnectivity( repo.getId() ) ).isTrue();
+            assertThat( service.checkRemoteConnectivity( repo.getId() ).isSuccess() ).isTrue();
         }
         finally
         {
@@ -145,7 +144,7 @@ public class RemoteRepositoryConnectivityCheckTest
 
             service.addRemoteRepository( repo );
 
-            assertThat( service.checkRemoteConnectivity( repo.getId() ) ).isTrue();
+            assertThat( service.checkRemoteConnectivity( repo.getId() ).isSuccess() ).isTrue();
         }
         finally
         {
@@ -173,7 +172,7 @@ public class RemoteRepositoryConnectivityCheckTest
 
             service.addRemoteRepository( repo );
 
-            assertThat( service.checkRemoteConnectivity( repo.getId() ) ).isFalse();
+            assertThat( service.checkRemoteConnectivity( repo.getId() ).isSuccess() ).isFalse();
         }
         finally
         {
diff --git a/pom.xml b/pom.xml
index cd4f4cf75b14fe155178a04a73ef1240499c8822..ca0cbfdf45f153a7db24091e47a4182a0046db7e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <artifactId>cxf-rt-frontend-jaxrs</artifactId>
         <version>${cxf.version}</version>
       </dependency>
-
       <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-rs-client</artifactId>
         <version>${cxf.version}</version>
       </dependency>
-
       <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-rs-extension-providers</artifactId>
         <version>${cxf.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-rt-features-logging</artifactId>
+        <version>${cxf.version}</version>
+      </dependency>
+
       <dependency>
         <groupId>org.apache.archiva</groupId>
         <artifactId>archiva-rest-api</artifactId>