/** * This is the main method of the class. An instance is normally enqueued on * the scheduler which checks its <code>isReady</code> method to determine * execution. If the instance is ready for execution then it is started with * it's own thread context to execute the query. The last step in the method * before it exits is to reschedule the interface. */ @Override public void run() { Logging.withPrefix(Collectd.LOG4J_CATEGORY, () -> { Logging.putThreadContext("service", m_spec.getServiceName()); Logging.putThreadContext("ipAddress", m_agent.getAddress().getHostAddress()); Logging.putThreadContext("nodeId", Integer.toString(m_agent.getNodeId())); Logging.putThreadContext("nodeLabel", m_agent.getNodeLabel()); Logging.putThreadContext("foreignSource", m_agent.getForeignSource()); Logging.putThreadContext("foreignId", m_agent.getForeignId()); doRun(); }); }
public CollectionAgentDTO(CollectionAgent agent) { Objects.requireNonNull(agent); for (String attribute : agent.getAttributeNames()) { setAttribute(attribute, agent.getAttribute(attribute)); } address = agent.getAddress(); storeByForeignSource = agent.isStoreByForeignSource(); nodeId = agent.getNodeId(); nodeLabel = agent.getNodeLabel(); foreignSource = agent.getForeignSource(); foreignId = agent.getForeignId(); location = agent.getLocationName(); setStorageResourcePath(agent.getStorageResourcePath()); sysUpTime = agent.getSavedSysUpTime(); }