if (activeDirectory && "userPrincipalName".equalsIgnoreCase(attribute.getId())) { ldapEntry.setBindPrincipal(attribute.getString()); ldapEntry.put(attribute.getId(), Joiner.on(", ").join(attribute.iterator())); if ("memberOf".equalsIgnoreCase(attribute.getId()) || "isMemberOf".equalsIgnoreCase(attribute.getId())) { for (Value<?> group : attribute) { groupDns.add(group.getString());
/** * @return Returns the currentAttribute type. */ public String getCurrentAttributeType() { return currentAttribute.getId(); }
/** * @return Returns the currentAttribute type. */ public String getCurrentAttributeType() { return currentAttribute.getId(); }
/** * @return Returns the currentAttribute type. */ public String getCurrentAttributeType() { return currentAttribute.getId(); }
/** * @return the current attribute's type */ public String getCurrentAttributeType() { return currentAttribute.getId(); }
/** * @return Returns the currentAttribute type. */ public String getCurrentAttributeType() { return currentAttribute.getId(); }
if (valor == null) throw new RuntimeException("Got no value."); Attribute attribute = valor.getAttribute(); if (attribute == null) throw new RuntimeException("Got value, but no attribute."); Id id = attribute.getId(); if (id == null) throw new RuntimeException("Got value and attribute, but no id."); String localizedId = id.getLocalizedId(); if (localizedId == null) throw new RuntimeException("Got value, attribute and id, but no localized id."); return localizedId;
Attribute a=values.stream().filter(value -> value.getOrder("order") == order).findAny() .orElseThrow(() -> new RuntimeException("Could not find value of order " + order)); Id id=a.getId(); if(id==null) throw new RuntimeException("Value of order " + order + " has no id"); String name=id.getName(); if(name==null) throw new RuntimeException( "Could get the id but not the localized id of the value of order " + order); return name;
/** * Add a modification item (used by modify operations) * * @param modification The modification to be added */ public void addModification( Modification modification ) { if ( changeType == ChangeType.Modify ) { modificationList.add( modification ); modifications.put( modification.getAttribute().getId(), modification ); } }
/** * Add a modification item (used by modify operations) * * @param modification The modification to be added */ public void addModification( Modification modification ) { if ( changeType == ChangeType.Modify ) { modificationList.add( modification ); modifications.put( modification.getAttribute().getId(), modification ); } }
/** * Add a modification item (used by modify operations) * * @param modification The modification to be added */ public void addModification( Modification modification ) { if ( changeType == ChangeType.Modify ) { modificationList.add( modification ); modifications.put( modification.getAttribute().getId(), modification ); } }
/** * Add a modification item (used by modify operations) * * @param modOp The operation. One of : * <ul> * <li>ModificationOperation.ADD_ATTRIBUTE</li> * <li>ModificationOperation.REMOVE_ATTRIBUTE</li> * <li>ModificationOperation.REPLACE_ATTRIBUTE</li> * </ul> * * @param attr The attribute to be added */ public void addModification( ModificationOperation modOp, Attribute attr ) { if ( changeType == ChangeType.Modify ) { Modification item = new DefaultModification( modOp, attr ); modificationList.add( item ); modifications.put( attr.getId(), item ); } }
/** * Add a modification item (used by modify operations) * * @param modOp The operation. One of : * <ul> * <li>ModificationOperation.ADD_ATTRIBUTE</li> * <li>ModificationOperation.REMOVE_ATTRIBUTE</li> * <li>ModificationOperation.REPLACE_ATTRIBUTE</li> * </ul> * * @param attr The attribute to be added */ public void addModification( ModificationOperation modOp, Attribute attr ) { if ( changeType == ChangeType.Modify ) { Modification item = new DefaultModification( modOp, attr ); modificationList.add( item ); modifications.put( attr.getId(), item ); } }
/** * Add a modification item (used by modify operations) * * @param modOp The operation. One of : * <ul> * <li>ModificationOperation.ADD_ATTRIBUTE</li> * <li>ModificationOperation.REMOVE_ATTRIBUTE</li> * <li>ModificationOperation.REPLACE_ATTRIBUTE</li> * </ul> * * @param attr The attribute to be added */ public void addModification( ModificationOperation modOp, Attribute attr ) { if ( changeType == ChangeType.Modify ) { Modification item = new DefaultModification( modOp, attr ); modificationList.add( item ); modifications.put( attr.getId(), item ); } }
public Object[] getElements( Object inputElement ) { List<AttributeValueObject> elements = new ArrayList<AttributeValueObject>(); Entry entry = ( Entry ) inputElement; Iterator<Attribute> attributes = entry.iterator(); while ( attributes.hasNext() ) { Attribute attribute = attributes.next(); Iterator<Value<?>> values = attribute.iterator(); while ( values.hasNext() ) { Value<?> value = values.next(); elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) ); } } return elements.toArray(); }
public Object[] getElements( Object inputElement ) { List<AttributeValueObject> elements = new ArrayList<AttributeValueObject>(); Entry entry = ( Entry ) inputElement; Iterator<Attribute> attributes = entry.iterator(); while ( attributes.hasNext() ) { Attribute attribute = attributes.next(); Iterator<Value<?>> values = attribute.iterator(); while ( values.hasNext() ) { Value<?> value = values.next(); elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) ); } } return elements.toArray(); }
public Object[] getElements( Object inputElement ) { List<AttributeValueObject> elements = new ArrayList<AttributeValueObject>(); Entry entry = ( Entry ) inputElement; Iterator<Attribute> attributes = entry.iterator(); while ( attributes.hasNext() ) { Attribute attribute = attributes.next(); Iterator<Value<?>> values = attribute.iterator(); while ( values.hasNext() ) { Value<?> value = values.next(); elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) ); } } return elements.toArray(); }
public Object[] getElements( Object inputElement ) { List<AttributeValueObject> elements = new ArrayList<AttributeValueObject>(); Entry entry = ( Entry ) inputElement; Iterator<Attribute> attributes = entry.iterator(); while ( attributes.hasNext() ) { Attribute attribute = attributes.next(); Iterator<Value<?>> values = attribute.iterator(); while ( values.hasNext() ) { Value<?> value = values.next(); elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) ); } } return elements.toArray(); }
private void applyAttributes(Map<String, Object> props, Entry entry) throws LdapInvalidAttributeValueException { for (Attribute attr: entry.getAttributes()) { if (attr.isHumanReadable()) { final Object propValue; // for multivalue properties, store as collection if (attr.size() > 1) { List<String> values = new ArrayList(); for (Value<?> value : attr) { values.add(value.getString()); } propValue = values; } else { propValue = attr.getString(); } props.put(attr.getId(), propValue); } } }
/** * Creates a new instance of DefaultModification. * * @param schemaManager The schema manager * @param modification The modification */ public DefaultModification( SchemaManager schemaManager, Modification modification ) { operation = modification.getOperation(); Attribute modAttribute = modification.getAttribute(); try { AttributeType at = modAttribute.getAttributeType(); if ( at == null ) { at = schemaManager.lookupAttributeTypeRegistry( modAttribute.getId() ); } attribute = new DefaultAttribute( at, modAttribute ); } catch ( LdapException ne ) { // The attributeType is incorrect. Log, but do nothing otherwise. LOG.error( I18n.err( I18n.ERR_13230_INCORRECT_ATTRIBUTE, modAttribute.getId() ) ); } }