Previous section   Next section
Concept javax.xml.registry.infomodel

JAXR 1.0; JWSDP 1.0, J2EE 1.4
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:

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");

Passed To

javax.xml.registry.LifeCycleManager.{createAssociation( ), createClassification( ), createClassificationScheme( )}, Association.setAssociationType( ), Classification.setConcept( ), ClassificationScheme.{addChildConcept( ), removeChildConcept( )}, Concept.{addChildConcept( ), removeChildConcept( )}

Returned By

javax.xml.registry.BusinessQueryManager.findConceptByPath( ), javax.xml.registry.LifeCycleManager.createConcept( ), Association.getAssociationType( ), Classification.getConcept( ), Concept.getParentConcept( ), RegistryObject.getObjectType( )


  Previous section   Next section