| | |
| | | */ |
| | | private static final class ValueEncoder extends PropertyValueVisitor<Object, Void> { |
| | | |
| | | // Prevent instantiation. |
| | | /** Prevent instantiation. */ |
| | | private ValueEncoder() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> Object visitAggregation( |
| | | AggregationPropertyDefinition<C, S> pd, String v, Void p) { |
| | |
| | | return reference.toDN().toString(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <P> Object visitUnknown(PropertyDefinition<P> propertyDef, P value, Void p) { |
| | | return propertyDef.encodeValue(value); |
| | | } |
| | | } |
| | | |
| | | // The LDAP management driver associated with this managed object. |
| | | /** The LDAP management driver associated with this managed object. */ |
| | | private final LDAPDriver driver; |
| | | |
| | | /** |
| | |
| | | this.driver = driver; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void addNewManagedObject() throws LdapException, OperationRejectedException, |
| | | ConcurrentModificationException, ManagedObjectAlreadyExistsException { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected Driver getDriver() { |
| | | return driver; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void modifyExistingManagedObject() throws ConcurrentModificationException, OperationRejectedException, |
| | | LdapException { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected <M extends ConfigurationClient> ManagedObject<M> newInstance(ManagedObjectDefinition<M, ?> d, |
| | | ManagedObjectPath<M, ?> path, PropertySet properties, boolean existsOnServer, |
| | |
| | | return new LDAPManagedObject<M>(driver, d, path, properties, existsOnServer, namingPropertyDefinition); |
| | | } |
| | | |
| | | // Encode a property into LDAP string values. |
| | | /** Encode a property into LDAP string values. */ |
| | | private <P> void encodeProperty(Attribute attribute, PropertyDefinition<P> propertyDef) { |
| | | PropertyValueVisitor<Object, Void> visitor = new ValueEncoder(); |
| | | Property<P> property = getProperty(propertyDef); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isModified() { |
| | | ManagedObjectDefinition<?, ?> d = getManagedObjectDefinition(); |
| | | for (PropertyDefinition<?> pd : d.getAllPropertyDefinitions()) { |