Examples of ProcessResult


Examples of com.serotonin.m2m2.i18n.ProcessResult

        try {
            importContext.getReader().readInto(vo, maintenanceEvent);

            // Now validate it. Use a new response object so we can distinguish errors in this vo from other errors.
            ProcessResult voResponse = new ProcessResult();
            vo.validate(voResponse);
            if (voResponse.getHasMessages())
                // Too bad. Copy the errors into the actual response.
                importContext.copyValidationMessages(voResponse, "emport.maintenanceEvent.prefix", xid);
            else {
                // Sweet. Save it.
                boolean isnew = vo.isNew();
View Full Code Here

Examples of com.serotonin.m2m2.i18n.ProcessResult

                if ("POST".equals(request.getMethod())) {
                    // Form submission
                    String username = request.getParameter("username");
                    String password = request.getParameter("password");

                    ProcessResult loginResult = ControllerUtils.tryLogin(request, username, password);

                    model.put("loginResult", loginResult);
                }

                return null;
View Full Code Here

Examples of cu.shell.ProcessResult

                raceMessage = raceFormatter.format(race);
                storeDotMessageForDir(file.getParentFile(), raceMessage);
            }
            //System.out.println("EVENT postCheck took " + (System.currentTimeMillis() - start) + " milliseconds");
            if (ok) {
                return new ProcessResult(0, raceMessage);
            } else {
                return ProcessResult.FAILURE;
            }
        } else {
            // this isn't a filetype that the zipscript is supposed to handle anyway
View Full Code Here

Examples of cu.shell.ProcessResult

        close();
        // _todo: make transferlog a handled event (maybe then we need to trigger on FAILURE as well)(or just leave transferlog to the internal machinery)
        // (if so, then we can probably drop a lot of data from the FileTransferEvent)
        // since it happens both at failure and and success, and because it is such an integral part of the service, the xferlog stays here
//        xferlog(bytesTransferred, transferTime);
        ProcessResult pcr = postProcess(bytesTransferred, transferTime);
        connection.reportTransferFailure(e.getMessage());
        Event event = EventFactory.upload(user, fs, file, remoteHost, bytesTransferred, transferTime, pcr, "FAILED");
        ServiceManager.getServices().getEventHandler().handleAfterEvent(event);
    }
View Full Code Here

Examples of cu.shell.ProcessResult

    public void complete(long bytesTransferred, long transferTime) {
        close();
        // since it happens both at failure and and success, and because it is such an integral part of the service, the xferlog stays here
//        xferlog(bytesTransferred, transferTime);
        ProcessResult pcr = postProcess(bytesTransferred, transferTime);
        connection.reply(226, pcr.message, true); // if this wasn't a race, the raceMessage will be null, and .reply(..) will print nothing
        connection.respond("226- " + fs.getType() + " transfer of " + filename + " complete.");
        connection.statline(transfer.getSpeed());
        Event event = EventFactory.upload(user, fs, file, remoteHost, bytesTransferred, transferTime, pcr, "COMPLETE");
        ServiceManager.getServices().getEventHandler().handleAfterEvent(event);
View Full Code Here

Examples of cu.shell.ProcessResult

        Event event = EventFactory.upload(user, fs, file, remoteHost, bytesTransferred, transferTime, pcr, "COMPLETE");
        ServiceManager.getServices().getEventHandler().handleAfterEvent(event);
    }

    private ProcessResult postProcess(long bytesTransferred, long transferTime) {
        ProcessResult pcr = ServiceManager.getServices().getTransferPostProcessor().process(file, crc.getValue(), bytesTransferred, transferTime, user, section.getName(), transfer.getSpeed());
        if (pcr.exitvalue == ProcessResult.OK.exitvalue) {
            // the zipscript tells us that it was either ok or not handled. in both cases, we should add to dupelog and all other suff
            log(bytesTransferred, transferTime);
        } else {
            // since the zipscript failed, we should delete the file
View Full Code Here

Examples of cu.shell.ProcessResult

    }

    public boolean handleEvent(Event event, Connection connection) {
        try {

            ProcessResult pcr = execute(event, "before");
            if (pcr.message != null && !"".equals(pcr.message)) {
                connection.respond(pcr.message);
            }
            return (pcr.exitvalue == ProcessResult.OK.exitvalue);
        } catch (IOException | InterruptedException e) {
View Full Code Here

Examples of cu.shell.ProcessResult

            return false;
        }
    }

    private ProcessResult execute(Event event, String time) throws IOException, InterruptedException {
        ProcessResult pcr;
        if (event.getType() == Event.SITE_COMMAND) {
            pcr = Shell.execute(
                    executablePath,
                    time,
                    String.valueOf(event.getType()),
View Full Code Here

Examples of org.apache.commons.scaffold.util.ProcessResult

                    // recurse for each ProcessResult in collection
                Collection collection = (Collection)
                    result.getData();
                Iterator iterator = collection.iterator();
                while (iterator.hasNext()) {
                    ProcessResult nextResult =
                        (ProcessResult) iterator.next();
                    checkOutcome(mapping,request,response,nextResult);
                }
            }
View Full Code Here

Examples of org.apache.commons.scaffold.util.ProcessResult

                properties = PropertyUtils.describe(userBean);
            }

                // Execute business logic, using values from  map
            servlet.log(Log.HELPER_EXECUTING,Log.DEBUG);
            ProcessResult result = (ProcessResult)
                dataBean.execute(properties);

                // Analyze result of business logic
            checkOutcome(mapping,request,response,result);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.