@Override public PreviewRunner getRunner(ApplicationId preview) throws NotFoundException { Injector injector = appInjectors.getIfPresent(preview); if (injector == null) { throw new NotFoundException(preview); } return injector.getInstance(PreviewRunner.class); }
@Override public PreviewRunner getRunner(ApplicationId preview) throws NotFoundException { Injector injector = appInjectors.getIfPresent(preview); if (injector == null) { throw new NotFoundException(preview); } return injector.getInstance(PreviewRunner.class); }
@Override public void ensureExists(ProgramRunId runId) throws NotFoundException { if (store.getRun(runId) == null) { throw new NotFoundException(runId); } } }
private RunRecordMeta getRunRecordMeta(ProgramRunId programRunId) throws NotFoundException { RunRecordMeta runRecord = programStore.getRun(programRunId); if (runRecord == null) { throw new NotFoundException(programRunId); } return runRecord; } }
@Override public void ensureExists(InstanceId instanceId) throws NotFoundException { if (!instanceName.equals(instanceId.getInstance())) { throw new NotFoundException(instanceId); } } }
@Override public void ensureExists(InstanceId instanceId) throws NotFoundException { if (!instanceName.equals(instanceId.getInstance())) { throw new NotFoundException(instanceId); } } }
@GET @Path("/provisioners/{provisioner-name}") public void getProvisioner(HttpRequest request, HttpResponder responder, @PathParam("provisioner-name") String provisionerName) throws NotFoundException { ProvisionerDetail provisionerDetail = provisioningService.getProvisionerDetail(provisionerName); if (provisionerDetail == null) { throw new NotFoundException(String.format("Provisioner %s not found", provisionerName)); } responder.sendJson(HttpResponseStatus.OK, GSON.toJson(provisionerDetail)); } }
@GET @Path("/provisioners/{provisioner-name}") public void getProvisioner(HttpRequest request, HttpResponder responder, @PathParam("provisioner-name") String provisionerName) throws NotFoundException { ProvisionerDetail provisionerDetail = provisioningService.getProvisionerDetail(provisionerName); if (provisionerDetail == null) { throw new NotFoundException(String.format("Provisioner %s not found", provisionerName)); } responder.sendJson(HttpResponseStatus.OK, GSON.toJson(provisionerDetail)); } }
private JobStatus findJobForRunId(JobStatus[] jobs, ProgramRunId runId) throws NotFoundException { for (JobStatus job : jobs) { if (job.getJobName().startsWith(runId.getRun())) { return job; } } throw new NotFoundException(runId); }
private JobStatus findJobForRunId(JobStatus[] jobs, ProgramRunId runId) throws NotFoundException { for (JobStatus job : jobs) { if (job.getJobName().startsWith(runId.getRun())) { return job; } } throw new NotFoundException(runId); }
private HttpResponse executePrivilegeRequest(HttpRequest request) throws FeatureDisabledException, UnauthenticatedException, IOException, NotFoundException, UnauthorizedException { HttpResponse httpResponse = doExecuteRequest(request, HttpURLConnection.HTTP_NOT_FOUND); if (HttpURLConnection.HTTP_NOT_FOUND == httpResponse.getResponseCode()) { throw new NotFoundException(httpResponse.getResponseBodyAsString()); } return httpResponse; }
/** * Gets a {@link Trigger} associated with this program name, type and schedule name */ private synchronized Trigger getTrigger(TriggerKey key, ProgramId program, String scheduleName) throws org.quartz.SchedulerException, NotFoundException { Trigger trigger = scheduler.getTrigger(key); if (trigger == null) { throw new NotFoundException(String.format("Time trigger with trigger key '%s' in schedule '%s' was not found", key.getName(), program.getParent().schedule(scheduleName).toString())); } return trigger; }
@Override public StructuredTable getTable( StructuredTableId tableId) throws StructuredTableInstantiationException, NotFoundException { StructuredTableSpecification specification = admin.getSpecification(tableId); if (specification == null) { throw new NotFoundException(tableId); } return new PostgresSqlStructuredTable(connection, new StructuredTableSchema(specification)); } }
public void deleteWorkflowLocalDatasets(ProgramRunId workflowRunId) throws IOException, UnauthenticatedException, NotFoundException, UnauthorizedException { HttpResponse response = restClient.execute(HttpMethod.DELETE, getWorkflowLocalDatasetURL(workflowRunId), config.getAccessToken(), HttpURLConnection.HTTP_NOT_FOUND); if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { throw new NotFoundException(workflowRunId); } }
@Override public void delete(final ProgramId serviceId) throws NotFoundException { Transactionals.execute(transactional, context -> { byte[] key = Bytes.toBytes(ServiceDiscoverable.getName(serviceId)); KeyValueTable kvTable = getRouteTable(context); if (kvTable.read(key) == null) { throw new NotFoundException(String.format("Route Config for Service %s was not found.", serviceId)); } kvTable.delete(key); }, NotFoundException.class); }
@Override public void delete(final ProgramId serviceId) throws NotFoundException { Transactionals.execute(transactional, context -> { byte[] key = Bytes.toBytes(ServiceDiscoverable.getName(serviceId)); KeyValueTable kvTable = getRouteTable(context); if (kvTable.read(key) == null) { throw new NotFoundException(String.format("Route Config for Service %s was not found.", serviceId)); } kvTable.delete(key); }, NotFoundException.class); }
@Override public void delete(final StreamViewId viewId) throws NotFoundException { Transactionals.execute(transactional, context -> { ViewMetadataStoreDataset mds = getViewDataset(context); MDSKey key = getKey(viewId); if (!mds.exists(key)) { throw new NotFoundException(viewId); } mds.deleteAll(key); }, NotFoundException.class); }
public void suspend(ScheduleId scheduleId) throws IOException, UnauthenticatedException, NotFoundException, UnauthorizedException { String path = String.format("apps/%s/versions/%s/schedules/%s/suspend", scheduleId.getApplication(), scheduleId.getVersion(), scheduleId.getSchedule()); URL url = config.resolveNamespacedURLV3(scheduleId.getNamespaceId(), path); HttpResponse response = restClient.execute(HttpMethod.POST, url, config.getAccessToken(), HttpURLConnection.HTTP_NOT_FOUND); if (HttpURLConnection.HTTP_NOT_FOUND == response.getResponseCode()) { throw new NotFoundException(scheduleId); } }
public void resume(ScheduleId scheduleId) throws IOException, UnauthenticatedException, NotFoundException, UnauthorizedException { String path = String.format("apps/%s/versions/%s/schedules/%s/resume", scheduleId.getApplication(), scheduleId.getVersion(), scheduleId.getSchedule()); URL url = config.resolveNamespacedURLV3(scheduleId.getNamespaceId(), path); HttpResponse response = restClient.execute(HttpMethod.POST, url, config.getAccessToken(), HttpURLConnection.HTTP_NOT_FOUND); if (HttpURLConnection.HTTP_NOT_FOUND == response.getResponseCode()) { throw new NotFoundException(scheduleId); } }
private void doUpdate(ScheduleId scheduleId, String json) throws IOException, UnauthenticatedException, NotFoundException, UnauthorizedException, AlreadyExistsException { String path = String.format("apps/%s/versions/%s/schedules/%s/update", scheduleId.getApplication(), scheduleId.getVersion(), scheduleId.getSchedule()); URL url = config.resolveNamespacedURLV3(scheduleId.getNamespaceId(), path); HttpRequest request = HttpRequest.post(url).withBody(json).build(); HttpResponse response = restClient.execute(request, config.getAccessToken(), HttpURLConnection.HTTP_NOT_FOUND); if (HttpURLConnection.HTTP_NOT_FOUND == response.getResponseCode()) { throw new NotFoundException(scheduleId); } }