/** * Adds an USM user to the internal user name table. * The user's security name is used as userName. * The storage type member of the supplied by {@link UsmUserEntry#getStorageType()} defines the storage type * of the new USM user table entry. * <p> * Caution: This is a low level call and the provided UsmUserEntry must contain already correctly localized * authentication and privacy keys as well as a correct user engine ID. * * @param usmUserEntry * the {@link UsmUserEntry} to add. * * @since 2.5.7 */ public void addUsmUserEntry(UsmUserEntry usmUserEntry) { userTable.addUser(usmUserEntry); fireUsmUserChange(new UsmUserEvent(this, usmUserEntry, UsmUserEvent.USER_ADDED)); }
/** * Updates the USM user entry with the same engine ID and user name as the * supplied instance and fires an appropriate <code>UsmUserEvent</code>. * If the corresponding user entry does not yet exist then it will be added. * @param entry * an <code>UsmUserEntry</code> instance not necessarily the same as an * already existing entry. * @since 1.2 */ public void updateUser(UsmUserEntry entry) { UsmUserEntry oldEntry = userTable.addUser(entry); fireUsmUserChange(new UsmUserEvent(this, entry, (oldEntry == null) ? UsmUserEvent.USER_ADDED: UsmUserEvent.USER_CHANGED)); }
/** * Adds an USM user to the internal user name table. * The user's security name is used as userName. * The storage type member of the supplied by {@link UsmUserEntry#getStorageType()} defines the storage type * of the new USM user table entry. * * Caution: This is a low level call and the provided UsmUserEntry must contain already correctly localized * authentication and privacy keys as well as a correct user engine ID. * * @param usmUserEntry * the {@link UsmUserEntry} to add. * @since 2.5.7 */ public void addUsmUserEntry(UsmUserEntry usmUserEntry) { userTable.addUser(usmUserEntry); fireUsmUserChange(new UsmUserEvent(this, usmUserEntry, UsmUserEvent.USER_ADDED)); }
/** * Adds a localized user to the USM. * @param engineID * the engine ID for which the user has been localized. * @param userName * the user's name. * @param authProtocol * the authentication protocol ID. * @param authKey * the authentication key. * @param privProtocol * the privacy protocol ID. * @param privKey * the privacy key. * @return * the added <code>UsmUserEntry</code>. */ public UsmUserEntry addLocalizedUser(byte[] engineID, OctetString userName, OID authProtocol, byte[] authKey, OID privProtocol, byte[] privKey) { UsmUserEntry newEntry = new UsmUserEntry(engineID, userName, authProtocol, authKey, privProtocol, privKey); userTable.addUser(newEntry); fireUsmUserChange(new UsmUserEvent(this, newEntry, UsmUserEvent.USER_ADDED)); return newEntry; }
/** * Adds a localized user to the USM. * * @param engineID * the engine ID for which the user has been localized. * @param userName * the user's name. * @param authProtocol * the authentication protocol ID. * @param authKey * the authentication key. * @param privProtocol * the privacy protocol ID. * @param privKey * the privacy key. * * @return the added {@code UsmUserEntry}. */ public UsmUserEntry addLocalizedUser(byte[] engineID, OctetString userName, OID authProtocol, byte[] authKey, OID privProtocol, byte[] privKey) { UsmUserEntry newEntry = new UsmUserEntry(engineID, userName, authProtocol, authKey, privProtocol, privKey); userTable.addUser(newEntry); fireUsmUserChange(new UsmUserEvent(this, newEntry, UsmUserEvent.USER_ADDED)); return newEntry; }
/** * Adds a localized user to the USM. * @param engineID * the engine ID for which the user has been localized. * @param userName * the user's name. * @param authProtocol * the authentication protocol ID. * @param authKey * the authentication key. * @param privProtocol * the privacy protocol ID. * @param privKey * the privacy key. * @return * the added {@code UsmUserEntry}. */ public UsmUserEntry addLocalizedUser(byte[] engineID, OctetString userName, OID authProtocol, byte[] authKey, OID privProtocol, byte[] privKey) { UsmUserEntry newEntry = new UsmUserEntry(engineID, userName, authProtocol, authKey, privProtocol, privKey); userTable.addUser(newEntry); fireUsmUserChange(new UsmUserEvent(this, newEntry, UsmUserEvent.USER_ADDED)); return newEntry; }
/** * Updates the USM user entry with the same engine ID and user name as the * supplied instance and fires an appropriate {@code UsmUserEvent}. * If the corresponding user entry does not yet exist then it will be added. * @param entry * an {@code UsmUserEntry} instance not necessarily the same as an * already existing entry. * @since 1.2 */ public void updateUser(UsmUserEntry entry) { UsmUserEntry oldEntry = userTable.addUser(entry); if (oldEntry != null) { entry.setStorageType(oldEntry.getStorageType()); } fireUsmUserChange(new UsmUserEvent(this, entry, (oldEntry == null) ? UsmUserEvent.USER_ADDED: UsmUserEvent.USER_CHANGED)); }
/** * Updates the USM user entry with the same engine ID and user name as the * supplied instance and fires an appropriate {@code UsmUserEvent}. * If the corresponding user entry does not yet exist then it will be added. * * @param entry * an {@code UsmUserEntry} instance not necessarily the same as an * already existing entry. * * @since 1.2 */ public void updateUser(UsmUserEntry entry) { UsmUserEntry oldEntry = userTable.addUser(entry); if (oldEntry != null) { entry.setStorageType(oldEntry.getStorageType()); } fireUsmUserChange(new UsmUserEvent(this, entry, (oldEntry == null) ? UsmUserEvent.USER_ADDED : UsmUserEvent.USER_CHANGED)); }
entry.setAuthenticationKey(authKey); entry.setPrivacyKey(privKey); userTable.addUser(entry); fireUsmUserChange(new UsmUserEvent(this, entry, UsmUserEvent.USER_ADDED));
privProtocol, privKey)); usmUserEntry.setStorageType(SnmpConstants.StorageTypeEnum.permanent); usm.getUserTable().addUser(usmUserEntry); if (usm.getUserTable().getUser(dhKickstartParameters.getSecurityName()) == null || dhKickstartParameters.isResetRequested()) { usm.getUserTable().addUser(new UsmUserEntry(dhKickstart, new UsmUser(dhKickstart, SnmpConstants.usmNoAuthProtocol, null,