|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.ace.moab.api.connect.MoabInputStream
public class MoabInputStream
This class is essentially a wrapper for the standard out stream that come from running a moab command. However, it contains some optional information like the command that was run and a reference to the error stream (comes from standard error) to help MCM properly report the results of this command if desired. If the command is run over SSH or from a jar file, the errorStream will be null because the error stream data will be included with the input. If running on the local machine, the error stream may be separate from the input stream.
Constructor Summary | |
---|---|
MoabInputStream()
creates an empty moab input stream |
|
MoabInputStream(java.io.InputStream inStream,
java.io.InputStream errStream,
java.lang.String cmd)
Creates a new instance |
Method Summary | |
---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
void |
close()
Closes the input stream |
void |
closeAll()
Closes both the input and error stream |
java.lang.String |
getCommand()
The moab command that was run to create this input stream |
java.io.InputStream |
getErrorStream()
returns the error stream from running the moab client command if the command was run on the local host |
int |
getExitCode()
Returns the exit code returned from the process or session that returned this Moab input stream. |
void |
mark(int readlimit)
Marks the current position in this input stream. |
boolean |
markSupported()
Tests if this input stream supports the mark and reset methods. |
int |
read()
reads a byte from the inputStream, which comes from the standard out of the moab client command. |
int |
read(byte[] b)
Reads some number of bytes from the input stream and stores them into the buffer array b |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the input stream into an array of bytes. |
void |
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream |
void |
setExitCode(int exitcode)
Sets the exit code returned from the process or session that returned this Moab input stream. |
long |
skip(long n)
Skips over and discards n bytes of data from this input stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MoabInputStream()
public MoabInputStream(java.io.InputStream inStream, java.io.InputStream errStream, java.lang.String cmd)
inStream
- the standard out stream (or ssh stream or demo jar stream)errStream
- Method Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public java.io.InputStream getErrorStream()
public java.lang.String getCommand()
public void closeAll()
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void mark(int readlimit)
mark
in class java.io.InputStream
public boolean markSupported()
markSupported
in class java.io.InputStream
public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public int getExitCode()
public void setExitCode(int exitcode)
exitcode
- the exit code returned from the process or session that
returned this Moab input stream.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |