/** * Perform a SNMP walk and returns the list of {@link TreeEvent} * @return the list of {@link TreeEvent} */ public List<TreeEvent> walk() { TreeUtils treeUtils = new TreeUtils(this.snmp, new DefaultPDUFactory()); @SuppressWarnings("unchecked") List<TreeEvent> events = treeUtils.getSubtree(this.target, this.oid); return events; }
/** * Method to construct {@link FlowFile} attributes from a {@link TreeEvent} * @param treeEvent a {@link TreeEvent} * @param flowFile instance of the {@link FlowFile} to update * @param processSession instance of {@link ProcessSession} * @return updated {@link FlowFile} */ public static FlowFile updateFlowFileAttributesWithTreeEventProperties(TreeEvent treeEvent, FlowFile flowFile, ProcessSession processSession) { Map<String, String> attributes = new HashMap<String, String>(); addWalkOidValues(attributes, treeEvent.getVariableBindings()); flowFile = processSession.putAllAttributes(flowFile, attributes); return flowFile; }
@Override public PDU createPDU(MessageProcessingModel messageProcessingModel) { int type = getPduType(); PDU pdu = DefaultPDUFactory.createPDU(messageProcessingModel, type); configurePDU(type, pdu); return pdu; }
public void processMessage(TransportMapping<?> sourceTransport, Address incomingAddress, ByteBuffer wholeMessage, TransportStateReference tmStateReference) { MessageTask task = new MessageTask(sourceTransport, incomingAddress, wholeMessage, tmStateReference); threadPool.execute(task); }
public ArgumentParseException(int position, String value, ArgumentFormat parameterFormat, ArgumentParameter parameterFormatDetail) { super((value != null) ? "Invalid value '"+value+"' at position "+position : "Mandatory parameter "+((parameterFormat == null) ? "<unknown>" : parameterFormat.getOption())+"("+ ((parameterFormatDetail == null) ? "<unknown>" : parameterFormatDetail.getName())+") not specified", position); this.parameterFormat = parameterFormat; this.parameterFormatDetail = parameterFormatDetail; this.value = value; }
public Integer getMaxRepetitions() { Integer maxRep = (Integer) ArgumentParser.getValue(settings, oMaxRepetitions, 0); return maxRep; }
public void terminate() { stop = true; WorkerTask t; if ((t = task) != null) { t.terminate(); } }
/** * Creates an argument parser with the specified option and parameter formats. * @param optionFormat * the option format pattern to parse (see {@link ArgumentParser}). * @param parameterFormat * the parameter format pattern to parse (see {@link ArgumentParser}). */ public ArgumentParser(String optionFormat, String parameterFormat) { this.optionFormat = parseFormat(optionFormat, false); this.parameterFormat = parseFormat(parameterFormat, true); }
public PDU createPDU(Target target) { int type = getPduType(); PDU pdu = DefaultPDUFactory.createPDU(target, type); configurePDU(type, pdu); return pdu; }
/** * Perform a SNMP walk and returns the list of {@link TreeEvent} * @return the list of {@link TreeEvent} */ public List<TreeEvent> walk() { TreeUtils treeUtils = new TreeUtils(this.snmp, new DefaultPDUFactory()); @SuppressWarnings("unchecked") List<TreeEvent> events = treeUtils.getSubtree(this.target, this.oid); return events; }
public void processMessage(TransportMapping sourceTransport, Address incomingAddress, ByteBuffer wholeMessage, TransportStateReference tmStateReference) { MessageTask task = new MessageTask(sourceTransport, incomingAddress, wholeMessage, tmStateReference); threadPool.execute(task); }
public ArgumentParseException(int position, String value, ArgumentFormat parameterFormat, ArgumentParameter parameterFormatDetail) { super((value != null) ? "Invalid value '"+value+"' at position "+position : "Mandatory parameter "+parameterFormat.getOption()+"("+ parameterFormatDetail.getName()+") not specified", position); this.parameterFormat = parameterFormat; this.parameterFormatDetail = parameterFormatDetail; this.value = value; }
if((events != null) && !events.isEmpty() && (events.get(0).getVariableBindings() != null)) { FlowFile flowFile = processSession.create(); for (TreeEvent treeEvent : events) {
public void close() { stop = true; WorkerTask st = server; if (st != null) { st.terminate(); } }
@Override public PDU createPDU(MessageProcessingModel messageProcessingModel) { int type = getPduType(); PDU pdu = DefaultPDUFactory.createPDU(messageProcessingModel, type); configurePDU(type, pdu); return pdu; }
public void processMessage(TransportMapping sourceTransport, Address incomingAddress, BERInputStream wholeMessage) { // OK, here wo do all that what this class is all about! MessageTask task = new MessageTask(sourceTransport, incomingAddress, wholeMessage); threadPool.execute(task); }
public ArgumentParseException(int position, String value, ArgumentFormat parameterFormat, ArgumentParameter parameterFormatDetail) { super((value != null) ? "Invalid value '" + value + "' at position " + position : "Mandatory parameter " + ((parameterFormat == null) ? "<unknown>" : parameterFormat.getOption()) + "(" + ((parameterFormatDetail == null) ? "<unknown>" : parameterFormatDetail.getName()) + ") not specified", position); this.parameterFormat = parameterFormat; this.parameterFormatDetail = parameterFormatDetail; this.value = value; }
public void terminate() { stop = true; WorkerTask t; if ((t = task) != null) { t.terminate(); } }
public PDU createPDU(Target target) { int type = getPduType(); PDU pdu = DefaultPDUFactory.createPDU(target, type); configurePDU(type, pdu); return pdu; }