Search in sources :

Example 21 with PathParam

use of javax.ws.rs.PathParam in project dataverse by IQSS.

the class Datasets method receiveChecksumValidationResults.

@POST
@Path("{identifier}/dataCaptureModule/checksumValidation")
public Response receiveChecksumValidationResults(@PathParam("identifier") String id, JsonObject jsonFromDcm) {
    logger.log(Level.FINE, "jsonFromDcm: {0}", jsonFromDcm);
    AuthenticatedUser authenticatedUser = null;
    try {
        authenticatedUser = findAuthenticatedUserOrDie();
    } catch (WrappedResponse ex) {
        return error(Response.Status.BAD_REQUEST, "Authentication is required.");
    }
    if (!authenticatedUser.isSuperuser()) {
        return error(Response.Status.FORBIDDEN, "Superusers only.");
    }
    String statusMessageFromDcm = jsonFromDcm.getString("status");
    try {
        Dataset dataset = findDatasetOrDie(id);
        if ("validation passed".equals(statusMessageFromDcm)) {
            String uploadFolder = jsonFromDcm.getString("uploadFolder");
            int totalSize = jsonFromDcm.getInt("totalSize");
            ImportMode importMode = ImportMode.MERGE;
            try {
                JsonObject jsonFromImportJobKickoff = execCommand(new ImportFromFileSystemCommand(createDataverseRequest(findUserOrDie()), dataset, uploadFolder, new Long(totalSize), importMode));
                long jobId = jsonFromImportJobKickoff.getInt("executionId");
                String message = jsonFromImportJobKickoff.getString("message");
                JsonObjectBuilder job = Json.createObjectBuilder();
                job.add("jobId", jobId);
                job.add("message", message);
                return ok(job);
            } catch (WrappedResponse wr) {
                String message = wr.getMessage();
                return error(Response.Status.INTERNAL_SERVER_ERROR, "Uploaded files have passed checksum validation but something went wrong while attempting to put the files into Dataverse. Message was '" + message + "'.");
            }
        } else if ("validation failed".equals(statusMessageFromDcm)) {
            Map<String, AuthenticatedUser> distinctAuthors = permissionService.getDistinctUsersWithPermissionOn(Permission.EditDataset, dataset);
            distinctAuthors.values().forEach((value) -> {
                userNotificationService.sendNotification((AuthenticatedUser) value, new Timestamp(new Date().getTime()), UserNotification.Type.CHECKSUMFAIL, dataset.getId());
            });
            List<AuthenticatedUser> superUsers = authenticationServiceBean.findSuperUsers();
            if (superUsers != null && !superUsers.isEmpty()) {
                superUsers.forEach((au) -> {
                    userNotificationService.sendNotification(au, new Timestamp(new Date().getTime()), UserNotification.Type.CHECKSUMFAIL, dataset.getId());
                });
            }
            return ok("User notified about checksum validation failure.");
        } else {
            return error(Response.Status.BAD_REQUEST, "Unexpected status cannot be processed: " + statusMessageFromDcm);
        }
    } catch (WrappedResponse ex) {
        return ex.getResponse();
    }
}
Also used : AuthenticatedUser(edu.harvard.iq.dataverse.authorization.users.AuthenticatedUser) Produces(javax.ws.rs.Produces) FormDataContentDisposition(org.glassfish.jersey.media.multipart.FormDataContentDisposition) UpdateDatasetVersionCommand(edu.harvard.iq.dataverse.engine.command.impl.UpdateDatasetVersionCommand) DataFileTagException(edu.harvard.iq.dataverse.datasetutility.DataFileTagException) User(edu.harvard.iq.dataverse.authorization.users.User) MediaType(javax.ws.rs.core.MediaType) JsonParseException(edu.harvard.iq.dataverse.util.json.JsonParseException) MoveDatasetCommand(edu.harvard.iq.dataverse.engine.command.impl.MoveDatasetCommand) Map(java.util.Map) GetPrivateUrlCommand(edu.harvard.iq.dataverse.engine.command.impl.GetPrivateUrlCommand) DatasetField(edu.harvard.iq.dataverse.DatasetField) CommandException(edu.harvard.iq.dataverse.engine.command.exception.CommandException) JsonObject(javax.json.JsonObject) MetadataBlockServiceBean(edu.harvard.iq.dataverse.MetadataBlockServiceBean) DataverseServiceBean(edu.harvard.iq.dataverse.DataverseServiceBean) WorkflowContext(edu.harvard.iq.dataverse.workflow.WorkflowContext) AbstractApiBean.error(edu.harvard.iq.dataverse.api.AbstractApiBean.error) DataFile(edu.harvard.iq.dataverse.DataFile) DatasetServiceBean(edu.harvard.iq.dataverse.DatasetServiceBean) EJBException(javax.ejb.EJBException) ImportMode(edu.harvard.iq.dataverse.batch.jobs.importer.ImportMode) FormDataParam(org.glassfish.jersey.media.multipart.FormDataParam) DatasetVersion(edu.harvard.iq.dataverse.DatasetVersion) GetSpecificPublishedDatasetVersionCommand(edu.harvard.iq.dataverse.engine.command.impl.GetSpecificPublishedDatasetVersionCommand) CreatePrivateUrlCommand(edu.harvard.iq.dataverse.engine.command.impl.CreatePrivateUrlCommand) DataCaptureModuleUtil(edu.harvard.iq.dataverse.datacapturemodule.DataCaptureModuleUtil) JsonArrayBuilder(javax.json.JsonArrayBuilder) GET(javax.ws.rs.GET) PermissionServiceBean(edu.harvard.iq.dataverse.PermissionServiceBean) EjbDataverseEngine(edu.harvard.iq.dataverse.EjbDataverseEngine) DataverseSession(edu.harvard.iq.dataverse.DataverseSession) ResourceBundle(java.util.ResourceBundle) DatasetUtil(edu.harvard.iq.dataverse.dataset.DatasetUtil) Workflow(edu.harvard.iq.dataverse.workflow.Workflow) WorkflowServiceBean(edu.harvard.iq.dataverse.workflow.WorkflowServiceBean) Json(javax.json.Json) PublishDatasetCommand(edu.harvard.iq.dataverse.engine.command.impl.PublishDatasetCommand) EJB(javax.ejb.EJB) ExportService(edu.harvard.iq.dataverse.export.ExportService) UserNotificationServiceBean(edu.harvard.iq.dataverse.UserNotificationServiceBean) AuthenticationServiceBean(edu.harvard.iq.dataverse.authorization.AuthenticationServiceBean) DeletePrivateUrlCommand(edu.harvard.iq.dataverse.engine.command.impl.DeletePrivateUrlCommand) UserNotification(edu.harvard.iq.dataverse.UserNotification) DeleteDatasetVersionCommand(edu.harvard.iq.dataverse.engine.command.impl.DeleteDatasetVersionCommand) StringReader(java.io.StringReader) UpdateDatasetTargetURLCommand(edu.harvard.iq.dataverse.engine.command.impl.UpdateDatasetTargetURLCommand) ListVersionsCommand(edu.harvard.iq.dataverse.engine.command.impl.ListVersionsCommand) Date(java.util.Date) DataFileServiceBean(edu.harvard.iq.dataverse.DataFileServiceBean) DataverseRequest(edu.harvard.iq.dataverse.engine.command.DataverseRequest) Path(javax.ws.rs.Path) RoleAssignee(edu.harvard.iq.dataverse.authorization.RoleAssignee) CreateDatasetVersionCommand(edu.harvard.iq.dataverse.engine.command.impl.CreateDatasetVersionCommand) DataCaptureModuleException(edu.harvard.iq.dataverse.datacapturemodule.DataCaptureModuleException) SettingsServiceBean(edu.harvard.iq.dataverse.settings.SettingsServiceBean) DDIExportServiceBean(edu.harvard.iq.dataverse.export.DDIExportServiceBean) QueryParam(javax.ws.rs.QueryParam) Consumes(javax.ws.rs.Consumes) Permission(edu.harvard.iq.dataverse.authorization.Permission) FormDataBodyPart(org.glassfish.jersey.media.multipart.FormDataBodyPart) ScriptRequestResponse(edu.harvard.iq.dataverse.datacapturemodule.ScriptRequestResponse) GetDatasetCommand(edu.harvard.iq.dataverse.engine.command.impl.GetDatasetCommand) DestroyDatasetCommand(edu.harvard.iq.dataverse.engine.command.impl.DestroyDatasetCommand) DELETE(javax.ws.rs.DELETE) AddReplaceFileHelper(edu.harvard.iq.dataverse.datasetutility.AddReplaceFileHelper) DeleteDatasetCommand(edu.harvard.iq.dataverse.engine.command.impl.DeleteDatasetCommand) Timestamp(java.sql.Timestamp) ListRoleAssignments(edu.harvard.iq.dataverse.engine.command.impl.ListRoleAssignments) Logger(java.util.logging.Logger) MetadataBlock(edu.harvard.iq.dataverse.MetadataBlock) DatasetThumbnail(edu.harvard.iq.dataverse.dataset.DatasetThumbnail) List(java.util.List) IngestServiceBean(edu.harvard.iq.dataverse.ingest.IngestServiceBean) Response(javax.ws.rs.core.Response) JsonPrinter(edu.harvard.iq.dataverse.util.json.JsonPrinter) ImportFromFileSystemCommand(edu.harvard.iq.dataverse.engine.command.impl.ImportFromFileSystemCommand) ReturnDatasetToAuthorCommand(edu.harvard.iq.dataverse.engine.command.impl.ReturnDatasetToAuthorCommand) SubmitDatasetForReviewCommand(edu.harvard.iq.dataverse.engine.command.impl.SubmitDatasetForReviewCommand) JsonObjectBuilder(javax.json.JsonObjectBuilder) OptionalFileParams(edu.harvard.iq.dataverse.datasetutility.OptionalFileParams) GetDraftDatasetVersionCommand(edu.harvard.iq.dataverse.engine.command.impl.GetDraftDatasetVersionCommand) DatasetLock(edu.harvard.iq.dataverse.DatasetLock) PathParam(javax.ws.rs.PathParam) SystemConfig(edu.harvard.iq.dataverse.util.SystemConfig) HashMap(java.util.HashMap) GetLatestPublishedDatasetVersionCommand(edu.harvard.iq.dataverse.engine.command.impl.GetLatestPublishedDatasetVersionCommand) EjbUtil(edu.harvard.iq.dataverse.util.EjbUtil) Level(java.util.logging.Level) Inject(javax.inject.Inject) DataverseRole(edu.harvard.iq.dataverse.authorization.DataverseRole) NoFilesException(edu.harvard.iq.dataverse.datasetutility.NoFilesException) Dataverse(edu.harvard.iq.dataverse.Dataverse) Command(edu.harvard.iq.dataverse.engine.command.Command) UpdateDatasetThumbnailCommand(edu.harvard.iq.dataverse.engine.command.impl.UpdateDatasetThumbnailCommand) POST(javax.ws.rs.POST) DatasetFieldType(edu.harvard.iq.dataverse.DatasetFieldType) Dataset(edu.harvard.iq.dataverse.Dataset) GetLatestAccessibleDatasetVersionCommand(edu.harvard.iq.dataverse.engine.command.impl.GetLatestAccessibleDatasetVersionCommand) AssignRoleCommand(edu.harvard.iq.dataverse.engine.command.impl.AssignRoleCommand) DatasetFieldServiceBean(edu.harvard.iq.dataverse.DatasetFieldServiceBean) PrivateUrl(edu.harvard.iq.dataverse.privateurl.PrivateUrl) RequestRsyncScriptCommand(edu.harvard.iq.dataverse.engine.command.impl.RequestRsyncScriptCommand) PublishDatasetResult(edu.harvard.iq.dataverse.engine.command.impl.PublishDatasetResult) SetDatasetCitationDateCommand(edu.harvard.iq.dataverse.engine.command.impl.SetDatasetCitationDateCommand) PUT(javax.ws.rs.PUT) InputStream(java.io.InputStream) ImportFromFileSystemCommand(edu.harvard.iq.dataverse.engine.command.impl.ImportFromFileSystemCommand) Dataset(edu.harvard.iq.dataverse.Dataset) JsonObject(javax.json.JsonObject) AuthenticatedUser(edu.harvard.iq.dataverse.authorization.users.AuthenticatedUser) Timestamp(java.sql.Timestamp) Date(java.util.Date) ImportMode(edu.harvard.iq.dataverse.batch.jobs.importer.ImportMode) List(java.util.List) JsonObjectBuilder(javax.json.JsonObjectBuilder) Map(java.util.Map) HashMap(java.util.HashMap) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 22 with PathParam

use of javax.ws.rs.PathParam in project plugin-prov by ligoj.

the class ImportCatalogResourceTest method updateCatalog.

@Test
public void updateCatalog() throws Exception {
    final ImportCatalogResource resource = new ImportCatalogResource() {

        @Override
        public ImportCatalogStatus getTask(@PathParam("node") final String node) {
            return getTaskRepository().findBy("locked.id", node);
        }
    };
    applicationContext.getAutowireCapableBeanFactory().autowireBean(resource);
    // Replace the locator for the custom provider
    resource.locator = Mockito.mock(ServicePluginLocator.class);
    final ImportCatalogService service = Mockito.mock(ImportCatalogService.class);
    Mockito.when(resource.locator.getResource("service:prov:test", ImportCatalogService.class)).thenReturn(service);
    final ImportCatalogStatus status = resource.updateCatalog("service:prov:test:account");
    Assertions.assertEquals(DEFAULT_USER, status.getAuthor());
    Assertions.assertNull(status.getEnd());
    Assertions.assertNull(status.getLocation());
    Assertions.assertEquals("service:prov:test", status.getLocked().getId());
    Assertions.assertNotNull(status.getStart());
    Assertions.assertNull(status.getLocation());
    Assertions.assertEquals(0, status.getDone());
    Assertions.assertEquals(0, status.getWorkload());
    Assertions.assertFalse(resource.getTask("service:prov:test").isFinished());
    Thread.sleep(100);
    Mockito.verify(service).updateCatalog("service:prov:test");
}
Also used : ImportCatalogStatus(org.ligoj.app.plugin.prov.model.ImportCatalogStatus) PathParam(javax.ws.rs.PathParam) ServicePluginLocator(org.ligoj.app.resource.ServicePluginLocator) AbstractAppTest(org.ligoj.app.AbstractAppTest) Test(org.junit.jupiter.api.Test)

Example 23 with PathParam

use of javax.ws.rs.PathParam in project plugin-prov by ligoj.

the class ProvUsageResource method delete.

/**
 * Delete an usage. When the usage is associated to a quote or a resource, it is replaced by a <code>null</code>
 * reference.
 *
 * @param subscription
 *            The subscription identifier, will be used to filter the usages from the associated provider.
 * @param name
 *            The {@link ProvUsage} name.
 * @return The updated cost. Only relevant when at least one resource was associated to this usage.
 */
@DELETE
@Consumes(MediaType.APPLICATION_JSON)
@Path("{subscription:\\d+}/usage/{name}")
public UpdatedCost delete(@PathParam("subscription") final int subscription, @PathParam("name") final String name) {
    final ProvUsage entity = resource.findConfiguredByName(repository, name, subscription);
    final ProvQuote quote = entity.getConfiguration();
    final UpdatedCost cost = new UpdatedCost();
    // Prepare the updated cost of updated instances
    final Map<Integer, FloatingCost> costs = cost.getRelatedCosts();
    cost.setRelatedCosts(costs);
    // Update the cost of all related instances
    if (entity.equals(quote.getUsage())) {
        // Update cost of all instances without explicit usage
        quote.setUsage(null);
        quote.getInstances().stream().filter(i -> i.getUsage() == null).forEach(i -> costs.put(i.getId(), instanceResource.addCost(i, instanceResource::refresh)));
    }
    quote.getInstances().stream().filter(i -> entity.equals(i.getUsage())).peek(i -> i.setUsage(null)).forEach(i -> costs.put(i.getId(), instanceResource.addCost(i, instanceResource::refresh)));
    // All references are deleted, delete the usage entity
    repository.delete(entity);
    // Save and update the costs
    cost.setTotalCost(resource.toFloatingCost(entity.getConfiguration()));
    return cost;
}
Also used : PathParam(javax.ws.rs.PathParam) POST(javax.ws.rs.POST) Context(javax.ws.rs.core.Context) Produces(javax.ws.rs.Produces) Transactional(javax.transaction.Transactional) GET(javax.ws.rs.GET) Path(javax.ws.rs.Path) ProvUsageRepository(org.ligoj.app.plugin.prov.dao.ProvUsageRepository) Autowired(org.springframework.beans.factory.annotation.Autowired) SubscriptionResource(org.ligoj.app.resource.subscription.SubscriptionResource) Function(java.util.function.Function) MediaType(javax.ws.rs.core.MediaType) Consumes(javax.ws.rs.Consumes) DataTableAttributes(org.ligoj.bootstrap.core.json.datatable.DataTableAttributes) Service(org.springframework.stereotype.Service) Map(java.util.Map) PUT(javax.ws.rs.PUT) ProvQuote(org.ligoj.app.plugin.prov.model.ProvQuote) UriInfo(javax.ws.rs.core.UriInfo) ProvUsage(org.ligoj.app.plugin.prov.model.ProvUsage) TableItem(org.ligoj.bootstrap.core.json.TableItem) PaginationJson(org.ligoj.bootstrap.core.json.PaginationJson) DELETE(javax.ws.rs.DELETE) ProvUsage(org.ligoj.app.plugin.prov.model.ProvUsage) ProvQuote(org.ligoj.app.plugin.prov.model.ProvQuote) Path(javax.ws.rs.Path) DELETE(javax.ws.rs.DELETE) Consumes(javax.ws.rs.Consumes)

Example 24 with PathParam

use of javax.ws.rs.PathParam in project vespa by vespa-engine.

the class InstanceResource method getSlobrokEntries.

@GET
@Path("/{instanceId}/slobrok")
@Produces(MediaType.APPLICATION_JSON)
public List<SlobrokEntryResponse> getSlobrokEntries(@PathParam("instanceId") String instanceId, @QueryParam("pattern") String pattern) {
    ApplicationInstanceReference reference = parseInstanceId(instanceId);
    ApplicationId applicationId = OrchestratorUtil.toApplicationId(reference);
    if (pattern == null) {
        pattern = DEFAULT_SLOBROK_PATTERN;
    }
    List<Mirror.Entry> entries = slobrokApi.lookup(applicationId, pattern);
    return entries.stream().map(entry -> new SlobrokEntryResponse(entry.getName(), entry.getSpec())).collect(Collectors.toList());
}
Also used : PathParam(javax.ws.rs.PathParam) Produces(javax.ws.rs.Produces) ApplicationId(com.yahoo.config.provision.ApplicationId) Mirror(com.yahoo.jrt.slobrok.api.Mirror) GET(javax.ws.rs.GET) Path(javax.ws.rs.Path) OrchestratorUtil.getHostsUsedByApplicationInstance(com.yahoo.vespa.orchestrator.OrchestratorUtil.getHostsUsedByApplicationInstance) ApplicationInstance(com.yahoo.vespa.applicationmodel.ApplicationInstance) ClusterId(com.yahoo.vespa.applicationmodel.ClusterId) ServiceStatus(com.yahoo.vespa.applicationmodel.ServiceStatus) Inject(javax.inject.Inject) MediaType(javax.ws.rs.core.MediaType) QueryParam(javax.ws.rs.QueryParam) HostName(com.yahoo.vespa.applicationmodel.HostName) Component(com.yahoo.container.jaxrs.annotation.Component) Map(java.util.Map) OrchestratorUtil(com.yahoo.vespa.orchestrator.OrchestratorUtil) ApplicationInstanceReference(com.yahoo.vespa.applicationmodel.ApplicationInstanceReference) OrchestratorUtil.parseAppInstanceReference(com.yahoo.vespa.orchestrator.OrchestratorUtil.parseAppInstanceReference) ConfigId(com.yahoo.vespa.applicationmodel.ConfigId) StatusService(com.yahoo.vespa.orchestrator.status.StatusService) OrchestratorUtil.getHostStatusMap(com.yahoo.vespa.orchestrator.OrchestratorUtil.getHostStatusMap) Set(java.util.Set) SlobrokEntryResponse(com.yahoo.vespa.orchestrator.restapi.wire.SlobrokEntryResponse) Collectors(java.util.stream.Collectors) SlobrokApi(com.yahoo.vespa.service.monitor.SlobrokApi) ServiceType(com.yahoo.vespa.applicationmodel.ServiceType) List(java.util.List) Response(javax.ws.rs.core.Response) WebApplicationException(javax.ws.rs.WebApplicationException) HostStatus(com.yahoo.vespa.orchestrator.status.HostStatus) InstanceLookupService(com.yahoo.vespa.orchestrator.InstanceLookupService) SlobrokEntryResponse(com.yahoo.vespa.orchestrator.restapi.wire.SlobrokEntryResponse) ApplicationInstanceReference(com.yahoo.vespa.applicationmodel.ApplicationInstanceReference) ApplicationId(com.yahoo.config.provision.ApplicationId) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 25 with PathParam

use of javax.ws.rs.PathParam in project streamline by hortonworks.

the class NamespaceCatalogResource method setServicesToClusterInNamespace.

@POST
@Path("/namespaces/{id}/mapping/bulk")
@Timed
public Response setServicesToClusterInNamespace(@PathParam("id") Long namespaceId, List<NamespaceServiceClusterMap> mappings, @Context SecurityContext securityContext) {
    SecurityUtil.checkRoleOrPermissions(authorizer, securityContext, Roles.ROLE_ENVIRONMENT_SUPER_ADMIN, Namespace.NAMESPACE, namespaceId, WRITE);
    Namespace namespace = environmentService.getNamespace(namespaceId);
    if (namespace == null) {
        throw EntityNotFoundException.byId(namespaceId.toString());
    }
    String streamingEngine = namespace.getStreamingEngine();
    String timeSeriesDB = namespace.getTimeSeriesDB();
    Collection<NamespaceServiceClusterMap> existing = environmentService.listServiceClusterMapping(namespaceId);
    Optional<NamespaceServiceClusterMap> existingStreamingEngine = existing.stream().filter(m -> m.getServiceName().equals(streamingEngine)).findFirst();
    // indicates that mapping of streaming engine has been changed or removed
    if (existingStreamingEngine.isPresent() && !mappings.contains(existingStreamingEngine.get())) {
        assertNoTopologyReferringNamespaceIsRunning(namespaceId, WSUtils.getUserFromSecurityContext(securityContext));
    }
    // we're OK to just check with new mappings since we will remove existing mappings
    assertServiceIsUnique(mappings, streamingEngine);
    assertServiceIsUnique(mappings, timeSeriesDB);
    // remove any existing mapping for (namespace, service name) pairs
    Collection<NamespaceServiceClusterMap> existingMappings = environmentService.listServiceClusterMapping(namespaceId);
    if (existingMappings != null) {
        existingMappings.forEach(m -> environmentService.removeServiceClusterMapping(m.getNamespaceId(), m.getServiceName(), m.getClusterId()));
    }
    List<NamespaceServiceClusterMap> newMappings = mappings.stream().map(environmentService::addOrUpdateServiceClusterMapping).collect(toList());
    return WSUtils.respondEntities(newMappings, CREATED);
}
Also used : Topology(com.hortonworks.streamline.streams.catalog.Topology) Roles(com.hortonworks.streamline.streams.security.Roles) Produces(javax.ws.rs.Produces) BadRequestException(com.hortonworks.streamline.common.exception.service.exception.request.BadRequestException) QueryParam(com.hortonworks.registries.common.QueryParam) LoggerFactory(org.slf4j.LoggerFactory) Path(javax.ws.rs.Path) SecurityContext(javax.ws.rs.core.SecurityContext) StringUtils(org.apache.commons.lang3.StringUtils) BooleanUtils(org.apache.commons.lang.BooleanUtils) MediaType(javax.ws.rs.core.MediaType) WSUtils(com.hortonworks.streamline.common.util.WSUtils) READ(com.hortonworks.streamline.streams.security.Permission.READ) StreamlineAuthorizer(com.hortonworks.streamline.streams.security.StreamlineAuthorizer) EnumSet(java.util.EnumSet) DELETE(javax.ws.rs.DELETE) SecurityUtil(com.hortonworks.streamline.streams.security.SecurityUtil) Namespace(com.hortonworks.streamline.streams.cluster.catalog.Namespace) Context(javax.ws.rs.core.Context) Permission(com.hortonworks.streamline.streams.security.Permission) DELETE(com.hortonworks.streamline.streams.security.Permission.DELETE) OK(javax.ws.rs.core.Response.Status.OK) AlreadyExistsException(com.hortonworks.registries.storage.exception.AlreadyExistsException) Collection(java.util.Collection) Objects(java.util.Objects) Timed(com.codahale.metrics.annotation.Timed) List(java.util.List) Response(javax.ws.rs.core.Response) ProcessingException(javax.ws.rs.ProcessingException) Optional(java.util.Optional) UriInfo(javax.ws.rs.core.UriInfo) CREATED(javax.ws.rs.core.Response.Status.CREATED) NamespaceServiceClusterMap(com.hortonworks.streamline.streams.cluster.catalog.NamespaceServiceClusterMap) PathParam(javax.ws.rs.PathParam) EntityNotFoundException(com.hortonworks.streamline.common.exception.service.exception.request.EntityNotFoundException) GET(javax.ws.rs.GET) ArrayList(java.util.ArrayList) EnvironmentService(com.hortonworks.streamline.streams.cluster.service.EnvironmentService) TopologyNotAliveException(com.hortonworks.streamline.streams.exception.TopologyNotAliveException) WRITE(com.hortonworks.streamline.streams.security.Permission.WRITE) Logger(org.slf4j.Logger) POST(javax.ws.rs.POST) TopologyActionsService(com.hortonworks.streamline.streams.actions.topology.service.TopologyActionsService) IOException(java.io.IOException) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) MultivaluedMap(javax.ws.rs.core.MultivaluedMap) Collectors.toList(java.util.stream.Collectors.toList) StreamCatalogService(com.hortonworks.streamline.streams.catalog.service.StreamCatalogService) PUT(javax.ws.rs.PUT) Collections(java.util.Collections) NamespaceServiceClusterMap(com.hortonworks.streamline.streams.cluster.catalog.NamespaceServiceClusterMap) Namespace(com.hortonworks.streamline.streams.cluster.catalog.Namespace) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Timed(com.codahale.metrics.annotation.Timed)

Aggregations

PathParam (javax.ws.rs.PathParam)127 Path (javax.ws.rs.Path)105 GET (javax.ws.rs.GET)96 Produces (javax.ws.rs.Produces)96 Response (javax.ws.rs.core.Response)93 QueryParam (javax.ws.rs.QueryParam)82 List (java.util.List)72 MediaType (javax.ws.rs.core.MediaType)72 POST (javax.ws.rs.POST)71 DELETE (javax.ws.rs.DELETE)70 Consumes (javax.ws.rs.Consumes)66 Inject (javax.inject.Inject)62 Api (io.swagger.annotations.Api)60 ApiOperation (io.swagger.annotations.ApiOperation)59 Map (java.util.Map)59 ApiResponse (io.swagger.annotations.ApiResponse)58 ApiResponses (io.swagger.annotations.ApiResponses)57 Collectors (java.util.stream.Collectors)57 Logger (org.slf4j.Logger)52 LoggerFactory (org.slf4j.LoggerFactory)52