/** * Return a String value, from the given Value, even if it's a binary value * * @param attribute The Attribute to process * @return The Attribute value as a String */ private String getStringValue( Attribute attribute ) { Value value = attribute.get(); return value.getValue(); }
buf.append( attribute.get() );
Value userPassword = entry.get( userPasswordAT ).get(); String strUserPassword = userPassword.getValue();
buf.append( attribute.get() );
/** * {@inheritDoc} */ @Override public Value getRootDseValue( AttributeType attributeType ) { return rootDse.get( attributeType ).get(); }
Value value = fieldAttr.get(); String valueStr = "";
/** * Return a String value, from the given Value, even if it's a binary value * * @param attribute The Attribute to process * @return The Attribute value as a String */ private String getStringValue( Attribute attribute ) { Value value = attribute.get(); return value.getValue(); }
@Override public Map<String, Object> transformSearchResult(SearchCursor cursor) throws IOException { LOG.debug(name); cursor.forEach(response -> { if (response instanceof SearchResultEntry) { Entry resultEntry = ((SearchResultEntry) response).getEntry(); String dn = resultEntry.getDn().toString(); LOG.debug("\tEntryDN {}", dn); DeepMap dnBranch = reqBranch.getBranch(dn.toLowerCase()); dnBranch.put(DISTINGUISH_NAME, dn); resultEntry.forEach(attr -> { // Since there might be multiple attributes with the same name, it is required to collect all their values (i.e. memberUid in group) if (attr.size() > 1) { List<Object> list = new ArrayList<>(); attr.iterator().forEachRemaining(list::add); String join = StringUtils.join(list, ","); dnBranch.put(attr.getId() + "", join); LOG.debug("\t\tAttr {} : {} ", attr.getId(), join); } else { dnBranch.put(attr.getId() + "", attr.get() + ""); LOG.debug("\t\tAttr {}", attr); } }); } }); return reqBranch.getRoot(); }
/** * Return a String value, from the given Value, even if it's a binary value * * @param attribute The Attribute to process * @return The Attribute value as a String */ private String getStringValue( Attribute attribute ) { Value value = attribute.get(); return value.getValue(); }
values = new ArrayList<String>(); values.add(attr.get().getValue().toString()); account.put(id, values);
public Optional<String> getAttribute(Entry entry, String attName) { Attribute attribute = entry.get(attName); if (attribute == null) { return Optional.empty(); } String value = attribute.get().toString(); if (StringUtils.isBlank(value)) { log.info("DN {}: empty attribute {}, skipping", attName); return Optional.empty(); } return Optional.of(value); }
oldAttribute.add( attribute.get() ); entry.put( oldAttribute );
Value value = attribute.get();
Value value = attribute.get();
Value value = attribute.get();
/** * Displays security warning messages if any possible secutiry issue is found. * @throws Exception if there are failures parsing and accessing internal structures */ protected void showSecurityWarnings() throws Exception { // Warn if the default password is not changed. boolean needToChangeAdminPassword = false; Dn adminDn = getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN ); Entry adminEntry = partitionNexus.lookup( new LookupOperationContext( adminSession, adminDn ) ); Value<?> userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get(); needToChangeAdminPassword = Arrays.equals( PartitionNexus.ADMIN_PASSWORD_BYTES, userPassword.getBytes() ); if ( needToChangeAdminPassword ) { LOG.warn( "You didn't change the admin password of directory service " + "instance '" + instanceId + "'. " + "Please update the admin password as soon as possible " + "to prevent a possible security breach." ); } }
byte[] password = userPassword.get().getBytes();
Value attr = rootDse.get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get(); subschemaSubentryDn = directoryService.getDnFactory().create( attr.getValue() );