- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- com.aoindustries.noc.monitor.NodeImpl
-
- All Implemented Interfaces:
Node
,Serializable
,Remote
- Direct Known Subclasses:
BackupsNode
,BindsNode
,CertificatesNode
,DatabasesNode
,DeviceNode
,DevicesNode
,HardDrivesNode
,HostNode
,HostsNode
,HttpdServersNode
,IpAddressesNode
,IpAddressNode
,RaidNode
,RootNodeImpl
,ServerNode
,ServersNode
,SingleResultNodeImpl
,SlaveNode
,SlavesNode
,TableMultiResultNodeImpl
,TableResultNodeImpl
,UnallocatedNode
public abstract class NodeImpl extends UnicastRemoteObject implements Node
One in the list of nodes that form the systems tree.- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected RMIClientSocketFactory
csf
protected int
port
protected RMIServerSocketFactory
ssf
-
Fields inherited from class java.rmi.server.RemoteObject
ref
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NodeImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected AlertLevel
constrainAlertLevel(AlertLevel level)
Makes sure the alert level does not exceed the maximum for this node or any of its parents.AlertCategory
getAlertCategory()
Defaults to the alert category of the parent node.abstract AlertLevel
getAlertLevel()
This alert level must be constrained by the maximum alert level of this node and all of its parents.abstract String
getAlertMessage()
abstract boolean
getAllowsChildren()
abstract List<? extends NodeImpl>
getChildren()
abstract String
getLabel()
protected AlertLevel
getMaxAlertLevel()
Every node may optionally constrain the maximum alert level for itself and all of its children.abstract NodeImpl
getParent()
protected static <E extends NodeImpl>
List<E>getSnapshot(E child)
For thread safety and encapsulation, returns an unmodifiable copy of the list.protected static <E extends NodeImpl>
List<E>getSnapshot(E... children)
For thread safety and encapsulation, returns an unmodifiable copy of the list.protected static <E extends NodeImpl>
List<E>getSnapshot(E child1, E child2)
For thread safety and encapsulation, returns an unmodifiable copy of the list.protected static <E extends NodeImpl>
List<E>getSnapshot(E child1, E child2, E child3)
For thread safety and encapsulation, returns an unmodifiable copy of the list.protected static <E extends NodeImpl>
List<E>getSnapshot(E child1, E child2, E child3, E child4)
For thread safety and encapsulation, returns an unmodifiable copy of the list.protected static <E extends NodeImpl>
List<E>getSnapshot(List<E> children)
For thread safety and encapsulation, returns an unmodifiable copy of the list.String
toString()
The default toString is the label.-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toStub
-
-
-
-
Field Detail
-
port
protected final int port
-
csf
protected final RMIClientSocketFactory csf
-
ssf
protected final RMIServerSocketFactory ssf
-
-
Constructor Detail
-
NodeImpl
protected NodeImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException
- Throws:
RemoteException
-
-
Method Detail
-
getChildren
public abstract List<? extends NodeImpl> getChildren()
- Specified by:
getChildren
in interfaceNode
-
getSnapshot
protected static <E extends NodeImpl> List<E> getSnapshot(List<E> children)
For thread safety and encapsulation, returns an unmodifiable copy of the list.
-
getSnapshot
protected static <E extends NodeImpl> List<E> getSnapshot(E child)
For thread safety and encapsulation, returns an unmodifiable copy of the list. Any null child is skipped.
-
getSnapshot
protected static <E extends NodeImpl> List<E> getSnapshot(E child1, E child2)
For thread safety and encapsulation, returns an unmodifiable copy of the list. Any null child is skipped.
-
getSnapshot
protected static <E extends NodeImpl> List<E> getSnapshot(E child1, E child2, E child3)
For thread safety and encapsulation, returns an unmodifiable copy of the list. Any null child is skipped.
-
getSnapshot
protected static <E extends NodeImpl> List<E> getSnapshot(E child1, E child2, E child3, E child4)
For thread safety and encapsulation, returns an unmodifiable copy of the list. Any null child is skipped.
-
getSnapshot
@SafeVarargs protected static <E extends NodeImpl> List<E> getSnapshot(E... children)
For thread safety and encapsulation, returns an unmodifiable copy of the list. Any null child is skipped.
-
getMaxAlertLevel
protected AlertLevel getMaxAlertLevel()
Every node may optionally constrain the maximum alert level for itself and all of its children.
-
constrainAlertLevel
protected AlertLevel constrainAlertLevel(AlertLevel level)
Makes sure the alert level does not exceed the maximum for this node or any of its parents. Will reduce the level to not exceed any maximum.
-
getAlertLevel
public abstract AlertLevel getAlertLevel()
This alert level must be constrained by the maximum alert level of this node and all of its parents.- Specified by:
getAlertLevel
in interfaceNode
- See Also:
constrainAlertLevel(com.aoindustries.noc.monitor.common.AlertLevel)
-
getAlertMessage
public abstract String getAlertMessage()
- Specified by:
getAlertMessage
in interfaceNode
-
getAlertCategory
public AlertCategory getAlertCategory()
Defaults to the alert category of the parent node.- Specified by:
getAlertCategory
in interfaceNode
- Throws:
NullPointerException
- when there is no parent- See Also:
getParent()
-
getAllowsChildren
public abstract boolean getAllowsChildren()
- Specified by:
getAllowsChildren
in interfaceNode
-
toString
public String toString()
The default toString is the label.- Overrides:
toString
in classRemoteObject
-
-