@Override public void init(SyncManager syncManager, FloodlightModuleContext context) { storageSource = context.getServiceImpl(IStorageSourceService.class); // storageSource.addListener(CONTROLLER_TABLE_NAME, this); Map<String, String> config = context.getConfigParams(FloodlightProvider.class); thisControllerID = config.get("controllerid"); config = context.getConfigParams(SyncManager.class); keyStorePath = config.get("keyStorePath"); keyStorePassword = config.get("keyStorePassword"); authScheme = AuthScheme.NO_AUTH; try { authScheme = AuthScheme.valueOf(config.get("authScheme")); } catch (Exception e) {} }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { // This has to be done here since we don't know what order the // startUp methods will be called this.restlets = new ArrayList<RestletRoutable>(); this.fmlContext = context; // read our config options Map<String, String> configOptions = context.getConfigParams(this); restHost = configOptions.get("host"); if (restHost == null) { Map<String, String> providerConfigOptions = context.getConfigParams( FloodlightProvider.class); restHost = providerConfigOptions.get("openflowhost"); } if (restHost != null) { logger.debug("REST host set to {}", restHost); } String port = configOptions.get("port"); if (port != null) { restPort = Integer.parseInt(port); } logger.debug("REST port set to {}", restPort); }
@Override public void startUp(FloodlightModuleContext context) { Map<String, Object> locals = new HashMap<String, Object>(); // add all existing module references to the debug server for (Class<? extends IFloodlightService> s : context.getAllServices()) { // Put only the last part of the name String[] bits = s.getCanonicalName().split("\\."); String name = bits[bits.length-1]; locals.put(name, context.getServiceImpl(s)); } // read our config options Map<String, String> configOptions = context.getConfigParams(this); jythonHost = configOptions.get("host"); if (jythonHost == null) { Map<String, String> providerConfigOptions = context.getConfigParams( FloodlightProvider.class); jythonHost = providerConfigOptions.get("openflowhost"); } if (jythonHost != null) { log.debug("Jython host set to {}", jythonHost); } String port = configOptions.get("port"); if (port != null) { jythonPort = Integer.parseInt(port); } log.debug("Jython port set to {}", jythonPort); JythonServer debug_server = new JythonServer(jythonHost, jythonPort, locals); debug_server.start(); }
@Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { // TODO Auto-generated method stub this.syncService = context.getServiceImpl(ISyncService.class); switchService = context.getServiceImpl(IOFSwitchService.class); utilDurable = new UtilDurable(); Map<String, String> configParams = context.getConfigParams(FloodlightProvider.class); controllerId = configParams.get("controllerId"); }