private void autobahn() throws ResourceException, ProtocolException { LOGGER.info("autobahn ..."); l2BoDCapabilityService = OpennaasClient.getL2BoDCapabilityService(); queueManager = OpennaasClient.getQueueManagerCapabilityService(); resourceManagerService = OpennaasClient.getResourceManagerService(); protocolSessionManagerService = OpennaasClient.getProtocolSessionManagerService(); // BoD ResourceIdentifier identifier5 = null; identifier5 = resourceManagerService.createResource( getBoDResourceDescriptor("", getText("autobahn.bod.name"), "bod", "")); protocolSessionManagerService.registerContext( identifier5.getId(), getProtocolSessionContext(getText("protocol.bod.name"), getText("protocol.uri.autobahn"))); resourceManagerService.startResource(identifier5); session.put(getText("autobahn.bod.name"), identifier5); // Connection 1 String interfaceName1 = getText("autobahn.connection1.interface1"); String interfaceName2 = getText("autobahn.connection1.interface2"); String vlanid = getText("autobahn.connection1.vlanid"); String endtime = getText("autobahn.connection1.endtime"); String capacity = getText("autobahn.connection1.capacity"); l2BoDCapabilityService.requestConnection( identifier5.getId(), interfaceName1, interfaceName2, vlanid, capacity, endtime); queueManager.execute(identifier5.getId()); LOGGER.info(" connection 1 done."); // Connection 2 interfaceName1 = getText("autobahn.connection2.interface1"); interfaceName2 = getText("autobahn.connection2.interface2"); vlanid = getText("autobahn.connection2.vlanid"); endtime = getText("autobahn.connection2.endtime"); capacity = getText("autobahn.connection2.capacity"); l2BoDCapabilityService.requestConnection( identifier5.getId(), interfaceName1, interfaceName2, vlanid, capacity, endtime); queueManager.execute(identifier5.getId()); LOGGER.info(" connection 2 done."); }
/** * @throws CapabilityException_Exception * @throws ActionException_Exception * @throws ProtocolException_Exception */ private void removeGRE() throws CapabilityException_Exception, ActionException_Exception, ProtocolException_Exception { try { queueCapab = OpennaasClient.getQueueManagerCapabilityService(); greCapab = OpennaasClient.getGRETunnelCapabilityService(); if (session.get(getText("myre.lrouter.name")) != null) { GreTunnelService greTunnelService = new GreTunnelService(); String lrMyreId = ((ResourceIdentifier) session.get(getText("myre.lrouter.name"))).getId(); greTunnelService.setName(getText("myre.iface.gre")); greCapab.deleteGRETunnel(lrMyreId, greTunnelService); queueCapab.execute(lrMyreId); } } catch (Exception e) { LOGGER.error("Can't delete GRE."); } }
/** * @throws ResourceException_Exception * @throws CapabilityException_Exception * @throws ActionException_Exception * @throws ProtocolException_Exception */ private void removeLR() throws ResourceException_Exception, CapabilityException_Exception, ActionException_Exception, ProtocolException_Exception { try { chassisCapab = OpennaasClient.getChassisCapabilityService(); resourceManagerService = OpennaasClient.getResourceManagerService(); queueCapab = OpennaasClient.getQueueManagerCapabilityService(); ResourceIdentifier lrUnic = (ResourceIdentifier) session.get(getText("unic.lrouter.name")); ResourceIdentifier lrGSN = (ResourceIdentifier) session.get(getText("myre.lrouter.name")); ResourceIdentifier lrMyre = (ResourceIdentifier) session.get(getText("gsn.lrouter.name")); try { if (lrUnic != null) { resourceManagerService.stopResource(lrUnic); resourceManagerService.removeResourceById(lrUnic.getId()); if (session.get(getText("unic.router.name")) != null) { ComputerSystem router = new ComputerSystem(); String routerUnicId = ((ResourceIdentifier) session.get(getText("unic.router.name"))).getId(); router.setName(getText("unic.lrouter.name")); chassisCapab.deleteLogicalRouter(routerUnicId, router); queueCapab.execute(routerUnicId); } } } catch (Exception e) { LOGGER.error("Can't delete " + getText("unic.lrouter.name") + " LR"); } try { if (lrMyre != null) { resourceManagerService.stopResource(lrMyre); resourceManagerService.removeResourceById(lrMyre.getId()); if (session.get(getText("myre.router.name")) != null) { ComputerSystem router = new ComputerSystem(); String routerMyreId = ((ResourceIdentifier) session.get(getText("myre.router.name"))).getId(); router.setName(getText("myre.lrouter.name")); chassisCapab.deleteLogicalRouter(routerMyreId, router); queueCapab.execute(routerMyreId); } } } catch (Exception e) { LOGGER.error("Can't delete " + getText("myre.lrouter.name") + " LR"); } try { if (lrMyre != null) { resourceManagerService.stopResource(lrGSN); resourceManagerService.removeResourceById(lrGSN.getId()); if (session.get(getText("gsn.router.name")) != null) { ComputerSystem router = new ComputerSystem(); String routerGSNId = ((ResourceIdentifier) session.get(getText("gsn.router.name"))).getId(); router.setName(getText("gsn.lrouter.name")); chassisCapab.deleteLogicalRouter(routerGSNId, router); queueCapab.execute(routerGSNId); } } } catch (Exception e) { LOGGER.error("Can't delete " + getText("gsn.router.name") + " LR"); } } catch (Exception e) { LOGGER.error("Can't delete all logical routers."); } }