GemFire 7.0

com.gemstone.gemfire.management.cli
Interface Result


public interface Result

Represents result of processing GemFire Command Line Interface (CLI) command strings. Result encapsulate the output from a Command execution. This result can be iterated through as Strings using methods hasNextLine(), nextLine(), resetToFirstLine(). A Result might have a file as part of the command output & can be saved 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 Result status.
 
Method Summary
 Result.Status getStatus()
          Returns Result status of a processed command.
 boolean hasIncomingFiles()
          Returns whether this result has a file as a part of command output.
 boolean hasNextLine()
          Returns whether the result has more information in line(s).
 String nextLine()
          Returns the next line from the String representation of the Result.
 void resetToFirstLine()
          Resets the pointer to the first line in the Result
 void saveIncomingFiles(String directory)
          Save the file from this result.
 

Method Detail

getStatus

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

Returns:
Result 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 more information in line(s).

Returns:
whether the result has more information in line(s).

nextLine

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

Returns:
the next line from the String representation of the Result.
Throws:
IndexOutOfBoundsException - if this method is called more number of times than the data items it contains

hasIncomingFiles

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

Returns:
whether this result has a file as a part of command output.

saveIncomingFiles

void saveIncomingFiles(String directory)
                       throws IOException
Save the file from this result. hasIncomingFiles() should be used before calling this method to know whether the result contains file. If there is no file in the result, call to this method will result in a RuntimeException to be thrown.

Parameters:
directory - directory to which this file 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

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