public class AgentXCommandProcessor extends org.snmp4j.agent.CommandProcessor implements AgentXCommandListener, org.snmp4j.transport.TransportStateListener, AgentXResponseListener
AgentXCommandProcessor implements the CommandProcessor
interface for AgentX command processing of an AgentX master agent.
It holds the AgentX sessions and region registrations internally.
The context engine ID of the master agent, the AgentXQueue,
the AgentX protocol adapter, and the MOServers have
to be provided for instance creation.| Modifier and Type | Class and Description |
|---|---|
protected static class |
AgentXCommandProcessor.AgentXRegEntryComparator |
| Modifier and Type | Field and Description |
|---|---|
protected AgentXIndexRegistry |
indexRegistry |
static int |
MAX_REPROCESSING_DEFAULT |
| Constructor and Description |
|---|
AgentXCommandProcessor(org.snmp4j.smi.OctetString contextEngineID,
AgentXQueue queue,
AgentX agentX,
org.snmp4j.agent.MOServer[] server) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
acceptSession(AgentXMasterSession session) |
AgentXResponsePDU |
addAgentCaps(AgentXAddAgentCapsPDU pdu,
AgentXMasterSession session) |
void |
addAgentXMasterListener(AgentXMasterListener l) |
protected void |
addPeer(AgentXPeer peer) |
protected void |
addRegion(AgentXRegEntry registration,
AgentXRegion region) |
protected void |
addRegistration(AgentXRegEntry registration) |
protected void |
addSession(AgentXMasterSession session) |
protected AgentXPeer |
closePeer(org.snmp4j.smi.Address peerAddress,
byte reason) |
AgentXResponsePDU |
closeSession(AgentXClosePDU pdu,
AgentXMasterSession session) |
void |
closeSession(AgentXMasterSession session,
byte reason) |
void |
connectionStateChanged(org.snmp4j.transport.TransportStateEvent change) |
protected AgentXResponsePDU |
createResponse(AgentXPDU request,
AgentXSession session) |
protected void |
finalizeRequest(org.snmp4j.CommandResponderEvent command,
org.snmp4j.agent.request.SnmpRequest req,
org.snmp4j.agent.MOServer server) |
protected void |
fireMasterChanged(AgentXMasterEvent event) |
protected org.snmp4j.agent.mo.snmp.AgentCapabilityList |
getAgentCaps(org.snmp4j.smi.OctetString contextName) |
byte |
getAgentXVersion() |
protected org.snmp4j.smi.TimeTicks |
getContextSysUpTime(org.snmp4j.smi.OctetString context) |
byte |
getDefaultTimeout() |
int |
getMaxConsecutiveTimeouts()
Gets the maximum number of consecutive timeouts allowed per session.
|
int |
getMaxParseErrors()
Gets the upper limit for parse errors for an AgentX peer.
|
int |
getMaxReprocessing() |
protected int |
getNextSessionID() |
protected AgentXPeer |
getPeer(org.snmp4j.smi.Address address) |
org.snmp4j.agent.MOServer |
getServer()
Deprecated.
Use
CommandProcessor.getServer(OctetString context) instead. |
protected AgentXMasterSession |
getSession(AgentXPDU pdu) |
protected AgentXMasterSession |
getSession(int sessionID) |
AgentXResponsePDU |
indexAllocate(AgentXIndexAllocatePDU pdu,
AgentXMasterSession session) |
AgentXResponsePDU |
indexDeallocate(AgentXIndexDeallocatePDU pdu,
AgentXMasterSession session) |
boolean |
isAcceptNewContexts()
Indicates whether subagents can register contexts that are not yet
supported by this master agent.
|
protected boolean |
isDuplicate(AgentXRegEntry registration) |
protected AgentXResponsePDU |
notify(AgentXNotifyPDU pdu,
AgentXMasterSession session) |
void |
onResponse(AgentXResponseEvent event)
Process an AgentX response.
|
AgentXResponsePDU |
openSession(AgentXOpenPDU pdu,
AgentXCommandEvent event) |
protected AgentXResponsePDU |
ping(AgentXPingPDU pdu,
AgentXMasterSession session) |
protected void |
processAgentXBulkResponse(AgentXPending pending,
AgentXResponsePDU pdu) |
protected void |
processAgentXGetNextResponse(AgentXPending pending,
AgentXResponsePDU pdu) |
protected void |
processAgentXGetResponse(AgentXPending pending,
AgentXResponsePDU pdu) |
protected void |
processAgentXSearchResponse(AgentXPending pending,
AgentXResponsePDU pdu) |
protected void |
processAgentXSetResponse(AgentXPending pending,
AgentXResponsePDU pdu) |
void |
processCommand(AgentXCommandEvent event) |
protected static void |
processsErrorResponse(AgentXPending pending,
AgentXResponsePDU pdu) |
protected AgentXResponsePDU |
register(AgentXRegisterPDU pdu,
AgentXCommandEvent command,
AgentXMasterSession session) |
AgentXResponsePDU |
removeAgentCaps(AgentXRemoveAgentCapsPDU pdu,
AgentXMasterSession session) |
void |
removeAgentXMasterListener(AgentXMasterListener l) |
protected void |
removeAllRegistrations(AgentXMasterSession session) |
protected AgentXPeer |
removePeer(org.snmp4j.smi.Address peerAddress) |
protected boolean |
removeRegistration(AgentXRegEntry registration,
Iterator<AgentXRegEntry> regIterator) |
protected AgentXMasterSession |
removeSession(int sessionID) |
protected void |
sendResponse(AgentXPDU response,
AgentXSession session) |
void |
setAcceptNewContexts(boolean acceptNewContexts)
Enables or disables accepting new contexts from subagents.
|
void |
setDefaultTimeout(byte defaultTimeout) |
void |
setMaxConsecutiveTimeouts(int maxConsecutiveTimeouts)
Sets the maximum number of timeouts allowed per session.
|
void |
setMaxParseErrors(int maxParseErrors)
Sets the maximum number of parse errors allowed per peer.
|
void |
setMaxReprocessing(int maxReprocessing) |
protected AgentXResponsePDU |
unregister(AgentXUnregisterPDU pdu,
AgentXCommandEvent event,
AgentXMasterSession session) |
addCounterListener, addMOServer, addPduHandler, addProxyForwarder, dispatchCommand, fireIncrementCounter, getCoexistenceProvider, getContextEngineID, getHandler, getInternalRequestTimeout, getNotificationOriginator, getProxyForwarder, getRequestList, getServer, getVacm, getViewName, notify, notify, processNextSubRequest, processPdu, processRequest, processRequest, release, removeCounterListener, removeMOServer, removePduHandler, removeProxyForwarder, reprocessRequest, sendResponse, setAuthorizationError, setCoexistenceProvider, setContextEngineID, setInternalRequestTimeout, setNotificationOriginator, setThreadPool, setVacm, setWorkerPool, unlockManagedObjectIfLockedByLookuppublic static final int MAX_REPROCESSING_DEFAULT
protected AgentXIndexRegistry indexRegistry
public AgentXCommandProcessor(org.snmp4j.smi.OctetString contextEngineID,
AgentXQueue queue,
AgentX agentX,
org.snmp4j.agent.MOServer[] server)
public void setMaxReprocessing(int maxReprocessing)
public int getMaxReprocessing()
public void setMaxParseErrors(int maxParseErrors)
AgentXProtocol.REASON_PARSE_ERROR.maxParseErrors - a positive value (including zero) sets the upper limit of parse errors
tolerated per peer. If the number of parse errors exceeds this limit,
all sessions with that peer will be closed. A negative value deactivates
any limit.public int getMaxParseErrors()
protected void finalizeRequest(org.snmp4j.CommandResponderEvent command,
org.snmp4j.agent.request.SnmpRequest req,
org.snmp4j.agent.MOServer server)
finalizeRequest in class org.snmp4j.agent.CommandProcessorprotected int getNextSessionID()
public org.snmp4j.agent.MOServer getServer()
CommandProcessor.getServer(OctetString context) instead.null context).public byte getDefaultTimeout()
public int getMaxConsecutiveTimeouts()
public boolean isAcceptNewContexts()
true if subagents can register objects for new contexts.public void setDefaultTimeout(byte defaultTimeout)
public void setMaxConsecutiveTimeouts(int maxConsecutiveTimeouts)
AgentXProtocol.REASON_TIMEOUTS.maxConsecutiveTimeouts - the maximum number of timeouts (should be greater than zero).public void setAcceptNewContexts(boolean acceptNewContexts)
acceptNewContexts - true if subagents are allowed to register objects for new
contexts, false otherwise. Default is false.public void processCommand(AgentXCommandEvent event)
processCommand in interface AgentXCommandListenerpublic AgentXResponsePDU indexDeallocate(AgentXIndexDeallocatePDU pdu, AgentXMasterSession session)
public AgentXResponsePDU indexAllocate(AgentXIndexAllocatePDU pdu, AgentXMasterSession session)
protected void processAgentXSearchResponse(AgentXPending pending, AgentXResponsePDU pdu)
protected void processAgentXBulkResponse(AgentXPending pending, AgentXResponsePDU pdu)
protected static void processsErrorResponse(AgentXPending pending, AgentXResponsePDU pdu) throws NoSuchElementException
NoSuchElementExceptionprotected AgentXResponsePDU ping(AgentXPingPDU pdu, AgentXMasterSession session)
protected AgentXResponsePDU notify(AgentXNotifyPDU pdu, AgentXMasterSession session)
protected org.snmp4j.smi.TimeTicks getContextSysUpTime(org.snmp4j.smi.OctetString context)
public AgentXResponsePDU addAgentCaps(AgentXAddAgentCapsPDU pdu, AgentXMasterSession session)
protected org.snmp4j.agent.mo.snmp.AgentCapabilityList getAgentCaps(org.snmp4j.smi.OctetString contextName)
public AgentXResponsePDU removeAgentCaps(AgentXRemoveAgentCapsPDU pdu, AgentXMasterSession session)
public AgentXResponsePDU closeSession(AgentXClosePDU pdu, AgentXMasterSession session)
public void closeSession(AgentXMasterSession session, byte reason)
protected void removeAllRegistrations(AgentXMasterSession session)
protected AgentXMasterSession getSession(int sessionID)
protected AgentXMasterSession getSession(AgentXPDU pdu)
protected AgentXResponsePDU register(AgentXRegisterPDU pdu, AgentXCommandEvent command, AgentXMasterSession session)
protected AgentXResponsePDU unregister(AgentXUnregisterPDU pdu, AgentXCommandEvent event, AgentXMasterSession session)
protected boolean isDuplicate(AgentXRegEntry registration)
protected void addRegistration(AgentXRegEntry registration) throws org.snmp4j.agent.DuplicateRegistrationException
org.snmp4j.agent.DuplicateRegistrationExceptionprotected void addRegion(AgentXRegEntry registration, AgentXRegion region) throws org.snmp4j.agent.DuplicateRegistrationException
org.snmp4j.agent.DuplicateRegistrationExceptionprotected boolean removeRegistration(AgentXRegEntry registration, Iterator<AgentXRegEntry> regIterator)
public AgentXResponsePDU openSession(AgentXOpenPDU pdu, AgentXCommandEvent event)
protected void addPeer(AgentXPeer peer)
protected AgentXPeer getPeer(org.snmp4j.smi.Address address)
protected int acceptSession(AgentXMasterSession session)
protected void addSession(AgentXMasterSession session)
protected AgentXMasterSession removeSession(int sessionID)
protected AgentXResponsePDU createResponse(AgentXPDU request, AgentXSession session)
protected void sendResponse(AgentXPDU response, AgentXSession session)
public void connectionStateChanged(org.snmp4j.transport.TransportStateEvent change)
connectionStateChanged in interface org.snmp4j.transport.TransportStateListenerprotected AgentXPeer removePeer(org.snmp4j.smi.Address peerAddress)
protected AgentXPeer closePeer(org.snmp4j.smi.Address peerAddress, byte reason)
public byte getAgentXVersion()
public void addAgentXMasterListener(AgentXMasterListener l)
public void removeAgentXMasterListener(AgentXMasterListener l)
protected void fireMasterChanged(AgentXMasterEvent event)
public void onResponse(AgentXResponseEvent event)
AgentXResponseListeneronResponse in interface AgentXResponseListenerevent - a AgentXResponseEvent.protected void processAgentXGetResponse(AgentXPending pending, AgentXResponsePDU pdu)
protected void processAgentXGetNextResponse(AgentXPending pending, AgentXResponsePDU pdu)
protected void processAgentXSetResponse(AgentXPending pending, AgentXResponsePDU pdu)
Copyright © 2020 SNMP4J.org. All rights reserved.