GemFire 7.0.1

com.gemstone.gemfire.management.cli
Interface Result


public interface Result

The result of processing a GemFire Command Line Interface (CLI) command string. A string representation of this Result can be iterated over using the methods hasNextLine(), nextLine() and resetToFirstLine(). A Result may have one or more files as part of the command output and if so they can be saved to the file system using saveIncomingFiles(String). To check whether the result has a file in it use hasIncomingFiles().

Since:
7.0

Nested Class Summary
static class Result.Status
          Indicates a Results status.
 
Method Summary
 Result.Status getStatus()
          Returns the status of a processed command.
 boolean hasIncomingFiles()
          Returns whether this Result has a file as a part of the command output.
 boolean hasNextLine()
          Returns whether the result has any more lines of information.
 String nextLine()
          Returns the next line of information from the Result.
 void resetToFirstLine()
          Resets the pointer to the first line in the Result.
 void saveIncomingFiles(String directory)
          Save the file(s) from this Result.
 

Method Detail

getStatus

Result.Status getStatus()
Returns the status of a processed command.


resetToFirstLine

void resetToFirstLine()
Resets the pointer to the first line in the Result.


hasNextLine

boolean hasNextLine()
Returns whether the result has any more lines of information.

Returns:
True if there are more lines, false otherwise.

nextLine

String nextLine()
Returns the next line of information from the Result.

Throws:
IndexOutOfBoundsException - if this method is called more times than there are lines of information.

hasIncomingFiles

boolean hasIncomingFiles()
Returns whether this Result has a file as a part of the command output.

Returns:
True if there is a file, false otherwise.

saveIncomingFiles

void saveIncomingFiles(String directory)
                       throws IOException
Save the file(s) from this Result. hasIncomingFiles() should be used before calling this method to verify that the Result contains a file.

Parameters:
directory - Directory to which the file(s) should be saved.
Throws:
IOException - If an error occurs while saving the file.
RuntimeException - If there is no file in the Result to save.

GemFire 7.0.1

Copyright © 1997-2013 VMware, Inc. All rights reserved.