- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- com.aoindustries.noc.monitor.NodeImpl
-
- com.aoindustries.noc.monitor.RootNodeImpl
-
- All Implemented Interfaces:
Node
,RootNode
,Serializable
,Remote
public class RootNodeImpl extends NodeImpl implements RootNode
The top-level node has one child for each of the servers.There is no stop here because root nodes keep running forever in the background to be reconnected to. The overhead of this is reduced by using workers and only creating one rootNode per user.
- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description AoservConnector
conn
static Executors
executors
One thread pool is shared by all components, and it is never disposed.static Random
fastRandom
A fast pseudo-random number generator for non-cryptographic purposes.Locale
locale
-
Fields inherited from class java.rmi.server.RemoteObject
ref
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTreeListener(TreeListener treeListener)
AlertCategory
getAlertCategory()
Defaults to the alert category of the parent node.AlertLevel
getAlertLevel()
The alert level is equal to the highest alert level of its children.String
getAlertMessage()
No alert messages.boolean
getAllowsChildren()
List<NodeImpl>
getChildren()
String
getLabel()
static int
getNextStartupDelayFifteenMinutes()
NodeImpl
getParent()
File
getPersistenceDirectory()
Gets the top-level persistence directory.NodeSnapshot
getSnapshot()
File
mkdir(File dir)
Creates a directory if not exists, throwing an exception when is not a directory or unable to create.void
nodeAdded()
Notifies all of the listeners.void
nodeAlertLevelChanged(NodeImpl node, AlertLevel oldAlertLevel, AlertLevel newAlertLevel, String alertMessage)
void
nodeRemoved()
Notifies all of the listeners.void
removeTreeListener(TreeListener treeListener)
static Future<?>
schedule(Runnable task, long delay)
Schedules a task to be performed in the future.-
Methods inherited from class com.aoindustries.noc.monitor.NodeImpl
constrainAlertLevel, getMaxAlertLevel, getSnapshot, getSnapshot, getSnapshot, getSnapshot, getSnapshot, getSnapshot, toString
-
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
-
fastRandom
public static final Random fastRandom
A fast pseudo-random number generator for non-cryptographic purposes.
-
executors
public static final Executors executors
One thread pool is shared by all components, and it is never disposed.
-
locale
public final Locale locale
-
conn
public final AoservConnector conn
-
-
Method Detail
-
schedule
public static Future<?> schedule(Runnable task, long delay)
Schedules a task to be performed in the future. It will be performed in a background thread via the ExecutorService.
-
getParent
public NodeImpl getParent()
-
getAllowsChildren
public boolean getAllowsChildren()
- Specified by:
getAllowsChildren
in interfaceNode
- Specified by:
getAllowsChildren
in classNodeImpl
-
getChildren
public List<NodeImpl> getChildren()
- Specified by:
getChildren
in interfaceNode
- Specified by:
getChildren
in classNodeImpl
-
getAlertLevel
public AlertLevel getAlertLevel()
The alert level is equal to the highest alert level of its children.- Specified by:
getAlertLevel
in interfaceNode
- Specified by:
getAlertLevel
in classNodeImpl
- See Also:
NodeImpl.constrainAlertLevel(com.aoindustries.noc.monitor.common.AlertLevel)
-
getAlertMessage
public String getAlertMessage()
No alert messages.- Specified by:
getAlertMessage
in interfaceNode
- Specified by:
getAlertMessage
in classNodeImpl
-
getAlertCategory
public AlertCategory getAlertCategory()
Description copied from class:NodeImpl
Defaults to the alert category of the parent node.- Specified by:
getAlertCategory
in interfaceNode
- Overrides:
getAlertCategory
in classNodeImpl
- See Also:
NodeImpl.getParent()
-
getLabel
public String getLabel()
-
addTreeListener
public void addTreeListener(TreeListener treeListener)
- Specified by:
addTreeListener
in interfaceRootNode
-
removeTreeListener
public void removeTreeListener(TreeListener treeListener)
- Specified by:
removeTreeListener
in interfaceRootNode
-
nodeAdded
public void nodeAdded()
Notifies all of the listeners. Batches the calls into a per-listener background task. Each of the background tasks may send one event representing any number of changes. Each background task will wait 250 ms between each send.
-
nodeRemoved
public void nodeRemoved()
Notifies all of the listeners. Batches the calls into a per-listener background task. Each of the background tasks may send one event representing any number of changes. Each background task will wait 250 ms between each send.
-
nodeAlertLevelChanged
public void nodeAlertLevelChanged(NodeImpl node, AlertLevel oldAlertLevel, AlertLevel newAlertLevel, String alertMessage) throws RemoteException
-
getSnapshot
public NodeSnapshot getSnapshot() throws RemoteException
- Specified by:
getSnapshot
in interfaceRootNode
- Throws:
RemoteException
-
mkdir
public File mkdir(File dir) throws IOException
Creates a directory if not exists, throwing an exception when is not a directory or unable to create.- Throws:
IOException
-
getPersistenceDirectory
public File getPersistenceDirectory() throws IOException
Gets the top-level persistence directory.- Throws:
IOException
-
getNextStartupDelayFifteenMinutes
public static int getNextStartupDelayFifteenMinutes()
-
-