private boolean isNeutronPort(String name) { try { Uuid portId = new Uuid(name); return true; } catch (IllegalArgumentException e) { LOG.debug("Port {} is not a Neutron Port, skipping.", name); } return false; }
@Override protected Object doExecute() throws Exception { Uuid vuuid = null; if (vid != null) { vuuid = new Uuid(vid); } for (String p : neutronVpnManager.showVpnConfigCLI(vuuid)) { System.out.println(p); } return null; } }
public static InstanceIdentifier<Context> getContextIID(String cid) { Uuid _cid = new Uuid(cid); return getContextIID(_cid); }
protected void setupListener() { m_listener = new SimpleIrdListener(new Uuid(m_context)); m_listener.register(m_dataBroker, m_iid); }
public static InstanceIdentifier<ResourceCostMap> getResourceCostMapIID(String cid, String rid) { Uuid _cid = new Uuid(cid); ResourceId _rid = new ResourceId(rid); return getResourceCostMapIID(_cid, _rid); }
public static ResourceId createResourceWithCapabilities(String cid, String rid, Class<? extends ResourceType> type, Capabilities capabilities, final WriteTransaction wx) { Uuid contextId = new Uuid(cid); ResourceId resourceId = new ResourceId(rid); return createResourceWithCapabilities(contextId, resourceId, type, capabilities, wx); }
public static Tag updateResource(String cid, String rid, List<InstanceIdentifier<?>> dependencies, final WriteTransaction wx) { return updateResource(new Uuid(cid), new ResourceId(rid), dependencies, wx); }
public static ResourceId createResource(String cid, String rid, Class<? extends ResourceType> type, final WriteTransaction wx) { Uuid _cid = new Uuid(cid); ResourceId _rid = new ResourceId(rid); return createResource(_cid, _rid, type, wx); }
public static void deleteResource(String cid, String rid, final WriteTransaction wx) { Uuid contextId = new Uuid(cid); ResourceId resourceId = new ResourceId(rid); deleteResource(contextId, resourceId, wx); }
public static InstanceIdentifier<ResourceNetworkMap> getResourceNetworkMapIID(String cid, String rid) { Uuid _cid = new Uuid(cid); ResourceId _rid = new ResourceId(rid); return getResourceNetworkMapIID(_cid, _rid); }
public static InstanceIdentifier<Resource> getResourceIID(String cid, String rid) { Uuid _cid = new Uuid(cid); ResourceId _rid = new ResourceId(rid); return getResourceIID(_cid, _rid); }
public static Tag lazyUpdateResource(String cid, String rid, final WriteTransaction wx) { Uuid contextId = new Uuid(cid); ResourceId resourceId = new ResourceId(rid); return lazyUpdateResource(contextId, resourceId, wx); }
public static String getRouterIdfromVpnInstance(DataBroker broker,String vpnName){ InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class) .child(VpnMap.class, new VpnMapKey(new Uuid(vpnName))).build(); Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier); if (optionalVpnMap.isPresent()) { return optionalVpnMap.get().getRouterId().getValue(); } return null; }
public static InstanceIdentifier<ContextTag> getContextTagIID(String cid, String rid, String tag) { Uuid _cid = new Uuid(cid); ResourceId _rid = new ResourceId(rid); Tag _tag = new Tag(tag); return getContextTagIID(_cid, _rid, _tag); }
private void buildTerminationPoint(ReadWriteTransaction transaction, InstanceIdentifier<TerminationPoint> tpPath, OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder, Node node, Entry<UUID, Port> portUpdate) { tpAugmentationBuilder .setName(portUpdate.getValue().getName()); tpAugmentationBuilder.setPortUuid(new Uuid( portUpdate.getValue().getUuid().toString())); updatePort(transaction, node, tpPath, portUpdate, tpAugmentationBuilder); }
private void handleRouterGatewayUpdated(Port routerGwPort) { Uuid routerId = new Uuid(routerGwPort.getDeviceId()); Router router = NeutronvpnUtils.getNeutronRouter(dataBroker, routerId); if (router == null) { LOG.warn("No router found for router GW port {} router id {}", routerGwPort.getUuid(), routerId.getValue()); return; } gwMacResolver.sendArpRequestsToExtGateways(router); }
private void removeCostMap(InstanceIdentifier<CostMap> mapIID, CostMap removed, final WriteTransaction wx) { SimpleIrdUtils.deleteConfigEntry(removed.getResourceId(), wx); ManualMapsUtils.deleteResourceCostMap(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), removed.getResourceId(), wx); m_costmapServiceReg.unregisterPath(ServiceContext.class, ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), removed.getResourceId(), removed.getTag())); removeMap(mapIID, wx); }
@Override protected void update(InstanceIdentifier<Port> identifier, Port original, Port update) { LOG.debug("update port notification handler is invoked..."); if (update.getDeviceOwner().equalsIgnoreCase(Ipv6Constants.NETWORK_ROUTER_INTERFACE)) { ifMgr.updateRouterIntf(update.getUuid(), new Uuid(update.getDeviceId()), update.getFixedIps()); } else { ifMgr.updateHostIntf(update.getUuid(), update.getFixedIps()); } }
private void removeNetworkMap(InstanceIdentifier<NetworkMap> mapIID, NetworkMap removed, final WriteTransaction wx) { SimpleIrdUtils.deleteConfigEntry(removed.getResourceId(), wx); String path = removed.getResourceId().getValue(); AltoNbrNetworkmapUtils.deleteRecord(path, wx); ResourcepoolUtils.deleteResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), removed.getResourceId(), wx); m_networkmapServiceReg.unregisterPath(ServiceContext.class, ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), removed.getResourceId(), removed.getTag())); removeMap(mapIID, wx); }
protected void createContext() throws InterruptedException, ExecutionException { WriteTransaction wx = m_dataBroker.newWriteOnlyTransaction(); m_context = ResourcepoolUtils.getUUID(SIMPLE_IRD_ROUTE_NAME); ResourcepoolUtils.createContext(m_context, wx); InformationBuilder builder = new InformationBuilder(); builder.setContextId(new Uuid(m_context)); InstanceIdentifier<Information> infoIID; infoIID = InstanceIdentifier.builder(Information.class).build(); wx.put(LogicalDatastoreType.OPERATIONAL, infoIID, builder.build()); wx.submit().get(); LOG.info("Registered context {} for SimpleIrd", m_context); }