Example #1
0
  /**
   * Method that updates info in List nodes and also save info into database. This method is called
   * by SnmpCollection after all stuff is done
   *
   * @param snmpcoll
   */
  @Transactional
  public void updateNodeSnmpCollection(final SnmpCollection snmpcoll) {
    LogUtils.debugf(
        this, "Updating SNMP collection for %s", InetAddressUtils.str(snmpcoll.getTarget()));
    LinkableNode node = removeNode(snmpcoll.getTarget());
    if (node == null) {
      LogUtils.errorf(
          this, "No node found for SNMP collection: %s unscheduling!", snmpcoll.getInfo());
      m_scheduler.unschedule(snmpcoll);
      return;
    }

    try {
      node = m_queryMgr.storeSnmpCollection(node, snmpcoll);
    } catch (SQLException e) {
      LogUtils.errorf(
          this,
          e,
          "Failed to save on db snmpcollection/package: %s/%s",
          snmpcoll.getPackageName(),
          snmpcoll.getInfo());
      return;
    }
    if (node != null) {
      synchronized (m_nodes) {
        m_nodes.add(node);
      }
    }
  }
Example #2
0
  /** onStop */
  protected synchronized void onStop() {

    // Stop the scheduler
    m_scheduler.stop();

    m_scheduler = null;
  }
Example #3
0
  /** onStart */
  protected synchronized void onStart() {

    // start the scheduler
    //
    LogUtils.debugf(this, "start: Starting linkd scheduler");
    m_scheduler.start();

    // Set the status of the service as running.
    //

  }
Example #4
0
  private ReadyRunnable getReadyRunnable(ReadyRunnable runnable) {
    LogUtils.debugf(
        this, "getReadyRunnable: get ReadyRunnable from scheduler: %s", runnable.getInfo());

    return m_scheduler.getReadyRunnable(runnable);
  }
Example #5
0
 /** onResume */
 protected synchronized void onResume() {
   m_scheduler.resume();
 }
Example #6
0
 /** onPause */
 protected synchronized void onPause() {
   m_scheduler.pause();
 }