public class DefaultPDUFactory extends Object implements PDUFactory
DefaultPDUFactory is a default implementation of the
PDUFactory interface. It creates PDUs depending on the
target's message processing model. That is, a PDUv1 instance is
created for a SNMPv1 target whereas a ScopedPDU is created
for a SNMPv3 target. In all other cases a PDU instance is created.| Constructor and Description |
|---|
DefaultPDUFactory()
Creates a PDU factory for the
PDU.GET PDU type. |
DefaultPDUFactory(int pduType)
Creates a PDU factory for the specified PDU type.
|
| Modifier and Type | Method and Description |
|---|---|
static PDU |
createPDU(int targetVersion)
Create a
PDU instance for the specified SNMP version. |
PDU |
createPDU(Target target)
Create a
PDU instance for the supplied target. |
static PDU |
createPDU(Target target,
int pduType)
Create a
PDU instance for the supplied target. |
int |
getPduType() |
void |
setPduType(int pduType) |
public DefaultPDUFactory()
PDU.GET PDU type.public DefaultPDUFactory(int pduType)
pduType - a PDU type as specified by PDU.public void setPduType(int pduType)
public int getPduType()
public PDU createPDU(Target target)
PDU instance for the supplied target.createPDU in interface PDUFactorytarget - the Target where the PDU to be created will be
sent.public static PDU createPDU(Target target, int pduType)
PDU instance for the supplied target.target - the Target where the PDU to be created will be
sent.pduType - a PDU type as specified by PDU.public static PDU createPDU(int targetVersion)
PDU instance for the specified SNMP version.targetVersion - a SNMP version as defined by SnmpConstants.Copyright © 2014 SNMP4J.org. All rights reserved.