Ejemplo n.º 1
0
  @Override
  @LogMessageDocs({
    @LogMessageDoc(
        level = "WARN",
        message = "Error parsing flow idle timeout, " + "using default of {number} seconds",
        explanation = "The properties file contains an invalid " + "flow idle timeout",
        recommendation = "Correct the idle timeout in the " + "properties file."),
    @LogMessageDoc(
        level = "WARN",
        message = "Error parsing flow hard timeout, " + "using default of {number} seconds",
        explanation = "The properties file contains an invalid " + "flow hard timeout",
        recommendation = "Correct the hard timeout in the " + "properties file."),
  })
  public void init(FloodlightModuleContext context) throws FloodlightModuleException {
    super.init();
    this.floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
    this.deviceManager = context.getServiceImpl(IDeviceService.class);
    this.routingEngine = context.getServiceImpl(IRoutingService.class);
    this.topology = context.getServiceImpl(ITopologyService.class);
    this.counterStore = context.getServiceImpl(ICounterStoreService.class);

    // read our config options
    Map<String, String> configOptions = context.getConfigParams(this);
    try {
      String idleTimeout = configOptions.get("idletimeout");
      if (idleTimeout != null) {
        FLOWMOD_DEFAULT_IDLE_TIMEOUT = Short.parseShort(idleTimeout);
      }
    } catch (NumberFormatException e) {
      log.warn(
          "Error parsing flow idle timeout, " + "using default of {} seconds",
          FLOWMOD_DEFAULT_IDLE_TIMEOUT);
    }
    try {
      String hardTimeout = configOptions.get("hardtimeout");
      if (hardTimeout != null) {
        FLOWMOD_DEFAULT_HARD_TIMEOUT = Short.parseShort(hardTimeout);
      }
    } catch (NumberFormatException e) {
      log.warn(
          "Error parsing flow hard timeout, " + "using default of {} seconds",
          FLOWMOD_DEFAULT_HARD_TIMEOUT);
    }
    log.debug("FlowMod idle timeout set to {} seconds", FLOWMOD_DEFAULT_IDLE_TIMEOUT);
    log.debug("FlowMod hard timeout set to {} seconds", FLOWMOD_DEFAULT_HARD_TIMEOUT);
  }
Ejemplo n.º 2
0
 @Override
 public void startUp(FloodlightModuleContext context) {
   super.startUp();
 }