001/** 002 * Copyright 2010-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.common.util.channel.model; 017 018import org.kuali.common.util.Assert; 019 020public final class CommandResult { 021 022 public CommandResult(byte[] command, int exitValue, long start) { 023 this.stop = System.currentTimeMillis(); 024 Assert.isTrue(stop >= start); 025 Assert.noNulls(command); 026 Assert.noNegatives(start); 027 this.command = command; 028 this.exitValue = exitValue; 029 this.start = start; 030 this.elapsed = stop - start; 031 } 032 033 private final byte[] command; 034 private final int exitValue; 035 private final long start; 036 private final long stop; 037 private final long elapsed; 038 039 public byte[] getCommand() { 040 return command; 041 } 042 043 public int getExitValue() { 044 return exitValue; 045 } 046 047 public long getStart() { 048 return start; 049 } 050 051 public long getStop() { 052 return stop; 053 } 054 055 public long getElapsed() { 056 return elapsed; 057 } 058 059}