Search in sources :

Example 6 with Condition

use of org.netxms.client.objects.Condition in project netxms by netxms.

the class ServiceComponentsElement method addServiceComponents.

/**
 * Add parent services for given object
 *
 * @param object
 */
private void addServiceComponents(AbstractObject object, long parentElementId) {
    Iterator<Long> it = object.getChildren();
    while (it.hasNext()) {
        long objectId = it.next();
        AbstractObject child = session.findObjectById(objectId);
        if ((child != null) && ((child instanceof Container) || (child instanceof Cluster) || (child instanceof Node) || (child instanceof Condition))) {
            long elementId = mapPage.createElementId();
            mapPage.addElement(new NetworkMapObject(elementId, objectId));
            mapPage.addLink(new NetworkMapLink(NetworkMapLink.NORMAL, parentElementId, elementId));
            addServiceComponents(child, elementId);
        }
    }
}
Also used : Condition(org.netxms.client.objects.Condition) Container(org.netxms.client.objects.Container) AbstractObject(org.netxms.client.objects.AbstractObject) Node(org.netxms.client.objects.Node) Cluster(org.netxms.client.objects.Cluster) NetworkMapObject(org.netxms.client.maps.elements.NetworkMapObject) NetworkMapLink(org.netxms.client.maps.NetworkMapLink)

Aggregations

AbstractObject (org.netxms.client.objects.AbstractObject)6 Cluster (org.netxms.client.objects.Cluster)6 Condition (org.netxms.client.objects.Condition)6 Container (org.netxms.client.objects.Container)6 Node (org.netxms.client.objects.Node)6 MobileDevice (org.netxms.client.objects.MobileDevice)3 Sensor (org.netxms.client.objects.Sensor)3 ServiceRoot (org.netxms.client.objects.ServiceRoot)3 Subnet (org.netxms.client.objects.Subnet)3 NetworkMapLink (org.netxms.client.maps.NetworkMapLink)2 NetworkMapObject (org.netxms.client.maps.elements.NetworkMapObject)2 AgentPolicy (org.netxms.client.objects.AgentPolicy)2 BusinessService (org.netxms.client.objects.BusinessService)2 BusinessServiceRoot (org.netxms.client.objects.BusinessServiceRoot)2 Dashboard (org.netxms.client.objects.Dashboard)2 DashboardGroup (org.netxms.client.objects.DashboardGroup)2 DashboardRoot (org.netxms.client.objects.DashboardRoot)2 EntireNetwork (org.netxms.client.objects.EntireNetwork)2 NetworkMap (org.netxms.client.objects.NetworkMap)2 NetworkMapGroup (org.netxms.client.objects.NetworkMapGroup)2