Package org.intalio.deploy.deployment

Examples of org.intalio.deploy.deployment.DeploymentMessage


    }

    // ------------------ Common deployment methods ------------------------

    public DeploymentMessage checkPipa(String token, InputStream input, String name) {
        DeploymentMessage msg = null;
        try {
            PIPATask task = loadPIPADescriptor(input);
            if (task.isValid()) {
                /*
                 * ALEX: Disabled until we get token propagation from
                 * deploy-impl PIPATask existing =
                 * wds.getPipaTask(task.getFormURLAsString(), token); if
                 * (existing != null) { msg = new DeploymentMessage(Level.ERROR,
                 * "PIPA task already exists: "+task.getFormURLAsString());
                 * msg.setResource(name); }
                 */
            } else {
                msg = new DeploymentMessage(Level.ERROR, "Invalid PIPA task descriptor: " + name);
                msg.setResource(name);
            }
        } catch (Exception e) {
            LOG.error("Error while storing PIPA: " + name, e);
            msg = new DeploymentMessage(Level.ERROR, e.toString());
            msg.setResource(name);
        }
        return msg;
    }
View Full Code Here


        }
        return msg;
    }

    public DeploymentMessage processPipa(String token, InputStream input, String name, ArrayList<String> urls) {
        DeploymentMessage msg = null;
        try {
            PIPATask task = loadPIPADescriptor(input);
            urls.add(getFormUrl(task));
            if (task.isValid()) {
                LOG.debug("Store PIPA {}", name);
                ITaskDAOConnection dao=_taskDAOFactory.openConnection();
                try {
                    _tms.deletePipa(dao,getFormUrl(task), token);
                } catch (Exception e) {
                    // don't bother with that here
                }
                _tms.storePipa(dao,task, token);
                dao.close();
            } else {
                msg = new DeploymentMessage(Level.ERROR, "Invalid PIPA task descriptor: " + name);
                msg.setResource(name);
            }
        } catch (Exception e) {
            LOG.error("Error while storing PIPA: " + name, e);
            msg = new DeploymentMessage(Level.ERROR, e.toString());
            msg.setResource(name);
        }
        return msg;
    }
View Full Code Here

            String itemURL = relativePath(base, f);
            if (f.isDirectory()) {
                checkDir(base, f, msgs, token);
            } else if (f.isFile()) {
                try {
                    DeploymentMessage msg = null;
                    InputStream input = new FileInputStream(f);
                    try {
                        if (f.getName().endsWith(".pipa")) {
                            msg = checkPipa(token, input, itemURL);
                        }
                        if (msg != null)
                            msgs.add(msg);
                    } finally {
                        close(input);
                    }
                } catch (Exception e) {
                    LOG.error("Error while checking PIPA: " + f, e);
                    DeploymentMessage msg = new DeploymentMessage(Level.ERROR, e.toString());
                    msg.setResource(itemURL);
                    msgs.add(msg);
                }
            } else {
                DeploymentMessage msg = new DeploymentMessage(Level.WARNING, "Unknown file type: " + f);
                msg.setResource(itemURL);
                msgs.add(msg);
            }
        }
    }
View Full Code Here

            String itemURL = relativePath(base, f);
            if (f.isDirectory()) {
                processDir(base, f, urls, msgs, token);
            } else if (f.isFile()) {
                try {
                    DeploymentMessage msg = null;
                    InputStream input = new FileInputStream(f);
                    try {
                        if (f.getName().endsWith(".pipa")) {
                            msg = processPipa(token, input, itemURL, urls);
                        }
                        if (msg != null)
                            msgs.add(msg);
                    } finally {
                        close(input);
                    }
                } catch (Exception e) {
                    // this shouldn't happen but if it does, fail fast
                    LOG.error("Error while processing PIPA: " + f, e);
                    DeploymentMessage msg = new DeploymentMessage(Level.ERROR, e.toString());
                    msg.setResource(itemURL);
                    msgs.add(msg);
                    break;
                }
            } else {
                DeploymentMessage msg = new DeploymentMessage(Level.WARNING, "Unknown file type: " + f);
                msg.setResource(itemURL);
                msgs.add(msg);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.intalio.deploy.deployment.DeploymentMessage

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.