Package cu.shell

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


        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

    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

        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

    }

    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

            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

TOP

Related Classes of cu.shell.ProcessResult

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.