@Override public String getAsString() { return attribute.getValue(); }
if ((valueBytes.length > 0) && (valueBytes[valueBytes.length-1] == 0x00)) final String fullValue = changesAttr.getValue(); final String realValue = fullValue.substring(0, fullValue.length()-2); tokenizer = new StringTokenizer(realValue, "\r\n"); tokenizer = new StringTokenizer(changesAttr.getValue(), "\r\n");
putMember(out, key, a.getValue(), langTag, dir.ldapValueMatchingPattern()); jsonString = attrList.get(0).getValue(); String genTimeStr = attrList.get(0).getValue(); Long timeStamp = StaticUtils.decodeGeneralizedTime(genTimeStr).getTime() / 1000; putMember(out, key, timeStamp, null, dir.ldapValueMatchingPattern()); putMember(out, key, JSONValue.parse(attrList.get(0).getValue()), null, null);
@Override public String getAsString() { return attribute.getValue(); }
new StringTokenizer(deletedEntryAttrs.getValue(), "\r\n"); while (tokenizer.hasMoreTokens())
@Nullable private String getAttribute(@NotNull SearchResultEntry entry, @NotNull String name) { Attribute attribute = entry.getAttribute(name); return attribute == null ? null : attribute.getValue(); }
/** * Retrieves the value for the specified attribute, if available. If the * attribute has more than one value, then the first value will be returned. * * @param attributeName The name of the attribute for which to retrieve the * value. It must not be {@code null}. * * @return The value for the specified attribute, or {@code null} if that * attribute is not available. */ public String getAttributeValue(final String attributeName) { ensureNotNull(attributeName); final Attribute a = attributes.get(toLowerCase(attributeName)); if (a == null) { return null; } else { return a.getValue(); } }
/** * Retrieves the value for the specified attribute, if available. If the * attribute has more than one value, then the first value will be returned. * * @param attributeName The name of the attribute for which to retrieve the * value. It must not be {@code null}. * * @return The value for the specified attribute, or {@code null} if that * attribute is not available. */ public String getAttributeValue(final String attributeName) { ensureNotNull(attributeName); final Attribute a = attributes.get(toLowerCase(attributeName)); if (a == null) { return null; } else { return a.getValue(); } }
final String name = a.getValue(); final long count = entry.getAttributeValueAsLong( prefix + intValue + "-count");
private void setAccountRoles(LDAPConnection ldapConnection, SearchResultEntry accountSearchResult, Account account) { String accountDN = accountSearchResult.getDN(); String groupMemberPattern = this.groupMemberPattern.replace("${dn}", escapeLDAPSearchFilter(accountDN)); groupMemberPattern = groupMemberPattern.replace("${username}", escapeLDAPSearchFilter(account.getUsername())); // Fill in attributes into groupMemberPattern for (Attribute attribute : accountSearchResult.getAttributes()) { groupMemberPattern = groupMemberPattern.replace("${" + attribute.getName() + "}", escapeLDAPSearchFilter(attribute.getValue())); } SearchResult groupsSearchResult = doSearch(ldapConnection, groupBase, true, groupMemberPattern, Arrays.asList("cn")); if (groupsSearchResult != null && groupsSearchResult.getEntryCount() > 0) { for (int i = 0; i < groupsSearchResult.getEntryCount(); i++) { SearchResultEntry groupEntry = groupsSearchResult.getSearchEntries().get(i); String roleName = groupEntry.getAttribute("cn").getValue(); account.getAuthorizations().addRole(roleName); } } }
private void setAccountRoles(LDAPConnection ldapConnection, SearchResultEntry accountSearchResult, Account account) { String accountDN = accountSearchResult.getDN(); String groupMemberPattern = this.groupMemberPattern.replace("${dn}", escapeLDAPSearchFilter(accountDN)); groupMemberPattern = groupMemberPattern.replace("${username}", escapeLDAPSearchFilter(account.getUsername())); // Fill in attributes into groupMemberPattern for (Attribute attribute : accountSearchResult.getAttributes()) { groupMemberPattern = groupMemberPattern.replace("${" + attribute.getName() + "}", escapeLDAPSearchFilter(attribute.getValue())); } SearchResult groupsSearchResult = doSearch(ldapConnection, groupBase, true, groupMemberPattern, Arrays.asList("cn")); if (groupsSearchResult != null && groupsSearchResult.getEntryCount() > 0) { for (int i = 0; i < groupsSearchResult.getEntryCount(); i++) { SearchResultEntry groupEntry = groupsSearchResult.getSearchEntries().get(i); String roleName = groupEntry.getAttribute("cn").getValue(); account.getAuthorizations().addRole(roleName); } } }
switch (name) { case "sn": userDetails.put("lastName", attribute.getValue()); break; case "givenName": userDetails.put("firstName", attribute.getValue()); break; case "displayName": userDetails.put("userName", attribute.getValue()); break; case "mail": userDetails.put("email", attribute.getValue()); break; case "sAMAccountName": userDetails.put("userId", attribute.getValue().toLowerCase()); break;
new StringTokenizer(changesAttr.getValue(), "\r\n"); while (tokenizer.hasMoreTokens())
String attrValue = unboundidAttribute.getValue(); MessageFormat format = valueMappings.get(logicalAttrName); if (format != null && attrValue != null) {
if (lowerName.startsWith(rcPrefix) && lowerName.endsWith("-name")) final String name = a.getValue(); final int intValue = Integer.parseInt(lowerName.substring( rcPrefix.length(), (lowerName.length() - 5)));
changeNumber = Long.parseLong(changeNumberAttr.getValue()); ERR_CHANGELOG_INVALID_CHANGE_NUMBER.get(changeNumberAttr.getValue()), nfe); ERR_CHANGELOG_NO_TARGET_DN.get()); targetDN = targetDNAttr.getValue(); ERR_CHANGELOG_NO_CHANGE_TYPE.get()); changeType = ChangeType.forName(changeTypeAttr.getValue()); if (changeType == null) ERR_CHANGELOG_INVALID_CHANGE_TYPE.get(changeTypeAttr.getValue())); ERR_CHANGELOG_MISSING_NEW_RDN.get()); newRDN = newRDNAttr.getValue(); ERR_CHANGELOG_MISSING_DELETE_OLD_RDN.get()); final String delOldRDNStr = toLowerCase(deleteOldRDNAttr.getValue()); if (delOldRDNStr.equals("true")) ERR_CHANGELOG_INVALID_CHANGE_TYPE.get(changeTypeAttr.getValue()));