public static EntityNotFoundException byVersion(String id, String version) { return new EntityNotFoundException(buildMessageByVersion(id, version)); }
public static EntityNotFoundException byFilter(String parameter) { return new EntityNotFoundException(buildMessageByFilter(parameter)); }
public static EntityNotFoundException byId(String id, Throwable cause) { return new EntityNotFoundException(buildMessageByID(id), cause); }
public static EntityNotFoundException byParserSchema(String id) { return new EntityNotFoundException(buildMessageByParserSchema(id)); }
public static EntityNotFoundException byName(String name) { return new EntityNotFoundException(buildMessageByName(name)); }
public MLModel getModelInfo(Long modelId) { MLModel modelInfo = new MLModel(); modelInfo.setId(modelId); MLModel storedModelInfo = this.storageManager.get(modelInfo.getStorableKey()); if (storedModelInfo == null) { throw EntityNotFoundException.byId(modelId.toString()); } return storedModelInfo; }
public MLModel getModelInfo(String name) { List<QueryParam> queryParams = Collections.singletonList(new QueryParam(MLModel.NAME, name)); Collection<MLModel> modelInfos = this.storageManager.find(ML_MODEL_NAME_SPACE, queryParams); if (modelInfos.size() == 0) { throw EntityNotFoundException.byName(name); } return modelInfos.iterator().next(); }
return WSUtils.respondEntities(makeTagDto(tags), OK); throw EntityNotFoundException.byFilter(queryParams.toString());
public static EntityNotFoundException byParserSchema(String id, Throwable cause) { return new EntityNotFoundException(buildMessageByParserSchema(id), cause); }
public static EntityNotFoundException byName(String name) { return new EntityNotFoundException(buildMessageByName(name)); }
public MLModel removeModelInfo(Long modelId) { MLModel modelInfo = new MLModel(); modelInfo.setId(modelId); MLModel removedModelInfo = this.storageManager.remove(modelInfo.getStorableKey()); if (removedModelInfo == null) { throw EntityNotFoundException.byId(modelId.toString()); } return removedModelInfo; }
public static EntityNotFoundException byVersion(String id, String version) { return new EntityNotFoundException(buildMessageByVersion(id, version)); }
public static EntityNotFoundException byFilter(String parameter, Throwable cause) { return new EntityNotFoundException(buildMessageByFilter(parameter), cause); }
public static EntityNotFoundException byId(String id) { return new EntityNotFoundException(buildMessageByID(id)); }
public static EntityNotFoundException byParserSchema(String id) { return new EntityNotFoundException(buildMessageByParserSchema(id)); }
public static EntityNotFoundException byName(String name, Throwable cause) { return new EntityNotFoundException(buildMessageByName(name), cause); }
/** * <p> * Tags the entity with the given tag. For example, * </p> * <b>POST /api/v1/catalog/tags/:TAG_ID/entities/:NAME_SPACE/:ENTITY_ID</b> * <i>Sample success response: </i> * <pre> * { * "responseMessage": "Success", * } * </pre> * * @param tagId * @param namespace * @param entityId * @return */ @POST @Path("/tags/{id}/entities/{namespace}/{entity-id}") @Timed @UnitOfWork public Response addTagForEntity(@PathParam("id") Long tagId, @PathParam("namespace") String namespace, @PathParam("entity-id") Long entityId) { Tag tag = tagService.getTag(tagId); if(tag != null) { tagService.addTagsForStorable(new TaggedEntity(namespace, entityId), Collections.singletonList(tag)); return WSUtils.respondEntity(SUCCESS_MESSAGE_ENTITY, CREATED); } throw EntityNotFoundException.byId(tagId.toString()); }
public static EntityNotFoundException byVersion(String id, String version, Throwable cause) { return new EntityNotFoundException(buildMessageByVersion(id, version), cause); }
public static EntityNotFoundException byFilter(String parameter, Throwable cause) { return new EntityNotFoundException(buildMessageByFilter(parameter), cause); }
public static EntityNotFoundException byId(String id) { return new EntityNotFoundException(buildMessageByID(id)); }