Package org.apache.ivory.entity.v0.feed

Examples of org.apache.ivory.entity.v0.feed.Cluster


    public APIResult submit(HttpServletRequest request, String type, String colo) {

        checkColo(colo);
        try {
            audit(request, "STREAMED_DATA", type, "SUBMIT");
            Entity entity = submitInternal(request, type);
            return new APIResult(APIResult.Status.SUCCEEDED, "Submit successful (" + type + ") " + entity.getName());
        } catch (Throwable e) {
            LOG.error("Unable to persist entity object", e);
            throw IvoryWebException.newException(e, Response.Status.BAD_REQUEST);
        }
    }
View Full Code Here


     * @return APIResule -Succeeded or Failed
     */
    public APIResult validate(HttpServletRequest request, String type) {
        try {
            EntityType entityType = EntityType.valueOf(type.toUpperCase());
            Entity entity = deserializeEntity(request, entityType);
            validate(entity);
            return new APIResult(APIResult.Status.SUCCEEDED, "Validated successfully (" + entityType + ") " + entity.getName());
        } catch (Throwable e) {
            LOG.error("Validation failed for entity (" + type + ") ", e);
            throw IvoryWebException.newException(e, Response.Status.BAD_REQUEST);
        }
    }
View Full Code Here

        try {
            EntityType entityType = EntityType.valueOf(type.toUpperCase());
            audit(request, entity, type, "DELETE");
            String removedFromEngine = "";
            try {
                Entity entityObj = EntityUtil.getEntity(type, entity);

                canRemove(entityObj);
                if (entityType.isSchedulable() && !DeploymentUtil.isPrism()) {
                    getWorkflowEngine().delete(entityObj);
                    removedFromEngine = "(KILLED in ENGINE)";
View Full Code Here

    public synchronized APIResult update(HttpServletRequest request, String type, String entityName, String colo) {
        checkColo(colo);
        try {
            EntityType entityType = EntityType.valueOf(type.toUpperCase());
            audit(request, entityName, type, "UPDATE");
            Entity oldEntity = EntityUtil.getEntity(type, entityName);
            Entity newEntity = deserializeEntity(request, entityType);
            validate(newEntity);

            validateUpdate(oldEntity, newEntity);
            if (!EntityUtil.equals(oldEntity, newEntity)) {
                configStore.initiateUpdate(newEntity);
View Full Code Here

    }

    protected synchronized Entity submitInternal(HttpServletRequest request, String type) throws IOException, IvoryException {

        EntityType entityType = EntityType.valueOf(type.toUpperCase());
        Entity entity = deserializeEntity(request, entityType);

        Entity existingEntity = configStore.get(entityType, entity.getName());
        if (existingEntity != null) {
            if (EntityUtil.equals(existingEntity, entity))
                return existingEntity;

            throw new EntityAlreadyExistsException(entity.toShortString() + " already registered with configuration store. "
View Full Code Here

  }

  protected Entity storeEntity(EntityType type, String path) throws Exception {
    Unmarshaller unmarshaller = type.getUnmarshaller();
    Entity entity = (Entity) unmarshaller
        .unmarshal(OozieFeedMapperTest.class.getResource(path));
    store.publish(type, entity);
    return entity;
  }
View Full Code Here

     * @return String
     */
    public APIResult getStatus(String type, String entity, String colo) {

        checkColo(colo);
        Entity entityObj = null;
        try {
            entityObj = EntityUtil.getEntity(type, entity);
            EntityType entityType = EntityType.valueOf(type.toUpperCase());
            String status;

View Full Code Here

     * @return EntityList
     */
    public EntityList getDependencies(String type, String entity) {

        try {
            Entity entityObj = EntityUtil.getEntity(type, entity);
            Set<Entity> dependents = EntityGraph.get().getDependents(entityObj);
            Entity[] entities = dependents.toArray(new Entity[dependents.size()]);
            return new EntityList(entities == null ? new Entity[] {} : entities);
        } catch (Exception e) {
            LOG.error("Unable to get dependencies for entity " + entity + "(" + type + ")", e);
View Full Code Here

     * @return String
     */
    public String getEntityDefinition(String type, String entityName) {
        try {
            EntityType entityType = EntityType.valueOf(type.toUpperCase());
            Entity entity = configStore.get(entityType, entityName);
            if (entity == null) {
                throw new NoSuchElementException(entityName + " (" + type + ") not found");
            }
            return entity.toString();
        } catch (Throwable e) {
            LOG.error("Unable to get entity definition from config " + "store for (" + type + ") " + entityName, e);
            throw IvoryWebException.newException(e, Response.Status.BAD_REQUEST);

        }
View Full Code Here

        for (int index = 2; index < args.length; index++) {
            entity = args[index];
            String[] deps = client.getDependency(type, entity).split("\n");
            for (String line : deps) {
                String[] fields = line.replace("(", "").replace(")", "").split(" ");
                EntityType eType = EntityType.valueOf(fields[0].toUpperCase());
                if (ConfigurationStore.get().get(eType, fields[1]) != null) continue;
                String xml = client.getDefinition(eType.name().toLowerCase(), fields[1]);
                System.out.println(xml);
                store(eType, xml);
            }
            String xml = client.getDefinition(type.toLowerCase(), entity);
            System.out.println(xml);
View Full Code Here

TOP

Related Classes of org.apache.ivory.entity.v0.feed.Cluster

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.