View Javadoc
1   /**
2    * Copyright 2010-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.util.channel.model;
17  
18  import org.kuali.common.util.Assert;
19  
20  public final class CommandResult {
21  
22  	public CommandResult(byte[] command, int exitValue, long start) {
23  		this.stop = System.currentTimeMillis();
24  		Assert.isTrue(stop >= start);
25  		Assert.noNulls(command);
26  		Assert.noNegatives(start);
27  		this.command = command;
28  		this.exitValue = exitValue;
29  		this.start = start;
30  		this.elapsed = stop - start;
31  	}
32  
33  	private final byte[] command;
34  	private final int exitValue;
35  	private final long start;
36  	private final long stop;
37  	private final long elapsed;
38  
39  	public byte[] getCommand() {
40  		return command;
41  	}
42  
43  	public int getExitValue() {
44  		return exitValue;
45  	}
46  
47  	public long getStart() {
48  		return start;
49  	}
50  
51  	public long getStop() {
52  		return stop;
53  	}
54  
55  	public long getElapsed() {
56  		return elapsed;
57  	}
58  
59  }