public interface Concept extends RegistryObject {
// Property Accessor Methods (by property name)
public abstract int getChildConceptCount( )
throws javax.xml.registry.JAXRException; //L0
public abstract Collection getChildrenConcepts( )
throws javax.xml.registry.JAXRException; //L0
public abstract ClassificationScheme getClassificationScheme( )
throws javax.xml.registry.JAXRException; //L0
public abstract Collection getDescendantConcepts( )
throws javax.xml.registry.JAXRException; //L0
public abstract RegistryObject getParent( )
throws javax.xml.registry.JAXRException; //L0
public abstract Concept getParentConcept( )
throws javax.xml.registry.JAXRException; //L0
public abstract String getPath( )
throws javax.xml.registry.JAXRException; //L0
public abstract String getValue( )
throws javax.xml.registry.JAXRException; //L0
public abstract void setValue(String value)
throws javax.xml.registry.JAXRException; //L0
// Public Instance Methods
public abstract void addChildConcept(Concept concept)
throws javax.xml.registry.JAXRException; //L0
public abstract void addChildConcepts(Collection concepts)
throws javax.xml.registry.JAXRException; //L0
public abstract void removeChildConcept(Concept concept)
throws javax.xml.registry.JAXRException; //L0
public abstract void removeChildConcepts(Collection concepts)
throws javax.xml.registry.JAXRException; //L0
}
Concepts are used in various different ways within
the JAXR API. A Concept can be thought of as a
useful item that is given meaning by the context in which it is used.
Some typical uses for Concepts are:
To represent a member of an enumerated type. The JAXR API defines
several enumerated types that represent the different types of
objects in the registry, the various types of
Association that are available, and so on.
As a node in an internal ClassificationScheme
either stored within the registry or emulated by the JAXR provider.
In the NAICS scheme, for example, there is a
Concept that represents the node for
"Publishing Industries," and
another for a subclassification called "Newspaper,
Periodical, Book, and Database Publishers." The
hierarchical relation between the classification nodes is represented
using the parent-child relationship between the corresponding
Concepts.
As the target of a SpecificationLink when storing
a reference to a WSDL document in the registry. When used in this
way, the Concept is acting simply as an anonymous
registry object and making use of its inherited ability to be
classified and to refer to external content using an
ExternalLink. Refer to Section 7.5.5.4 in Chapter 7 for more details of this use.
Create a Concept using the createConcept(
) method of LifeCycleManager, which
requires a name and a value (both of which are strings), and a parent
RegistryObject, which must be either another
Concept or a
ClassificationScheme. In terms of the methods that
it defines, a Concept is a simple object that has
a string value and resides in a hierarchy. The
addChildConcept( ) and addChildConcepts(
) methods can be used to add one or more children to a
Concept, while removeChildConcept(
) and removeChildConcepts( ) can be used
to remove them. You can navigate around a Concept
by using the methods getParentConcept( ) (which
returns null if there is no parent),
getChildrenConcepts( ) (which returns all of the
immediate children of a Concept), and
getDescendentConcepts( ) (which returns all of the
descendents of a Concept).
As noted earlier, Concepts often appear as nodes
in a classification scheme. When this is the case, you can find the
ClassificationScheme of which a
Concept is part by calling its
getClassificationScheme( ) method. Although you
can build a new classification scheme hierarchy by creating a new
ClassificationScheme object and linking a
hierarchy of Concepts beneath it, you cannot store
such a scheme in a UDDI V2.0 registry (although you can do so in an
ebXML registry). To compensate for this, the JAXR provider allows you
to simulate the creation of a custom classification scheme using
configuration information stored locally to the provider, as
described in Chapter 7.
Since Concepts are hierarchical, they have an
associated path that can be obtained using the getPath(
) method. The path is formed from the identifier of the
ClassificationScheme beneath which the
Concept resides, followed by the value (not the
name) of each Concept in the path leading down to
the target Concept, where the path components are
separated using the "/ " character.
For example, a Concept with the value
"3" linked three levels below a
ClassificationScheme with identifier
uuid:f1ef390d-08f1-ef39-3f48-e3438b38f908, with
intervening Concepts having values
"1" and
"2", returns the string
/uuid:f1ef390d-08f1-ef39-3f48-e3438b38f908/1/2/3
from its getPath( ) method. Conversely, if you
know the path of a Concept, you can use the
findConceptByPath( ) method of
BusinessQueryManager to look it up:
Concept c = bqm.findConceptByPath("/uuid:f1ef390d-08f1-ef39-3f48-
e3438b38f908/1/2/3");
Code like this is commonly used when looking up members of enumerated
types. In this case, the JAXR provider typically allows you to use
one of the enumerated type names listed in the JAXR specification in
place of the long-winded identifier used with
ClassificationSchemes as the first part of the
path. For example, the following code returns the
Concept that represents the object type for the
Classification object:
Concept c = bqm.findConceptByPath("/ObjectType/Classification");