private static void checkState(ContainerState state) { if (state == ContainerState.NEW || state == ContainerState.LOCALIZING || state == ContainerState.LOCALIZED) { throw new NotFoundException("Container is not yet running. Current state is " + state); } if (state == ContainerState.LOCALIZATION_FAILED) { throw new NotFoundException("Container wasn't started. Localization failed."); } }
private static void checkState(ContainerState state) { if (state == ContainerState.NEW || state == ContainerState.LOCALIZING || state == ContainerState.SCHEDULED) { throw new NotFoundException("Container is not yet running. Current state is " + state); } if (state == ContainerState.LOCALIZATION_FAILED) { throw new NotFoundException("Container wasn't started. Localization failed."); } }
private static void checkState(ContainerState state) { if (state == ContainerState.NEW || state == ContainerState.LOCALIZING || state == ContainerState.LOCALIZED) { throw new NotFoundException("Container is not yet running. Current state is " + state); } if (state == ContainerState.LOCALIZATION_FAILED) { throw new NotFoundException("Container wasn't started. Localization failed."); } }
private static void checkState(ContainerState state) { if (state == ContainerState.NEW || state == ContainerState.LOCALIZING || state == ContainerState.LOCALIZED) { throw new NotFoundException("Container is not yet running. Current state is " + state); } if (state == ContainerState.LOCALIZATION_FAILED) { throw new NotFoundException("Container wasn't started. Localization failed."); } }
protected static ContainerId parseContainerId(String containerId) { if (containerId == null || containerId.isEmpty()) { throw new NotFoundException("containerId, " + containerId + ", is empty or null"); } ContainerId cid = ConverterUtils.toContainerId(containerId); if (cid == null) { throw new NotFoundException("containerId is null"); } return cid; }
protected static ApplicationId parseApplicationId(String appId) { if (appId == null || appId.isEmpty()) { throw new NotFoundException("appId, " + appId + ", is empty or null"); } ApplicationId aid = ConverterUtils.toApplicationId(appId); if (aid == null) { throw new NotFoundException("appId is null"); } return aid; }
protected static ApplicationId parseApplicationId(String appId) { if (appId == null || appId.isEmpty()) { throw new NotFoundException("appId, " + appId + ", is empty or null"); } ApplicationId aid = ConverterUtils.toApplicationId(appId); if (aid == null) { throw new NotFoundException("appId is null"); } return aid; }
protected static ContainerId parseContainerId(String containerId) { if (containerId == null || containerId.isEmpty()) { throw new NotFoundException("containerId, " + containerId + ", is empty or null"); } ContainerId cid = ConverterUtils.toContainerId(containerId); if (cid == null) { throw new NotFoundException("containerId is null"); } return cid; }
protected static ApplicationAttemptId parseApplicationAttemptId( String appAttemptId) { if (appAttemptId == null || appAttemptId.isEmpty()) { throw new NotFoundException("appAttemptId, " + appAttemptId + ", is empty or null"); } ApplicationAttemptId aaid = ConverterUtils.toApplicationAttemptId(appAttemptId); if (aaid == null) { throw new NotFoundException("appAttemptId is null"); } return aaid; }
protected static ApplicationAttemptId parseApplicationAttemptId( String appAttemptId) { if (appAttemptId == null || appAttemptId.isEmpty()) { throw new NotFoundException("appAttemptId, " + appAttemptId + ", is empty or null"); } ApplicationAttemptId aaid = ConverterUtils.toApplicationAttemptId(appAttemptId); if (aaid == null) { throw new NotFoundException("appAttemptId is null"); } return aaid; }
private static void rewrapAndThrowThrowable(Throwable t) { if (t instanceof AuthorizationException) { throw new ForbiddenException(t); } else if (t instanceof ApplicationNotFoundException || t instanceof ApplicationAttemptNotFoundException || t instanceof ContainerNotFoundException) { throw new NotFoundException(t); } else { throw new WebApplicationException(t); } }
private static void rewrapAndThrowThrowable(Throwable t) { if (t instanceof AuthorizationException) { throw new ForbiddenException(t); } else if (t instanceof ApplicationNotFoundException || t instanceof ApplicationAttemptNotFoundException || t instanceof ContainerNotFoundException) { throw new NotFoundException(t); } else { throw new WebApplicationException(t); } }
private static void rewrapAndThrowThrowable(Throwable t) { if (t instanceof AuthorizationException) { throw new ForbiddenException(t); } else if (t instanceof ApplicationNotFoundException || t instanceof ApplicationAttemptNotFoundException || t instanceof ContainerNotFoundException) { throw new NotFoundException(t); } else { throw new WebApplicationException(t); } }
/** * Get a named config set * @param setname name of the config set * @return the config set * @throws NotFoundException if there was no matching set */ private PublishedConfigSet getConfigSet(String setname) { PublishedConfigSet configSet = appState.getPublishedConfigSet(setname); if (configSet == null) { throw new NotFoundException("Not found: " + setname); } return configSet; }
/** * Get a named config set * @param setname name of the config set * @return the config set * @throws NotFoundException if there was no matching set */ private PublishedConfigSet getConfigSet(String setname) { PublishedConfigSet configSet = appState.getPublishedConfigSet(setname); if (configSet == null) { throw new NotFoundException("Not found: " + setname); } return configSet; }
private RMApp getRMAppForAppId(String appId) { if (appId == null || appId.isEmpty()) { throw new NotFoundException("appId, " + appId + ", is empty or null"); } ApplicationId id; try { id = ConverterUtils.toApplicationId(recordFactory, appId); } catch (NumberFormatException e) { throw new NotFoundException("appId is invalid"); } if (id == null) { throw new NotFoundException("appId is invalid"); } RMApp app = rm.getRMContext().getRMApps().get(id); if (app == null) { throw new NotFoundException("app with id: " + appId + " not found"); } return app; }
private RMApp getRMAppForAppId(String appId) { if (appId == null || appId.isEmpty()) { throw new NotFoundException("appId, " + appId + ", is empty or null"); } ApplicationId id; try { id = ConverterUtils.toApplicationId(recordFactory, appId); } catch (NumberFormatException e) { throw new NotFoundException("appId is invalid"); } if (id == null) { throw new NotFoundException("appId is invalid"); } RMApp app = rm.getRMContext().getRMApps().get(id); if (app == null) { throw new NotFoundException("app with id: " + appId + " not found"); } return app; }
public static ApplicationId parseApplicationId(RecordFactory recordFactory, String appId) { if (appId == null || appId.isEmpty()) { throw new NotFoundException("appId, " + appId + ", is empty or null"); } ApplicationId aid = null; try { aid = ApplicationId.fromString(appId); } catch (Exception e) { throw new BadRequestException(e); } if (aid == null) { throw new NotFoundException("app with id " + appId + " not found"); } return aid; }
protected static ApplicationId parseApplicationId(String appId) { if (appId == null || appId.isEmpty()) { throw new NotFoundException("appId, " + appId + ", is empty or null"); } ApplicationId aid = null; try { aid = ApplicationId.fromString(appId); } catch (Exception e) { throw new BadRequestException(e); } if (aid == null) { throw new NotFoundException("appId is null"); } return aid; }
protected static ContainerId parseContainerId(String containerId) { if (containerId == null || containerId.isEmpty()) { throw new NotFoundException("containerId, " + containerId + ", is empty or null"); } ContainerId cid = null; try { cid = ContainerId.fromString(containerId); } catch (Exception e) { throw new BadRequestException(e); } if (cid == null) { throw new NotFoundException("containerId is null"); } return cid; }