/** * Removes all USM user from the internal user name table with the specified user * name and (optional) engine ID. If the engine ID is not provided (null) * then any user (including localized) are removed that have the specified user name. * * @param userName * a user name. * @param engineID * the authoritative engine ID associated with the user by localization, or * {@code null} if all users with {@code userName} should be * deleted. * * @return the removed {@code UsmUser} instances as a List. If the user could * be found, an empty list is returned. * @since 2.2 */ public List<UsmUser> removeAllUsers(OctetString userName, OctetString engineID) { List<UsmUserEntry> entries = userTable.removeAllUsers(userName, engineID); if (!entries.isEmpty()) { List<UsmUser> users = new ArrayList<UsmUser>(); for (UsmUserEntry entry : entries) { users.add(entry.getUsmUser()); fireUsmUserChange(new UsmUserEvent(this, entry, UsmUserEvent.USER_REMOVED)); } return users; } return Collections.emptyList(); }
/** * Removes all USM user from the internal user name table with the specified user * name and (optional) engine ID. If the engine ID is not provided (null) * then any user (including localized) are removed that have the specified user name. * * @param userName * a user name. * @param engineID * the authoritative engine ID associated with the user by localization, or * {@code null} if all users with {@code userName} should be * deleted. * @return * the removed {@code UsmUser} instances as a List. If the user could * be found, an empty list is returned. * @since * 2.2 */ public List<UsmUser> removeAllUsers(OctetString userName, OctetString engineID) { List<UsmUserEntry> entries = userTable.removeAllUsers(userName, engineID); if (!entries.isEmpty()) { List<UsmUser> users = new ArrayList<UsmUser>(); for (UsmUserEntry entry : entries) { users.add(entry.getUsmUser()); fireUsmUserChange(new UsmUserEvent(this, entry, UsmUserEvent.USER_REMOVED)); } return users; } return Collections.emptyList(); }
public synchronized List<UsmUserEntry> removeAllUsers(OctetString securityName, OctetString engineID) { if (engineID == null) { List<UsmUserEntry> deleted = new ArrayList<UsmUserEntry>(); for (Iterator<UsmUserEntry> usmUserEntryIterator = table.values().iterator(); usmUserEntryIterator.hasNext(); ) { UsmUserEntry usmUserEntry = usmUserEntryIterator.next(); if (securityName.equals(usmUserEntry.getUsmUser().getSecurityName())) { deleted.add(usmUserEntry); usmUserEntryIterator.remove(); if (logger.isDebugEnabled()) { logger.debug("Removed user " + usmUserEntry); } } } return deleted; } UsmUserEntry entry = table.remove(new UsmUserKey(engineID, securityName)); if (logger.isDebugEnabled()) { logger.debug("Removed user with secName=" + securityName + " and engineID=" + engineID); } return (entry != null) ? Collections.singletonList(entry) : Collections.<UsmUserEntry>emptyList(); }
public synchronized UsmUserEntry addUser(UsmUserEntry user) { if (logger.isDebugEnabled()) { logger.debug("Adding user "+user.getUserName()+" = "+user.getUsmUser()); } return table.put(new UsmUserKey(user), user); }
public synchronized List<UsmUserEntry> removeAllUsers(OctetString securityName, OctetString engineID) { if (engineID == null) { List<UsmUserEntry> deleted = new ArrayList<UsmUserEntry>(); for (Iterator<UsmUserEntry> usmUserEntryIterator = table.values().iterator(); usmUserEntryIterator.hasNext(); ) { UsmUserEntry usmUserEntry = usmUserEntryIterator.next(); if (securityName.equals(usmUserEntry.getUsmUser().getSecurityName())) { deleted.add(usmUserEntry); usmUserEntryIterator.remove(); if (logger.isDebugEnabled()) { logger.debug("Removed user "+usmUserEntry); } } } return deleted; } UsmUserEntry entry = table.remove(new UsmUserKey(engineID, securityName)); if (logger.isDebugEnabled()) { logger.debug("Removed user with secName="+securityName+ " and engineID="+engineID); } return (entry != null) ? Collections.singletonList(entry) : Collections.<UsmUserEntry>emptyList(); }
public synchronized UsmUserEntry addUser(UsmUserEntry user) { if (logger.isDebugEnabled()) { logger.debug("Adding user " + user.getUserName() + " = " + user.getUsmUser()); } return table.put(new UsmUserKey(user), user); }
public synchronized UsmUserEntry addUser(UsmUserEntry user) { if (logger.isDebugEnabled()) { logger.debug("Adding user "+user.getUserName()+" = "+user.getUsmUser()); } return (UsmUserEntry) table.put(new UsmUserKey(user), user); }
public UsmUserKey(UsmUserEntry entry) { setEngineID(entry.getEngineID()); this.securityName = entry.getUsmUser().getSecurityName(); }
public UsmUserKey(UsmUserEntry entry) { setEngineID(entry.getEngineID()); this.securityName = entry.getUsmUser().getSecurityName(); }
public UsmUserKey(UsmUserEntry entry) { setEngineID(entry.getEngineID()); this.securityName = entry.getUsmUser().getSecurityName(); }
protected UsmUserEntry addLocalizedUsmUserEntry(OctetString engineID, OctetString securityName, UsmUserEntry entry) { OID authProtocolOID = entry.getUsmUser().getAuthenticationProtocol(); OID privProtocolOID = entry.getUsmUser().getPrivacyProtocol(); if (authProtocolOID != null) { byte[] authKey; if (entry.getUsmUser().isLocalized()) { authKey = entry.getUsmUser().getAuthenticationPassphrase().getValue(); } else { authKey = securityProtocols.passwordToKey(authProtocolOID, entry.getUsmUser().getAuthenticationPassphrase(), engineID.getValue()); } byte[] privKey = null; if (privProtocolOID != null) { if (entry.getUsmUser().isLocalized()) { privKey = entry.getUsmUser().getPrivacyPassphrase().getValue(); } else { privKey = securityProtocols.passwordToKey(privProtocolOID, authProtocolOID, entry.getUsmUser().getPrivacyPassphrase(), engineID.getValue()); } } entry = addLocalizedUser(engineID.getValue(), securityName, authProtocolOID, authKey, privProtocolOID, privKey); } return entry; }
/** * Removes an USM user from the internal user name table. * * @param engineID * the authoritative engine ID associated with the user, or * {@code null} * @param userName * a user name. * * @return the removed {@code UsmUser} instance associate with the given * {@code userName} or {@code null} if such a user could not * be found. * @deprecated If the engineID {@code null} is provided this method does only * delete the generic user. All already localized users will not be deleted. * To delete those users too, use {@link #removeAllUsers(OctetString, OctetString)} instead. */ @Deprecated public UsmUser removeUser(OctetString engineID, OctetString userName) { UsmUserEntry entry = userTable.removeUser(engineID, userName); if (entry != null) { fireUsmUserChange(new UsmUserEvent(this, entry, UsmUserEvent.USER_REMOVED)); return entry.getUsmUser(); } return null; }
private OctetString getSecurityName(OctetString engineID, OctetString userName) { if (userName.length() == 0) { return userName; } UsmUserEntry user = userTable.getUser(engineID, userName); if (user != null) { return user.getUsmUser().getSecurityName(); } else if (isEngineDiscoveryEnabled()) { user = userTable.getUser(userName); if (user != null) { return user.getUsmUser().getSecurityName(); } } return null; }
private OctetString getSecurityName(OctetString engineID, OctetString userName) { if (userName.length() == 0) { return userName; } UsmUserEntry user = userTable.getUser(engineID, userName); if (user != null) { return user.getUsmUser().getSecurityName(); } else if (isEngineDiscoveryEnabled()) { user = userTable.getUser(userName); if (user != null) { return user.getUsmUser().getSecurityName(); } } return null; }
private OctetString getSecurityName(OctetString engineID, OctetString userName) { if (userName.length() == 0) { return userName; } UsmUserEntry user = userTable.getUser(engineID, userName); if (user != null) { return user.getUsmUser().getSecurityName(); } else if (isEngineDiscoveryEnabled()) { user = userTable.getUser(userName); if (user != null) { return user.getUsmUser().getSecurityName(); } } return null; }
private Variable[] getValuesFromUsmUser(UsmUserEntry user) { Variable[] row = new Variable[usmUserEntry.getColumnCount()+5]; int n = 0; row[n++] = user.getUsmUser().getSecurityName(); row[n++] = null; row[n++] = user.getUsmUser().getAuthenticationProtocol(); row[n++] = null; row[n++] = null; row[n++] = user.getUsmUser().getPrivacyProtocol(); row[n++] = null; row[n++] = null; row[n++] = new OctetString(); row[n++] = new Integer32(StorageType.nonVolatile); row[n++] = new Integer32(RowStatus.active); row[n++] = user.getUsmUser().getAuthenticationPassphrase(); row[n++] = user.getUsmUser().getPrivacyPassphrase(); row[n++] = user.getUsmUser().getLocalizationEngineID(); row[n++] = (user.getAuthenticationKey() == null) ? null : new OctetString(user.getAuthenticationKey()); row[n++] = (user.getPrivacyKey() == null) ? null : new OctetString(user.getPrivacyKey()); return row; }
/** * Removes an USM user from the internal user name table. * @param engineID * the authoritative engine ID associated with the user, or * <code>null</code> * @param userName * a user name. * @return * the removed <code>UsmUser</code> instance associate with the given * <code>userName</code> or <code>null</code> if such a user could not * be found. */ public UsmUser removeUser(OctetString engineID, OctetString userName) { UsmUserEntry entry = userTable.removeUser(engineID, userName); if (entry != null) { fireUsmUserChange(new UsmUserEvent(this, entry, UsmUserEvent.USER_REMOVED)); return entry.getUsmUser(); } return null; }
private Variable[] getValuesFromUsmUser(UsmUserEntry user) { Variable[] row = new Variable[usmUserEntry.getColumnCount()+5]; int n = 0; row[n++] = user.getUsmUser().getSecurityName(); row[n++] = null; row[n++] = user.getUsmUser().getAuthenticationProtocol(); row[n++] = null; row[n++] = null; row[n++] = user.getUsmUser().getPrivacyProtocol(); row[n++] = null; row[n++] = null; row[n++] = new OctetString(); row[n++] = new Integer32(user.getStorageType().getSmiValue()); row[n++] = new Integer32(RowStatus.active); row[n++] = user.getUsmUser().getAuthenticationPassphrase(); row[n++] = user.getUsmUser().getPrivacyPassphrase(); row[n++] = user.getUsmUser().getLocalizationEngineID(); row[n++] = (user.getAuthenticationKey() == null) ? null : new OctetString(user.getAuthenticationKey()); row[n ] = (user.getPrivacyKey() == null) ? null : new OctetString(user.getPrivacyKey()); return row; }
/** * Removes an USM user from the internal user name table. * @param engineID * the authoritative engine ID associated with the user, or * {@code null} * @param userName * a user name. * @return * the removed {@code UsmUser} instance associate with the given * {@code userName} or {@code null} if such a user could not * be found. * @deprecated * If the engineID {@code null} is provided this method does only * delete the generic user. All already localized users will not be deleted. * To delete those users too, use {@link #removeAllUsers()} instead. */ public UsmUser removeUser(OctetString engineID, OctetString userName) { UsmUserEntry entry = userTable.removeUser(engineID, userName); if (entry != null) { fireUsmUserChange(new UsmUserEvent(this, entry, UsmUserEvent.USER_REMOVED)); return entry.getUsmUser(); } return null; }
case colUsmUserAuthPassword: setValue(column, userEntry.getUsmUser().getAuthenticationPassphrase()); break; case colUsmUserPrivPassword: setValue(column, userEntry.getUsmUser().getPrivacyPassphrase()); break; case colUsmUserLocalizationEngineID: setValue(column, (userEntry.getUsmUser().isLocalized()) ? userEntry.getUsmUser().getLocalizationEngineID() : null); break; case colUsmUserAuthKey: {