*/
import org.apache.archiva.admin.repository.RepositoryAdminException;
+import org.apache.archiva.rest.api.model.FileType;
import org.apache.archiva.rest.api.model.LegacyArtifactPath;
+import org.apache.archiva.rest.api.model.RepositoryScanning;
import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
@RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
throws RepositoryAdminException;
+
+ @Path( "getRepositoryScanning" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ RepositoryScanning getRepositoryScanning()
+ throws RepositoryAdminException;
+
+ @Path( "updateRepositoryScanning" )
+ @POST
+ @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ void updateRepositoryScanning( RepositoryScanning repositoryScanning )
+ throws RepositoryAdminException;
+
+ @Path( "addFileTypePattern" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
+ throws RepositoryAdminException;
+
+ @Path( "removeFileTypePattern" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
+ @QueryParam( "pattern" ) String pattern )
+ throws RepositoryAdminException;
+
+ @Path( "getFileType" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ FileType getFileType( String fileTypeId )
+ throws RepositoryAdminException;
+
+ @Path( "addFileType" )
+ @POST
+ @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ void addFileType( FileType fileType )
+ throws RepositoryAdminException;
+
+ @Path( "removeFileType" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
+ throws RepositoryAdminException;
+
+ @Path( "addKnownContentConsumer" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ Boolean addKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
+ throws RepositoryAdminException;
+
+ @Path( "setKnownContentConsumers" )
+ @POST
+ @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ void setKnownContentConsumers( List<String> knownContentConsumers )
+ throws RepositoryAdminException;
+
+
+ @Path( "removeKnownContentConsumer" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ Boolean removeKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
+ throws RepositoryAdminException;
+
+ @Path( "addInvalidContentConsumer" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ Boolean addInvalidContentConsumer(@QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
+ throws RepositoryAdminException;
+
+ @Path( "setInvalidContentConsumers" )
+ @POST
+ @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ void setInvalidContentConsumers( List<String> invalidContentConsumers )
+ throws RepositoryAdminException;
+
+ @Path( "removeInvalidContentConsumer" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+ Boolean removeInvalidContentConsumer(@QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
+ throws RepositoryAdminException;
}
import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.repository.RepositoryAdminException;
import org.apache.archiva.admin.repository.admin.ArchivaAdministration;
+import org.apache.archiva.rest.api.model.FileType;
import org.apache.archiva.rest.api.model.LegacyArtifactPath;
+import org.apache.archiva.rest.api.model.RepositoryScanning;
import org.apache.archiva.rest.api.services.ArchivaAdministrationService;
import org.springframework.stereotype.Service;
archivaAdministration.deleteLegacyArtifactPath( path, getAuditInformation() );
return Boolean.TRUE;
}
+
+ public RepositoryScanning getRepositoryScanning()
+ throws RepositoryAdminException
+ {
+ return new BeanReplicator().replicateBean( archivaAdministration.getRepositoryScanning(),
+ RepositoryScanning.class );
+ }
+
+ public void updateRepositoryScanning( RepositoryScanning repositoryScanning )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.updateRepositoryScanning( new BeanReplicator().replicateBean( getRepositoryScanning(),
+ org.apache.archiva.admin.repository.admin.RepositoryScanning.class ),
+ getAuditInformation() );
+ }
+
+ public Boolean addFileTypePattern( String fileTypeId, String pattern )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.addFileTypePattern( fileTypeId, pattern, getAuditInformation() );
+ return Boolean.TRUE;
+ }
+
+ public Boolean removeFileTypePattern( String fileTypeId, String pattern )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.removeFileTypePattern( fileTypeId, pattern, getAuditInformation() );
+ return Boolean.TRUE;
+ }
+
+ public FileType getFileType( String fileTypeId )
+ throws RepositoryAdminException
+ {
+ org.apache.archiva.admin.repository.admin.FileType fileType = archivaAdministration.getFileType( fileTypeId );
+ if ( fileType == null )
+ {
+ return null;
+ }
+ return new BeanReplicator().replicateBean( fileType, FileType.class );
+ }
+
+ public void addFileType( FileType fileType )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.addFileType(
+ new BeanReplicator().replicateBean( fileType, org.apache.archiva.admin.repository.admin.FileType.class ),
+ getAuditInformation() );
+
+ }
+
+ public Boolean removeFileType( String fileTypeId )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.removeFileType( fileTypeId, getAuditInformation() );
+ return Boolean.TRUE;
+ }
+
+ public Boolean addKnownContentConsumer( String knownContentConsumer )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.addKnownContentConsumer( knownContentConsumer, getAuditInformation() );
+ return Boolean.TRUE;
+ }
+
+ public void setKnownContentConsumers( List<String> knownContentConsumers )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.setKnownContentConsumers( knownContentConsumers, getAuditInformation() );
+ }
+
+ public Boolean removeKnownContentConsumer( String knownContentConsumer )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.removeKnownContentConsumer( knownContentConsumer, getAuditInformation() );
+ return Boolean.TRUE;
+ }
+
+ public Boolean addInvalidContentConsumer( String invalidContentConsumer )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.addInvalidContentConsumer( invalidContentConsumer, getAuditInformation() );
+ return Boolean.TRUE;
+ }
+
+ public void setInvalidContentConsumers( List<String> invalidContentConsumers )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.setInvalidContentConsumers( invalidContentConsumers, getAuditInformation() );
+ }
+
+ public Boolean removeInvalidContentConsumer( String invalidContentConsumer )
+ throws RepositoryAdminException
+ {
+ archivaAdministration.removeInvalidContentConsumer( invalidContentConsumer, getAuditInformation() );
+ return Boolean.TRUE;
+ }
}