
uk.co.westhawk.snmp.stack.ReportPdu Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snmp Show documentation
Show all versions of snmp Show documentation
SNMP Client Library for Java
The newest version!
// NAME
// $RCSfile: ReportPdu.java,v $
// DESCRIPTION
// [given below in javadoc format]
// DELTA
// $Revision: 3.3 $
// CREATED
// $Date: 2006/01/17 17:59:34 $
// COPYRIGHT
// Westhawk Ltd
// TO DO
//
/*
* Copyright (C) 2005 - 2006 by Westhawk Ltd
* www.westhawk.co.uk
*
* Permission to use, copy, modify, and distribute this software
* for any purpose and without fee is hereby granted, provided
* that the above copyright notices appear in all copies and that
* both the copyright notice and this permission notice appear in
* supporting documentation.
* This software is provided "as is" without express or implied
* warranty.
* author Tim Panton
*/
package uk.co.westhawk.snmp.stack;
/*-
* ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
* SNMP Java Client
* ჻჻჻჻჻჻
* Copyright 2023 Sentry Software, Westhawk
* ჻჻჻჻჻჻
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
*/
/**
* This class represents the ASN SNMP Report PDU object.
* This class is used when requests are received that try to discover our
* SNMPv3 timeliness. This will only be the case then the stack acts as
* authoritative engine.
*
*
* Reports are not used (as far as we know) in normal
* manager - agent (authoritative - non authoritative) communication.
* Hence the reason why this stack does not support them in any other
* way.
*
*
* @since 4_14
* @author Birgit Arkesteijn
* @version $Revision: 3.3 $ $Date: 2006/01/17 17:59:34 $
*/
public class ReportPdu extends Pdu
{
private static final String version_id =
"@(#)$Id: ReportPdu.java,v 3.3 2006/01/17 17:59:34 birgit Exp $ Copyright Westhawk Ltd";
/**
* Constructor.
* The requestPdu is used to copy the necessary IDs to this PDU.
*
* @param con The context of the PDU
* @param requestPdu The original Request PDU
*/
public ReportPdu(SnmpContextBasisFace con, Pdu requestPdu)
{
super(con);
setMsgType(AsnObject.GET_RPRT_MSG);
req_id = requestPdu.req_id;
snmpv3MsgId = requestPdu.snmpv3MsgId;
}
/**
* Sets the error status of this PDU. This indicates that an exception
* has occurred while processing the original request.
*
* @see SnmpConstants#SNMP_ERR_NOERROR
* @see SnmpConstants#SNMP_ERR_TOOBIG
* @see SnmpConstants#SNMP_ERR_NOSUCHNAME
* @see SnmpConstants#SNMP_ERR_BADVALUE
* @see SnmpConstants#SNMP_ERR_READONLY
* @see SnmpConstants#SNMP_ERR_GENERR
* @see SnmpConstants#SNMP_ERR_NOACCESS
* @see SnmpConstants#SNMP_ERR_WRONGTYPE
* @see SnmpConstants#SNMP_ERR_WRONGLENGTH
* @see SnmpConstants#SNMP_ERR_WRONGENCODING
* @see SnmpConstants#SNMP_ERR_WRONGVALUE
* @see SnmpConstants#SNMP_ERR_NOCREATION
* @see SnmpConstants#SNMP_ERR_INCONSISTENTVALUE
* @see SnmpConstants#SNMP_ERR_RESOURCEUNAVAILABLE
* @see SnmpConstants#SNMP_ERR_COMMITFAILED
* @see SnmpConstants#SNMP_ERR_UNDOFAILED
* @see SnmpConstants#SNMP_ERR_AUTHORIZATIONERR
* @see SnmpConstants#SNMP_ERR_NOTWRITABLE
* @see SnmpConstants#SNMP_ERR_INCONSISTENTNAME
*/
public void getErrorStatus(int errorStatus)
{
errstat = errorStatus;
}
/**
* Sets the error index of this PDU. When the error status is not
* SNMP_ERR_NOERROR, it indicates the index of the variable in the
* varbind list that caused the exception.
*/
public void getErrorIndex(int errorIndex)
{
errind = errorIndex;
}
/**
* The Report PDU does not get a response back. So it should be sent once.
*/
void transmit()
{
transmit(false);
}
/**
* Returns the string representation of this object.
*
* @return The string of the PDU
*/
public String toString()
{
return super.toString(true);
}
/**
* Has no meaning, since there is not response.
*/
protected void new_value(int n, varbind res){}
/**
* Has no meaning, since there is not response.
*/
protected void tell_them(){}
/**
* Returns that this type of PDU is not expecting a response.
* This method is used in AbstractSnmpContext to help determine whether
* or not to start a thread that listens for a response when sending this
* PDU.
* The default is false.
*
* @return true if a response is expected, false if not.
*/
protected boolean isExpectingResponse()
{
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy