| | |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends AbstractBuilder<String, AggregationPropertyDefinition<C, S>> { |
| | | |
| | | // The string representation of the managed object path specifying |
| | | // the parent of the aggregated managed objects. |
| | | /** |
| | | * The string representation of the managed object path specifying |
| | | * the parent of the aggregated managed objects. |
| | | */ |
| | | private String parentPathString; |
| | | |
| | | // The name of a relation in the parent managed object which |
| | | // contains the aggregated managed objects. |
| | | /** |
| | | * The name of a relation in the parent managed object which |
| | | * contains the aggregated managed objects. |
| | | */ |
| | | private String rdName; |
| | | |
| | | // The condition which is used to determine if a referenced |
| | | // managed object is enabled. |
| | | /** |
| | | * The condition which is used to determine if a referenced |
| | | * managed object is enabled. |
| | | */ |
| | | private Condition targetIsEnabledCondition = Conditions.TRUE; |
| | | |
| | | // The condition which is used to determine whether or not |
| | | // referenced managed objects need to be enabled. |
| | | /** |
| | | * The condition which is used to determine whether or not |
| | | * referenced managed objects need to be enabled. |
| | | */ |
| | | private Condition targetNeedsEnablingCondition = Conditions.TRUE; |
| | | |
| | | |
| | | |
| | | // Private constructor |
| | | /** Private constructor. */ |
| | | private Builder(AbstractManagedObjectDefinition<?, ?> d, |
| | | String propertyName) { |
| | | super(d, propertyName); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected AggregationPropertyDefinition<C, S> buildInstance( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | |
| | | private class ReferentialIntegrityChangeListener implements |
| | | ServerManagedObjectChangeListener<S> { |
| | | |
| | | // The error message which should be returned if an attempt is |
| | | // made to disable the referenced component. |
| | | /** |
| | | * The error message which should be returned if an attempt is |
| | | * made to disable the referenced component. |
| | | */ |
| | | private final LocalizableMessage message; |
| | | |
| | | // The path of the referenced component. |
| | | /** The path of the referenced component. */ |
| | | private final ManagedObjectPath<C, S> path; |
| | | |
| | | |
| | | |
| | | // Creates a new referential integrity delete listener. |
| | | /** Creates a new referential integrity delete listener. */ |
| | | private ReferentialIntegrityChangeListener(ManagedObjectPath<C, S> path, |
| | | LocalizableMessage message) { |
| | | this.path = path; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ServerManagedObject<? extends S> mo) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ServerManagedObject<? extends S> mo, |
| | | List<LocalizableMessage> unacceptableReasons) { |
| | |
| | | |
| | | |
| | | |
| | | // Gets the path associated with this listener. |
| | | /** Gets the path associated with this listener. */ |
| | | private ManagedObjectPath<C, S> getManagedObjectPath() { |
| | | return path; |
| | | } |
| | |
| | | private class ReferentialIntegrityDeleteListener implements |
| | | ConfigurationDeleteListener<S> { |
| | | |
| | | // The DN of the referenced configuration entry. |
| | | /** The DN of the referenced configuration entry. */ |
| | | private final DN dn; |
| | | |
| | | // The error message which should be returned if an attempt is |
| | | // made to delete the referenced component. |
| | | /** |
| | | * The error message which should be returned if an attempt is |
| | | * made to delete the referenced component. |
| | | */ |
| | | private final LocalizableMessage message; |
| | | |
| | | |
| | | |
| | | // Creates a new referential integrity delete listener. |
| | | /** Creates a new referential integrity delete listener. */ |
| | | private ReferentialIntegrityDeleteListener(DN dn, LocalizableMessage message) { |
| | | this.dn = dn; |
| | | this.message = message; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationDelete(S configuration) { |
| | | // This should not happen - the |
| | | // isConfigurationDeleteAcceptable() call-back should have |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationDeleteAcceptable(S configuration, |
| | | List<LocalizableMessage> unacceptableReasons) { |
| | | if (configuration.dn().equals(dn)) { |
| | |
| | | */ |
| | | private class ServerHandler extends ServerConstraintHandler { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isUsable(ServerManagedObject<?> managedObject, |
| | | Collection<LocalizableMessage> unacceptableReasons) throws ConfigException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void performPostAdd(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void performPostDelete(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void performPostModify(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | |
| | | */ |
| | | private class SourceClientHandler extends ClientConstraintHandler { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAddAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isModifyAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | */ |
| | | private class TargetClientHandler extends ClientConstraintHandler { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDeleteAcceptable(ManagementContext context, |
| | | ManagedObjectPath<?, ?> path, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isModifyAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | // Find all managed objects which reference the named managed |
| | | // object using this property. |
| | | /** |
| | | * Find all managed objects which reference the named managed |
| | | * object using this property. |
| | | */ |
| | | private <CC extends ConfigurationClient> |
| | | List<ManagedObject<? extends CC>> findReferences( |
| | | ManagementContext context, AbstractManagedObjectDefinition<CC, ?> mod, |
| | |
| | | |
| | | |
| | | |
| | | // Find all instances of a specific type of managed object. |
| | | /** Find all instances of a specific type of managed object. */ |
| | | @SuppressWarnings("unchecked") |
| | | private <CC extends ConfigurationClient> |
| | | List<ManagedObject<? extends CC>> findInstances( |
| | |
| | | return new Builder<C, S>(d, propertyName); |
| | | } |
| | | |
| | | // The active server-side referential integrity change listeners |
| | | // associated with this property. |
| | | /** |
| | | * The active server-side referential integrity change listeners |
| | | * associated with this property. |
| | | */ |
| | | private final Map<DN, List<ReferentialIntegrityChangeListener>> |
| | | changeListeners = new HashMap<DN, |
| | | List<ReferentialIntegrityChangeListener>>(); |
| | | |
| | | // The active server-side referential integrity delete listeners |
| | | // associated with this property. |
| | | /** |
| | | * The active server-side referential integrity delete listeners |
| | | * associated with this property. |
| | | */ |
| | | private final Map<DN, List<ReferentialIntegrityDeleteListener>> |
| | | deleteListeners = new HashMap<DN, |
| | | List<ReferentialIntegrityDeleteListener>>(); |
| | | |
| | | // The name of the managed object which is the parent of the |
| | | // aggregated managed objects. |
| | | /** |
| | | * The name of the managed object which is the parent of the |
| | | * aggregated managed objects. |
| | | */ |
| | | private ManagedObjectPath<?, ?> parentPath; |
| | | |
| | | // The string representation of the managed object path specifying |
| | | // the parent of the aggregated managed objects. |
| | | /** |
| | | * The string representation of the managed object path specifying |
| | | * the parent of the aggregated managed objects. |
| | | */ |
| | | private final String parentPathString; |
| | | |
| | | // The name of a relation in the parent managed object which |
| | | // contains the aggregated managed objects. |
| | | /** |
| | | * The name of a relation in the parent managed object which |
| | | * contains the aggregated managed objects. |
| | | */ |
| | | private final String rdName; |
| | | |
| | | // The relation in the parent managed object which contains the |
| | | // aggregated managed objects. |
| | | /** |
| | | * The relation in the parent managed object which contains the |
| | | * aggregated managed objects. |
| | | */ |
| | | private InstantiableRelationDefinition<C, S> relationDefinition; |
| | | |
| | | // The source constraint. |
| | | /** The source constraint. */ |
| | | private final Constraint sourceConstraint; |
| | | |
| | | // The condition which is used to determine if a referenced managed |
| | | // object is enabled. |
| | | /** |
| | | * The condition which is used to determine if a referenced managed |
| | | * object is enabled. |
| | | */ |
| | | private final Condition targetIsEnabledCondition; |
| | | |
| | | // The condition which is used to determine whether or not |
| | | // referenced managed objects need to be enabled. |
| | | /** |
| | | * The condition which is used to determine whether or not |
| | | * referenced managed objects need to be enabled. |
| | | */ |
| | | private final Condition targetNeedsEnablingCondition; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private AggregationPropertyDefinition( |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, AdministratorAction adminAction, |
| | |
| | | this.targetIsEnabledCondition = targetIsEnabledCondition; |
| | | this.sourceConstraint = new Constraint() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | ClientConstraintHandler handler = new SourceClientHandler(); |
| | | return Collections.singleton(handler); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | ServerConstraintHandler handler = new ServerHandler(); |
| | | return Collections.singleton(handler); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyDefinitionVisitor<R, P> v, P p) { |
| | | return v.visitAggregation(this, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <R, P> R accept(PropertyValueVisitor<R, P> v, String value, P p) { |
| | | return v.visitAggregation(this, value, p); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String decodeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String normalizeValue(String value) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder builder) { |
| | | super.toString(builder); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void validateValue(String value) throws PropertyException { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public void initialize() throws Exception { |
| | |
| | | // for actions performed against referenced managed objects. |
| | | Constraint constraint = new Constraint() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | ClientConstraintHandler handler = new TargetClientHandler(); |
| | | return Collections.singleton(handler); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | return Collections.emptyList(); |
| | | } |