Repository: qpid-dispatch Updated Branches: refs/heads/master a6d5be7b5 -> 5d0ec672d
DISPATCH-186: Modify schema to indicate sslProfile should entered separately in console. Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/5d0ec672 Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/5d0ec672 Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/5d0ec672 Branch: refs/heads/master Commit: 5d0ec672d06eec3d8fee79d7a90e85ba47b1e43a Parents: a6d5be7 Author: Ernest Allen <eal...@redhat.com> Authored: Mon Jan 4 09:45:31 2016 -0500 Committer: Ernest Allen <eal...@redhat.com> Committed: Mon Jan 4 09:45:31 2016 -0500 ---------------------------------------------------------------------- python/qpid_dispatch/management/qdrouter.json | 1 + python/qpid_dispatch_internal/management/schema.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5d0ec672/python/qpid_dispatch/management/qdrouter.json ---------------------------------------------------------------------- diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json index 50b6640..3c342ad 100644 --- a/python/qpid_dispatch/management/qdrouter.json +++ b/python/qpid_dispatch/management/qdrouter.json @@ -48,6 +48,7 @@ "sslProfile": { "description":"Attributes for setting TLS/SSL configuration for connections.", + "referential": true, "attributes": { "certDb": { "type": "path", http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5d0ec672/python/qpid_dispatch_internal/management/schema.py ---------------------------------------------------------------------- diff --git a/python/qpid_dispatch_internal/management/schema.py b/python/qpid_dispatch_internal/management/schema.py index 5ea96de..b714622 100644 --- a/python/qpid_dispatch_internal/management/schema.py +++ b/python/qpid_dispatch_internal/management/schema.py @@ -315,14 +315,15 @@ class EntityType(object): @ivar short_name: Un-prefixed short name. @ivar attributes: Map of L{AttributeType} for entity. @ivar singleton: If true only one entity of this type is allowed. - #ivar annotation: List of names of sections annotationd by this entity. + @ivar referential: True if an entity/annotation can be referred to by name. + @ivar annotations: List of names of sections annotationd by this entity. """ - def __init__(self, name, schema, attributes=None, operations=None, operationDefs=None, description="", fullName=True, singleton=False, annotations=None, extends=None, **kwargs): + def __init__(self, name, schema, attributes=None, operations=None, operationDefs=None, description="", fullName=True, singleton=False, annotations=None, extends=None, referential=False, **kwargs): """ @param name: name of the entity type. @param schema: schema for this type. @param singleton: True if entity type is a singleton. - @param annotation: List of names of annotation types for this entity. + @param annotations: List of names of annotation types for this entity. @param attributes: Map of attributes {name: {type:, default:, required:, unique:}} @param description: Human readable description. @param operations: Allowed operations, list of operation names. @@ -342,9 +343,12 @@ class EntityType(object): self.base = extends self.all_bases = [] self.annotations = annotations or [] + # List of annotations that are singletons + self.references = [] # This map defines values that can be referred to using $$ in the schema. self.refs = {'entityType': self.name} self.singleton = singleton + self.referential = referential self._init = False # Have not yet initialized from base and attributes. # Operation definitions self.operation_defs = dict((name, OperationDef(name, **op)) @@ -363,6 +367,8 @@ class EntityType(object): self.all_bases = [self.base] + self.base.all_bases self._extend(self.base, 'extend') if self.annotations: + self.references = [x for x in self.annotations + if self.schema.annotation(x).referential] self.annotations = [self.schema.annotation(a) for a in self.annotations] for a in self.annotations: self._extend(a, 'be annotated') @@ -476,7 +482,9 @@ class EntityType(object): (k, v.dump()) for k, v in self.attributes.iteritems() if k != 'type')), # Don't dump 'type' attribute, dumped separately. ('operations', self.operations), - ('description', self.description or None) + ('description', self.description or None), + ('references', self.references), + ('singleton', self.singleton) ]) def __repr__(self): return "%s(%s)" % (type(self).__name__, self.name) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org