| | |
| | | */ |
| | | public final class AggregationPropertyDefinition |
| | | <C extends ConfigurationClient, S extends Configuration> |
| | | extends PropertyDefinition<String> implements Constraint { |
| | | extends PropertyDefinition<String> { |
| | | |
| | | /** |
| | | * An interface for incrementally constructing aggregation property |
| | |
| | | // aggregated managed objects. |
| | | private InstantiableRelationDefinition<C, S> relationDefinition; |
| | | |
| | | // The source constraint. |
| | | private final Constraint sourceConstraint; |
| | | |
| | | // The condition which is used to determine if a referenced managed |
| | | // object is enabled. |
| | | private final Condition targetIsEnabledCondition; |
| | |
| | | this.rdName = rdName; |
| | | this.targetNeedsEnablingCondition = targetNeedsEnablingCondition; |
| | | this.targetIsEnabledCondition = targetIsEnabledCondition; |
| | | this.sourceConstraint = new Constraint() { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | ClientConstraintHandler handler = new SourceClientHandler(); |
| | | return Collections.singleton(handler); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | ServerConstraintHandler handler = new ServerHandler(); |
| | | return Collections.singleton(handler); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | ClientConstraintHandler handler = new SourceClientHandler(); |
| | | return Collections.singleton(handler); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Gets the name of the managed object which is the parent of the |
| | | * aggregated managed objects. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * Gets the constraint which should be enforced on the aggregating |
| | | * managed object. |
| | | * |
| | | * @return Returns the constraint which should be enforced on the |
| | | * aggregating managed object. |
| | | */ |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | ServerConstraintHandler handler = new ServerHandler(); |
| | | return Collections.singleton(handler); |
| | | public Constraint getSourceConstraint() { |
| | | return sourceConstraint; |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | protected void initialize() throws Exception { |
| | | public void initialize() throws Exception { |
| | | // Decode the path. |
| | | parentPath = ManagedObjectPath.valueOf(parentPathString); |
| | | |
| | |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | }; |
| | | |
| | | rd.getChildDefinition().registerConstraint(constraint); |