/** * 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; }
/** * Create a <code>PDU</code> instance for the supplied target. * * @param target the <code>Target</code> where the PDU to be created will be * sent. * @return PDU a PDU instance that is compatible with the supplied target. */ public PDU createPDU(Target target) { return createPDU(target, pduType); }
/** * Create a <code>PDU</code> instance for the supplied target. * * @param target the <code>Target</code> where the PDU to be created will be * sent. * @return PDU a PDU instance that is compatible with the supplied target. */ public PDU createPDU(Target target) { PDU pdu = createPDU(target, pduType); applyContextInfoToScopedPDU(pdu); return pdu; }
/** * Creates a <code>PDU</code> instance for the specified {@link MessageProcessingModel}. * @param messageProcessingModel * a message processing model instance. * @return * a PDU that is compatible with the specified message processing model. * @since 2.2 */ @Override public PDU createPDU(MessageProcessingModel messageProcessingModel) { PDU pdu = createPduByMP(messageProcessingModel); applyContextInfoToScopedPDU(pdu); return pdu; }
/** * Creates a PDU factory for the specified PDU type. * @param pduType * a PDU type as specified by {@link PDU}. */ public DefaultPDUFactory(int pduType) { setPduType(pduType); }
/** * Creates a <code>PDU</code> instance for the specified {@link MessageProcessingModel} and PDU type. * @param messageProcessingModel * a message processing model instance. * @param pduType * the type for the new PDU. * @return * a PDU that is compatible with the specified message processing model. * @since 2.2 */ public static PDU createPDU(MessageProcessingModel messageProcessingModel, int pduType) { PDU pdu = createPduByMP(messageProcessingModel); pdu.setType(pduType); return pdu; }
public PDU createPDU ( final Target target, final int pduType ) { return DefaultPDUFactory.createPDU ( target, pduType ); }
/** * Create a <code>PDU</code> instance for the supplied target. * * @param target the <code>Target</code> where the PDU to be created will be * sent. * @return PDU a PDU instance that is compatible with the supplied target. */ public PDU createPDU(Target target) { PDU pdu = createPDU(target, pduType); applyContextInfoToScopedPDU(pdu); return pdu; }
/** * Creates a <code>PDU</code> instance for the specified {@link MessageProcessingModel}. * @param messageProcessingModel * a message processing model instance. * @return * a PDU that is compatible with the specified message processing model. * @since 2.2 */ @Override public PDU createPDU(MessageProcessingModel messageProcessingModel) { PDU pdu = createPduByMP(messageProcessingModel); applyContextInfoToScopedPDU(pdu); return pdu; }
/** * Creates a PDU factory for the specified PDU type. * Context engine ID and name will be set to empty {@link OctetString} * instances. * @param pduType * a PDU type as specified by {@link PDU}. */ public DefaultPDUFactory(int pduType) { setPduType(pduType); this.contextEngineID = new OctetString(); this.contextName = new OctetString(); }
/** * Creates a <code>PDU</code> instance for the specified {@link MessageProcessingModel} and PDU type. * @param messageProcessingModel * a message processing model instance. * @param pduType * the type for the new PDU. * @return * a PDU that is compatible with the specified message processing model. * @since 2.2 */ public static PDU createPDU(MessageProcessingModel messageProcessingModel, int pduType) { PDU pdu = createPduByMP(messageProcessingModel); pdu.setType(pduType); return pdu; }
/** * Create a <code>PDU</code> instance for the supplied target. For GETBULK * PDUs, the default max repetitions and non repeaters are used. See * {@link #GETBULK_DEFAULT_MAX_REPETITIONS} and * {@link #GETBULK_DEFAULT_NON_REPEATERS}. * * @param target the <code>Target</code> where the PDU to be created will be * sent. * @param pduType * a PDU type as specified by {@link PDU}. * @return PDU * a PDU instance that is compatible with the supplied target. */ public static PDU createPDU(Target target, int pduType) { return createPDU(target, pduType, GETBULK_DEFAULT_MAX_REPETITIONS, GETBULK_DEFAULT_NON_REPEATERS); }
/** * 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; }
/** * Creates a PDU factory for the specified PDU type. * Context engine ID and name will be set to empty {@link OctetString} * instances. * @param pduType * a PDU type as specified by {@link PDU}. */ public DefaultPDUFactory(int pduType) { setPduType(pduType); this.contextEngineID = new OctetString(); this.contextName = new OctetString(); }
/** * Create a <code>PDU</code> instance for the supplied target. For GETBULK * PDUs, the default max repetitions and non repeaters are used. See * {@link #GETBULK_DEFAULT_MAX_REPETITIONS} and * {@link #GETBULK_DEFAULT_NON_REPEATERS}. * * @param target the <code>Target</code> where the PDU to be created will be * sent. * @param pduType * a PDU type as specified by {@link PDU}. * @return PDU * a PDU instance that is compatible with the supplied target. */ public static PDU createPDU(Target target, int pduType) { return createPDU(target, pduType, GETBULK_DEFAULT_MAX_REPETITIONS, GETBULK_DEFAULT_NON_REPEATERS); }
/** * <p>Constructor for SnmpManager.</p> * * @param loader a {@link net.percederberg.mibble.MibLoader} object. * @param transportMappingAbstractFactory a {@link net.itransformers.snmp2xml4j.snmptoolkit.transport.TransportMappingAbstractFactory} object. * @param messageDispatcherAbstractFactory a {@link net.itransformers.snmp2xml4j.snmptoolkit.messagedispacher.MessageDispatcherAbstractFactory} object. * @param transportLocalIpAddress a {@link org.snmp4j.smi.TransportIpAddress} object. */ public SnmpManager(MibLoader loader, TransportMappingAbstractFactory transportMappingAbstractFactory, MessageDispatcherAbstractFactory messageDispatcherAbstractFactory, TransportIpAddress transportLocalIpAddress) { this.messageDispatcherFactory = new DefaultMessageDispatcherFactory(); this.transportMappingAbstractFactory = transportMappingAbstractFactory; this.messageDispatcherFactory = messageDispatcherAbstractFactory; this.pduFactory = new DefaultPDUFactory(); this.loader = loader; this.transportLocalIpAddress = transportLocalIpAddress; }
@Override public PDU createPDU(MessageProcessingModel messageProcessingModel) { int type = getPduType(); PDU pdu = DefaultPDUFactory.createPDU(messageProcessingModel, type); configurePDU(type, pdu); return pdu; }
/** * <p>Constructor for SnmpManager.</p> * * @param loader a {@link net.percederberg.mibble.MibLoader} object. * @param retries a int. * @param timeout a int. * @param maxSizeRequestPDU a int. * @param maxRepetitions a int. * @param transportMappingAbstractFactory a {@link net.itransformers.snmp2xml4j.snmptoolkit.transport.TransportMappingAbstractFactory} object. * @param transportLocalIpAddress a {@link org.snmp4j.smi.TransportIpAddress} object. */ public SnmpManager(MibLoader loader, int retries, int timeout, int maxSizeRequestPDU, int maxRepetitions, TransportMappingAbstractFactory transportMappingAbstractFactory, TransportIpAddress transportLocalIpAddress) { this.retries = retries; this.timeout = timeout; this.maxSizeRequestPDU = maxSizeRequestPDU; this.messageDispatcherFactory = new DefaultMessageDispatcherFactory(); this.transportMappingAbstractFactory = transportMappingAbstractFactory; this.pduFactory = new DefaultPDUFactory(); this.transportLocalIpAddress = transportLocalIpAddress; this.maxRepetitions = maxRepetitions; this.loader = loader; } /**
public PDU createPDU(Target target) { int type = getPduType(); PDU pdu = DefaultPDUFactory.createPDU(target, type); configurePDU(type, pdu); return pdu; }
public MOSubtreeProxy(Session session, SnmpTargetMIB targetMIB, OctetString proxyName, OID subtreeOID, OctetString contextEngineID, OctetString contextName, OctetString targetName) { this.session = session; this.targetMIB = targetMIB; this.proxyName = proxyName; this.contextName = contextName; this.scope = new DefaultMOScope(subtreeOID, true, subtreeOID.nextPeer(), false); this.targetName = targetName; this.contextEngineID = contextEngineID; this.pduFactory = new DefaultPDUFactory(PDU.GETNEXT, contextEngineID, contextName); }