Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.altara.mars
Class Host  view Host download Host.java

java.lang.Object
  extended byorg.altara.mars.Host
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeNode

public class Host
extends java.lang.Object
implements java.io.Serializable, javax.swing.tree.TreeNode

Represents a single host monitored by MARS. Each Host contains a set of Services, which contain service specific information.


Field Summary
private  java.net.InetAddress address
           
private  MarsModel model
           
private  java.lang.String name
           
private  java.util.LinkedList serviceListCache
           
private  java.util.SortedMap services
           
 
Constructor Summary
Host(MarsModel model, java.lang.String hostname)
           
Host(MarsModel model, java.lang.String nickname, java.net.InetAddress address)
           
Host(MarsModel model, java.lang.String nickname, java.lang.String hostname)
           
 
Method Summary
 void addService(Service service)
           
 java.util.Enumeration children()
          children
 Host duplicate()
           
 void fireHostChanged()
           
static Host fromJDOMElem(MarsModel model, org.jdom.Element in)
           
 java.net.InetAddress getAddress()
           
 boolean getAllowsChildren()
          getAllowsChildren
 javax.swing.tree.TreeNode getChildAt(int childIndex)
          getChildAt
 int getChildCount()
          getChildCount
 int getIndex(javax.swing.tree.TreeNode node)
          getIndex
 MarsModel getModel()
           
 java.lang.String getName()
           
 javax.swing.tree.TreeNode getParent()
          getParent
 Service getService(java.lang.String name)
           
 java.util.Iterator getServiceNames()
           
 java.util.Iterator getServices()
           
 boolean isLeaf()
          isLeaf
 boolean isOK()
           
 void removeService(Service service)
           
 void removeService(java.lang.String name)
           
 void setAddress(java.net.InetAddress address)
           
 void setName(java.lang.String name)
           
 org.jdom.Element toJDOMElem(boolean includeStatus)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
private  void updateServiceListCache()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

model

private MarsModel model

name

private java.lang.String name

address

private java.net.InetAddress address

services

private java.util.SortedMap services

serviceListCache

private java.util.LinkedList serviceListCache
Constructor Detail

Host

public Host(MarsModel model,
            java.lang.String nickname,
            java.net.InetAddress address)

Host

public Host(MarsModel model,
            java.lang.String nickname,
            java.lang.String hostname)
     throws java.net.UnknownHostException

Host

public Host(MarsModel model,
            java.lang.String hostname)
     throws java.net.UnknownHostException
Method Detail

setName

public void setName(java.lang.String name)

setAddress

public void setAddress(java.net.InetAddress address)

addService

public void addService(Service service)

fireHostChanged

public void fireHostChanged()

getModel

public MarsModel getModel()

getName

public java.lang.String getName()

getAddress

public java.net.InetAddress getAddress()

getService

public Service getService(java.lang.String name)

getServiceNames

public java.util.Iterator getServiceNames()

getServices

public java.util.Iterator getServices()

removeService

public void removeService(java.lang.String name)

removeService

public void removeService(Service service)

updateServiceListCache

private void updateServiceListCache()

isOK

public boolean isOK()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


getAllowsChildren

public boolean getAllowsChildren()
Description copied from interface: javax.swing.tree.TreeNode
getAllowsChildren

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

getChildCount

public int getChildCount()
Description copied from interface: javax.swing.tree.TreeNode
getChildCount

Specified by:
getChildCount in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Description copied from interface: javax.swing.tree.TreeNode
isLeaf

Specified by:
isLeaf in interface javax.swing.tree.TreeNode

getParent

public javax.swing.tree.TreeNode getParent()
Description copied from interface: javax.swing.tree.TreeNode
getParent

Specified by:
getParent in interface javax.swing.tree.TreeNode

children

public java.util.Enumeration children()
Description copied from interface: javax.swing.tree.TreeNode
children

Specified by:
children in interface javax.swing.tree.TreeNode

getChildAt

public javax.swing.tree.TreeNode getChildAt(int childIndex)
Description copied from interface: javax.swing.tree.TreeNode
getChildAt

Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Description copied from interface: javax.swing.tree.TreeNode
getIndex

Specified by:
getIndex in interface javax.swing.tree.TreeNode

duplicate

public Host duplicate()

toJDOMElem

public org.jdom.Element toJDOMElem(boolean includeStatus)

fromJDOMElem

public static Host fromJDOMElem(MarsModel model,
                                org.jdom.Element in)
                         throws InvalidDocumentException,
                                java.net.UnknownHostException