From b08bd4dd4b0d4d17d4907c605dba11020cf11922 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 28 Sep 2007 15:47:50 +0000
Subject: [PATCH] Add support for specifying arbitrary constraints in managed object definitions and use it within the LDAP and JMX connection handlers to enforce their SSL/StartTLS settings. This feature will be re-used for other managed object definitions as the need arises.
---
opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java | 49 ++++++++++++++++++++++++++++++++-----------------
1 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java b/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
index b0a23b8..d93c0ac 100644
--- a/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
+++ b/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
@@ -108,7 +108,7 @@
*/
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
@@ -910,6 +910,9 @@
// 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;
@@ -933,6 +936,26 @@
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);
+ }
+ };
}
@@ -1008,16 +1031,6 @@
/**
- * {@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.
*
@@ -1044,11 +1057,14 @@
/**
- * {@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;
}
@@ -1137,7 +1153,7 @@
*/
@SuppressWarnings("unchecked")
@Override
- protected void initialize() throws Exception {
+ public void initialize() throws Exception {
// Decode the path.
parentPath = ManagedObjectPath.valueOf(parentPathString);
@@ -1172,7 +1188,6 @@
public Collection<ServerConstraintHandler> getServerConstraintHandlers() {
return Collections.emptyList();
}
-
};
rd.getChildDefinition().registerConstraint(constraint);
--
Gitblit v1.10.0