コード例 #1
0
  protected final C getDSLAMProviderContextImpl(DSLAMProviderRequest request) // yes, final!
      throws IOException {
    C res = null;

    {
      if (request != null) {
        String key = request.getTarget();

        res = cache.get(key, request);
      }
    }

    return res;
  }
コード例 #2
0
  public boolean isRequestRecognizable(DSLAMProviderRequest request) throws IOException {
    boolean res = false;

    {
      Map<String, Object> systemProperties =
          DSLAMProviderUtil.readSNMPTargetSystemProperties(request);

      String[] subStrings = getSubStringForDetection();

      if (DSLAMProviderUtil.doesTargetSystemPropertiesContain(systemProperties, subStrings)) {
        res = true;
      }

      // Log result:
      {
        Logger logger = ProviderLog.getLogger();
        Level level = Level.FINE;
        if (logger.isLoggable(level)) {
          String message =
              "The result of request recognition for DSLAM \""
                  + request.getTarget()
                  + "\" against allocator \""
                  + getAllocatorName()
                  + "\" is: "
                  + res
                  + " (DSLAM-system-properties="
                  + systemProperties
                  + ", allocator-sub-strings="
                  + Arrays.toString(subStrings)
                  + ")!";
          logger.log(level, message);
        }
      }
    }

    return res;
  }