private void getRancidCategories() { if (!isAdapterConfigured()) { LOG.info("RANCID is not configured. Skipping category initialization."); return; } try { m_rancid_categories = RWSClientApi.getRWSResourceDeviceTypesPatternList(m_cp).getResource(); } catch (RancidApiException e) { ConnectionProperties cp = getStandByRWSConnection(); if (cp != null) { try { m_rancid_categories = RWSClientApi.getRWSResourceDeviceTypesPatternList(m_cp).getResource(); } catch (RancidApiException e1) { LOG.warn("getRancidCategories: not able to retrieve rancid categories from RWS server"); m_rancid_categories = new ArrayList<>(); m_rancid_categories.add("cisco"); LOG.warn("getRancidCategories: setting categories list to 'cisco'"); } } } }
private void getRancidCategories() { if (!isAdapterConfigured()) { LOG.info("RANCID is not configured. Skipping category initialization."); return; } try { m_rancid_categories = RWSClientApi.getRWSResourceDeviceTypesPatternList(m_cp).getResource(); } catch (RancidApiException e) { ConnectionProperties cp = getStandByRWSConnection(); if (cp != null) { try { m_rancid_categories = RWSClientApi.getRWSResourceDeviceTypesPatternList(m_cp).getResource(); } catch (RancidApiException e1) { LOG.warn("getRancidCategories: not able to retrieve rancid categories from RWS server"); m_rancid_categories = new ArrayList<>(); m_rancid_categories.add("cisco"); LOG.warn("getRancidCategories: setting categories list to 'cisco'"); } } } }
cp = getStandByRWSConnection(); if (retry && cp != null) { LOG.info("doDelete: retry Delete on standByConn: {}", cp.getUrl());
cp = getStandByRWSConnection(); if (retry && cp != null) { LOG.info("doDelete: retry Delete on standByConn: {}", cp.getUrl());
private void updateConfiguration(int nodeid, RancidNode rNode,ConnectionProperties cp, boolean retry) throws ProvisioningAdapterException { LOG.debug("updateConfiguration: Updating Rancid Router.db configuration for node: {} type: {} group: {}", rNode.getDeviceName(), rNode.getDeviceType(),rNode.getGroup()); try { RWSClientApi.updateRWSRancidNode(cp, rNode); } catch (Throwable e) { cp = getStandByRWSConnection(); if (retry && cp != null) { LOG.info("updateConfiguration: retry update on standByConn: {}", cp.getUrl()); updateConfiguration(nodeid, rNode, cp, false); } else { sendAndThrow(nodeid, e); } } }
private void updateConfiguration(int nodeid, RancidNode rNode,ConnectionProperties cp, boolean retry) throws ProvisioningAdapterException { LOG.debug("updateConfiguration: Updating Rancid Router.db configuration for node: {} type: {} group: {}", rNode.getDeviceName(), rNode.getDeviceType(),rNode.getGroup()); try { RWSClientApi.updateRWSRancidNode(cp, rNode); } catch (Throwable e) { cp = getStandByRWSConnection(); if (retry && cp != null) { LOG.info("updateConfiguration: retry update on standByConn: {}", cp.getUrl()); updateConfiguration(nodeid, rNode, cp, false); } else { sendAndThrow(nodeid, e); } } }
sendAndThrow(nodeId, ae); } catch (Throwable e) { cp = getStandByRWSConnection(); if (retry && cp != null) { LOG.info("doAdd: retry Add on standByConn: {}", cp.getUrl());
sendAndThrow(nodeId, ae); } catch (Throwable e) { cp = getStandByRWSConnection(); if (retry && cp != null) { LOG.info("doAdd: retry Add on standByConn: {}", cp.getUrl());
cp = getStandByRWSConnection(); if (retry && cp != null) { LOG.info("doUpdate: retry Update on standByConn: {}", cp.getUrl());
cp = getStandByRWSConnection(); if (retry && cp != null) { LOG.info("doUpdate: retry Update on standByConn: {}", cp.getUrl());