Package org.snmp4j.agent.agentx

Examples of org.snmp4j.agent.agentx.AgentXPDU


  public boolean isBulkRequest() {
    return requestEvent.getCommand().getType() == AgentXPDU.AGENTX_GETBULK_PDU;
  }

  private void correctRequestValues() {
    AgentXPDU request = requestEvent.getCommand();
    if (request instanceof AgentXGetBulkPDU) {
      repeaterStartIndex = getNonRepeaters();
      repeaterRowSize =
          Math.max(size() - repeaterStartIndex, 0);
    }
View Full Code Here


      this.cursor = offset;
      this.increment = increment;
    }

    private int getRepeaterCount() {
      AgentXPDU pdu = requestEvent.getCommand();
      if (pdu instanceof AgentXGetBulkPDU) {
        AgentXGetBulkPDU bulkPDU = (AgentXGetBulkPDU)pdu;
        return Math.max(bulkPDU.size() - bulkPDU.getNonRepeaters(), 0);
      }
      return 0;
View Full Code Here

      }
      return 0;
    }

    public boolean hasNext() {
      AgentXPDU reqPDU = requestEvent.getCommand();
      if (reqPDU.getType() == AgentXPDU.AGENTX_GETBULK_PDU) {
        AgentXGetBulkPDU bulkPDU = (AgentXGetBulkPDU)reqPDU;
        if (cursor < Math.min(bulkPDU.size(), bulkPDU.getNonRepeaters())) {
          return true;
        }
        else {
View Full Code Here

  public void processMessage(TransportMapping sourceTransport,
                             Address incomingAddress,
                             ByteBuffer wholeMessage) {
    try {
      AgentXPDU pdu = AgentXPDU.decode(wholeMessage);
      AgentXCommandEvent event =
          new AgentXCommandEvent(this, this,
                                 incomingAddress, sourceTransport, pdu);
      fireCommandEvent(event);
    }
View Full Code Here

    }
    return requestPDU;
  }

  private void createRequestPDU() {
    AgentXPDU reqPDU = null;
    SnmpRequest request = (SnmpRequest)
        ((AgentXSetVB)vbs.get(0)).getReferenceSubRequest().getRequest();
    switch (request.getPhase()) {
      case Request.PHASE_INIT:
      case Request.PHASE_1PC:
      case Request.PHASE_2PC_PREPARE: {
        reqPDU =
            new AgentXTestSetPDU(request.getContext(), (VariableBinding[])
                                 vbs.toArray(new VariableBinding[vbs.size()]));
        break;
      }
      case Request.PHASE_2PC_COMMIT: {
        reqPDU = new AgentXCommitSetPDU();
        break;
      }
      case Request.PHASE_2PC_CLEANUP: {
        reqPDU = new AgentXCleanupSetPDU();
        break;
      }
      default: {
        reqPDU = new AgentXUndoSetPDU();
        break;
      }
    }
    reqPDU.setSessionID(session.getSessionID());
    reqPDU.setTransactionID(request.getTransactionID());
    this.requestPDU = reqPDU;
  }
View Full Code Here

TOP

Related Classes of org.snmp4j.agent.agentx.AgentXPDU

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.