Search in sources :

Example 21 with RancidNode

use of org.opennms.rancid.RancidNode in project opennms by OpenNMS.

the class RancidProvisioningAdapter method updateGroupConfiguration.

private void updateGroupConfiguration(String group) {
    Iterator<Integer> ite = m_onmsNodeRancidNodeMap.keySet().iterator();
    while (ite.hasNext()) {
        Integer nodeId = ite.next();
        RancidNode rnode = m_onmsNodeRancidNodeMap.get(nodeId);
        if (group.equals(rnode.getGroup())) {
            boolean stateUp = rnode.isStateUp();
            rnode.setStateUp(false);
            try {
                updateConfiguration(nodeId.intValue(), rnode, m_cp, true);
            } catch (ProvisioningAdapterException pae) {
                LOG.error("updateGroupConfiguration: group: " + group + "failed set down for rancid node: " + rnode.getDeviceName() + "Reason: " + pae.getMessage());
            }
            rnode.setStateUp(stateUp);
        }
    }
}
Also used : RancidNode(org.opennms.rancid.RancidNode)

Aggregations

RancidNode (org.opennms.rancid.RancidNode)21 RancidApiException (org.opennms.rancid.RancidApiException)9 InventoryNode (org.opennms.rancid.InventoryNode)7 RWSResourceList (org.opennms.rancid.RWSResourceList)6 ArrayList (java.util.ArrayList)4 OnmsNode (org.opennms.netmgt.model.OnmsNode)3 RancidNodeAuthentication (org.opennms.rancid.RancidNodeAuthentication)3 ParseException (java.text.ParseException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 InventoryElement2 (org.opennms.rancid.InventoryElement2)2 TransactionStatus (org.springframework.transaction.TransactionStatus)2 InventoryMemory (org.opennms.rancid.InventoryMemory)1 InventorySoftware (org.opennms.rancid.InventorySoftware)1 RWSBucket (org.opennms.rancid.RWSBucket)1 BucketItem (org.opennms.rancid.RWSBucket.BucketItem)1 Tuple (org.opennms.rancid.Tuple)1