edu.isi.pegasus.planner.invocation
Class MachineInfo

java.lang.Object
  extended by org.griphyn.vdl.Chimera
      extended by edu.isi.pegasus.planner.invocation.Invocation
          extended by edu.isi.pegasus.planner.invocation.MachineInfo
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Boot, CPU, Load, Proc, RAM, Stamp, Swap, Task, Uname

public abstract class MachineInfo
extends Invocation

An abstract class that is used for all the child elements that appear in the machine element.

Version:
$Revision: 2587 $
Author:
Karan Vahi
See Also:
Serialized Form

Field Summary
protected  Map<String,String> mAttributeMap
          An internal maps that is indexed by attribute keys.
 
Constructor Summary
MachineInfo()
          Default constructor.
 
Method Summary
 void addAttribute(String key, String value)
          Adds an attribute.
 void addAttributes(List keys, List values)
          Add multiple attributes to the machine info element.
 String get(String key)
          Returns attribute value for a key
 Iterator<String> getAttributeKeysIterator()
          Returns Iterator for attribute keys.
abstract  String getElementName()
          Returns the name of the xml element corresponding to the object.
 void toString(Writer stream)
          Converts the active state into something meant for human consumption.
 void toXML(Writer stream, String indent, String namespace)
          Dump the state of the current element as XML output.
 
Methods inherited from class org.griphyn.vdl.Chimera
escape, quote, toString, toXML, toXML, writeAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mAttributeMap

protected Map<String,String> mAttributeMap
An internal maps that is indexed by attribute keys.

Constructor Detail

MachineInfo

public MachineInfo()
Default constructor.

Method Detail

getElementName

public abstract String getElementName()
Returns the name of the xml element corresponding to the object.

Returns:
name

addAttribute

public void addAttribute(String key,
                         String value)
Adds an attribute.

Parameters:
key - the attribute key
value - the attribute value

addAttributes

public void addAttributes(List keys,
                          List values)
Add multiple attributes to the machine info element.

Parameters:
keys - List of keys
values - Corresponding List of values

getAttributeKeysIterator

public Iterator<String> getAttributeKeysIterator()
Returns Iterator for attribute keys.

Returns:
iterator

get

public String get(String key)
Returns attribute value for a key

Parameters:
key -
Returns:
value

toString

public void toString(Writer stream)
              throws IOException
Converts the active state into something meant for human consumption. The method will be called when recursively traversing the instance tree.

Specified by:
toString in class org.griphyn.vdl.Chimera
Parameters:
stream - is a stream opened and ready for writing. This can also be a string stream for efficient output.
Throws:
IOException - if something fishy happens to the stream.

toXML

public void toXML(Writer stream,
                  String indent,
                  String namespace)
           throws IOException
Dump the state of the current element as XML output. This function traverses all sibling classes as necessary, and converts the data into pretty-printed XML output. The stream interface should be able to handle large output efficiently.

Specified by:
toXML in class org.griphyn.vdl.Chimera
Parameters:
stream - is a stream opened and ready for writing. This can also be a string stream for efficient output.
indent - is a String of spaces used for pretty printing. The initial amount of spaces should be an empty string. The parameter is used internally for the recursive traversal. If a null value is specified, no indentation nor linefeeds will be generated.
namespace - is the XML schema namespace prefix. If neither empty nor null, each element will be prefixed with this prefix, and the root element will map the XML namespace.
Throws:
IOException - if something fishy happens to the stream.
See Also:
BufferedWriter


Copyright © 2011 The University of Southern California. All Rights Reserved.