Package org.apache.ivory.entity.v0.process

Examples of org.apache.ivory.entity.v0.process.LateProcess


     * @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


        }
    }

    private synchronized void scheduleInternal(String type, String entity) throws IvoryException {
        checkSchedulableEntity(type);
        Entity entityObj = EntityUtil.getEntity(type, entity);
        getWorkflowEngine().schedule(entityObj);
    }
View Full Code Here

                if (pendingInstances == null) continue;
                ConcurrentMap<Date, Date> interim =
                        new ConcurrentHashMap<Date, Date>(pendingInstances);
                for (Map.Entry<Date, Date> entry : interim.entrySet()) {
                    if (entry.getValue().before(now)) {
                        Entity entity = getEntity(key);
                        String cluster = getCluster(key);
                        GenericAlert.alertOnLikelySLAMiss(cluster, entity.getEntityType().name(),
                                entity.getName(), SchemaHelper.formatDateUTC(entry.getKey()));
                        LOG.debug("Removing from pending jobs: " + key + " ---> " +
                                SchemaHelper.formatDateUTC(entry.getKey()));
                        pendingInstances.remove(entry.getKey());
                    }
                }
View Full Code Here

            @Dimension("colo") @PathParam("colo") String colo) {
        checkColo(colo);
        try {
            checkSchedulableEntity(type);
            audit(request, "STREAMED_DATA", type, "SUBMIT_AND_SCHEDULE");
            Entity entity = submitInternal(request, type);
            scheduleInternal(type, entity.getName());
            return new APIResult(APIResult.Status.SUCCEEDED, entity.getName() + "(" + type + ") scheduled successfully");
        } catch (Throwable e) {
            LOG.error("Unable to submit and schedule ", e);
            throw IvoryWebException.newException(e, Response.Status.BAD_REQUEST);
        }
    }
View Full Code Here

        private void addNewPendingEntities(Set<String> keys) throws IvoryException {
            Date now = new Date();
            Date windowEndTime = new Date(now.getTime() + POLL_PERIODICITY_SECS * 1000);
            for (String key : keys) {
                Entity entity = getEntity(key);
                String cluster = getCluster(key);
                if (entity == null) {
                    LOG.warn("No entity for " + key);
                    continue;
                }
View Full Code Here

            @Dimension("entityName") @PathParam("entity") String entity, @Dimension("entityName") @PathParam("entity") String colo) {
        checkColo(colo);
        try {
            checkSchedulableEntity(type);
            audit(request, entity, type, "SUSPEND");
            Entity entityObj = EntityUtil.getEntity(type, entity);
            if (getWorkflowEngine().isActive(entityObj))
                getWorkflowEngine().suspend(entityObj);
            else
                throw new IvoryException(entity + "(" + type + ") is not scheduled");
            return new APIResult(APIResult.Status.SUCCEEDED, entity + "(" + type + ") suspended successfully");
View Full Code Here

        checkColo(colo);
        try {
            checkSchedulableEntity(type);
            audit(request, entity, type, "RESUME");
            Entity entityObj = EntityUtil.getEntity(type, entity);
            if (getWorkflowEngine().isActive(entityObj))
                getWorkflowEngine().resume(entityObj);
            else
                throw new IvoryException(entity + "(" + type + ") is not scheduled");
            return new APIResult(APIResult.Status.SUCCEEDED, entity + "(" + type + ") resumed successfully");
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

     * @param type
     * @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);
View Full Code Here

     */
    public APIResult delete(HttpServletRequest request, String type, String entity, String colo) {

        checkColo(colo);
        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)";
                }

                configStore.remove(entityType, entity);
View Full Code Here

TOP

Related Classes of org.apache.ivory.entity.v0.process.LateProcess

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.