| | |
| | | import org.opends.server.admin.Reference; |
| | | import org.opends.server.admin.RelationDefinition; |
| | | import org.opends.server.admin.SetRelationDefinition; |
| | | import org.opends.server.admin.UnknownPropertyDefinitionException; |
| | | import org.opends.server.admin.client.ConcurrentModificationException; |
| | | import org.opends.server.admin.client.ManagedObject; |
| | | import org.opends.server.admin.client.OperationRejectedException; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public <PD> Object visitUnknown(PropertyDefinition<PD> pd, PD v, Void p) |
| | | throws UnknownPropertyDefinitionException { |
| | | return pd.encodeValue(v); |
| | | public <P> Object visitUnknown(PropertyDefinition<P> propertyDef, P value, Void p) { |
| | | return propertyDef.encodeValue(value); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // Encode a property into LDAP string values. |
| | | private <PD> void encodeProperty(Attribute attribute, PropertyDefinition<PD> propertyDef) { |
| | | private <P> void encodeProperty(Attribute attribute, PropertyDefinition<P> propertyDef) { |
| | | PropertyValueVisitor<Object, Void> visitor = new ValueEncoder(); |
| | | Property<PD> property = getProperty(propertyDef); |
| | | Property<P> property = getProperty(propertyDef); |
| | | if (propertyDef.hasOption(PropertyOption.MANDATORY)) { |
| | | // For mandatory properties we fall-back to the default values |
| | | // if defined which can sometimes be the case e.g when a |
| | | // mandatory property is overridden. |
| | | for (PD value : property.getEffectiveValues()) { |
| | | for (P value : property.getEffectiveValues()) { |
| | | attribute.add(propertyDef.accept(visitor, value, null)); |
| | | } |
| | | } else { |
| | | for (PD value : property.getPendingValues()) { |
| | | for (P value : property.getPendingValues()) { |
| | | attribute.add(propertyDef.accept(visitor, value, null)); |
| | | } |
| | | } |