/** * Adds an engine ID (other than the local engine ID) to the internal storage. * @param address * the {@link Address} of the remote SNMP engine. * @param engineID * the engine ID of the remote SNMP engine. * @return * {@code true} if the engine ID has been added, <code>false</code> * otherwise (if the supplied {@code engineID} equals the local one). */ public boolean addEngineID(Address address, OctetString engineID) { if (!Arrays.equals(this.localEngineID, engineID.getValue())) { try { OctetString previousEngineID = addEngineIdToCache(address, engineID); if ((snmpEngineListeners != null) && ((previousEngineID == null) || (!previousEngineID.equals(engineID)))) { fireEngineChanged(new SnmpEngineEvent(this, SnmpEngineEvent.ADDED_ENGINE_ID, engineID, address)); } } catch (IllegalArgumentException iaex) { fireEngineChanged(new SnmpEngineEvent(this, SnmpEngineEvent.IGNORED_ENGINE_ID, engineID, address)); return false; } return true; } return false; }
/** * Adds an engine ID (other than the local engine ID) to the internal storage. * @param address * the {@link Address} of the remote SNMP engine. * @param engineID * the engine ID of the remote SNMP engine. * @return * {@code true} if the engine ID has been added, <code>false</code> * otherwise (if the supplied {@code engineID} equals the local one). */ public boolean addEngineID(Address address, OctetString engineID) { if (!Arrays.equals(this.localEngineID, engineID.getValue())) { try { OctetString previousEngineID = addEngineIdToCache(address, engineID); if ((snmpEngineListeners != null) && ((previousEngineID == null) || (!previousEngineID.equals(engineID)))) { fireEngineChanged(new SnmpEngineEvent(this, SnmpEngineEvent.ADDED_ENGINE_ID, engineID, address)); } } catch (IllegalArgumentException iaex) { fireEngineChanged(new SnmpEngineEvent(this, SnmpEngineEvent.IGNORED_ENGINE_ID, engineID, address)); return false; } return true; } return false; }