java.lang.Object
org.altara.mars.Service
- All Implemented Interfaces:
- java.io.Serializable, javax.swing.tree.TreeNode
- public class Service
- extends java.lang.Object
- implements java.io.Serializable, javax.swing.tree.TreeNode
Represents a service on a host monitored by MARS. Each service
has a probe factory (which the service can use to build a probe
that knows how to monitor said service), a port on which the
service is running, a set of arguments to give to that factory's
create() method, and a representation of the current status
of that service.
|
Constructor Summary |
Service(Host host,
java.lang.String name,
java.lang.String svctype,
int port)
|
Service(Host host,
java.lang.String name,
java.lang.String svctype,
int port,
long timeout,
long period,
int notac)
|
Service(Host host,
java.lang.String name,
java.lang.String svctype,
int port,
long timeout,
long period,
int notac,
java.util.HashMap params)
|
NOTAC_NEVER
public static final int NOTAC_NEVER
- See Also:
- Constant Field Values
NOTAC_IMMEDIATE
public static final int NOTAC_IMMEDIATE
- See Also:
- Constant Field Values
DEFAULT_NOTAC
public static final int DEFAULT_NOTAC
- See Also:
- Constant Field Values
MAX_NOTAC
public static final int MAX_NOTAC
- See Also:
- Constant Field Values
DEFAULT_PERIOD
public static final long DEFAULT_PERIOD
- See Also:
- Constant Field Values
DEFAULT_TIMEOUT
public static final long DEFAULT_TIMEOUT
- See Also:
- Constant Field Values
host
private Host host
name
private java.lang.String name
factory
private ProbeFactory factory
port
private int port
params
private java.util.HashMap params
status
private Status status
timeout
private long timeout
period
private long period
notac
private int notac
Service
public Service(Host host,
java.lang.String name,
java.lang.String svctype,
int port)
throws InvalidServiceTypeException
Service
public Service(Host host,
java.lang.String name,
java.lang.String svctype,
int port,
long timeout,
long period,
int notac)
throws InvalidServiceTypeException
Service
public Service(Host host,
java.lang.String name,
java.lang.String svctype,
int port,
long timeout,
long period,
int notac,
java.util.HashMap params)
throws InvalidServiceTypeException
setParameter
public void setParameter(java.lang.String name,
java.lang.String value)
setStatus
public void setStatus(Status status)
setName
public void setName(java.lang.String name)
setSvcType
public void setSvcType(java.lang.String svctype)
throws InvalidServiceTypeException
setPort
public void setPort(int port)
setTimeout
public void setTimeout(long timeout)
setPeriod
public void setPeriod(long period)
setNotac
public void setNotac(int notac)
fireServiceChanged
public void fireServiceChanged()
getHost
public Host getHost()
getPort
public int getPort()
getName
public java.lang.String getName()
getProbe
public org.altara.mars.engine.Probe getProbe()
getSvcType
public java.lang.String getSvcType()
getProbeFactory
public ProbeFactory getProbeFactory()
getStatus
public Status getStatus()
getParameter
public java.lang.String getParameter(java.lang.String name)
getParameterNames
public java.util.Iterator getParameterNames()
getTimeout
public long getTimeout()
getPeriod
public long getPeriod()
getNotac
public int getNotac()
isDue
public boolean isDue()
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
getTreePath
public javax.swing.tree.TreePath getTreePath()
duplicate
public Service duplicate(Host newHost)
toJDOMElem
public org.jdom.Element toJDOMElem(boolean includeStatus)
fromJDOMElem
public static Service fromJDOMElem(Host host,
org.jdom.Element in)
throws InvalidDocumentException