com.ibm.uddi.promoter

Class PromoterAPI

  • java.lang.Object
    • com.ibm.uddi.promoter.PromoterAPI
  • All Implemented Interfaces:
    com.ibm.uddi.promoter.CommandLineConstants, PromoterConstants


    public class PromoterAPI
    extends java.lang.Object
    implements PromoterConstants
    API functions for exporting, importing, promoting, finding and deleting UDDI entities.

    Export is the process of getting UDDI entities from a source registry, specified by a list of keys, and persisting them to a UDDI entity definition file, or EDF, which is in XML format.

    Import is the process of reading an EDF and transforming UDDI entities represented in XML format to UDDI4J objects and loading these in a target registry, with the entity keys as specified in the EDF. Note the target registry must be a UDDI V3 IBM WebSpher UDDI Registry.

    Promote is the single step process which combines the export and import steps, which can, but does not require, the writing of the EDF.

    Find is the process of performing inquiry operation or operations on the source registry, and using the matching results to generate a list of UDDI entity keys. The list of keys can be used as input to the export, promote and delte functions.

    Delete is the process of deleting UDDI entities from the target registry, as specified by a list of UDDI entity keys.

    Usage of this class to perform these functions is typically to:

    1. Create a Configuration and populate it from a Properties object or from a configuration properties file
    2. Create a PromoterAPI passing the Configuration in the constructor
    3. For keys based functions (export, delete and promote), set the keys by supplying a UddiEntityKeys, the location of a keys file, or, for one entity, by specifying an entity type and a key value
    4. Invoke the corresponding method for the function required: exportEntities, promoteEntities(boolean), importEntities, deleteEntities or extractKeysFromInquiry(FindTModel, FindBusiness, FindService, FindBinding, FindRelatedBusinesses)

    • Constructor Detail

      • PromoterAPI

        public PromoterAPI(com.ibm.uddi.promoter.config.Configuration config)
                    throws com.ibm.uddi.promoter.exception.PromoterConfigurationException,
                           com.ibm.uddi.promoter.exception.PromoterIOException
        Constructor taking a Configuration.

        Parameters:
        config -
        Throws:
        com.ibm.uddi.promoter.exception.PromoterConfigurationException
        com.ibm.uddi.promoter.exception.PromoterIOException
    • Method Detail

      • setUddiEntities

        public void setUddiEntities(UddiEntityKeys entityKeys)
        Sets the list of UDDI entity keys to be exported, promoted or deleted.

        Parameters:
        entityKeys -
      • setUddiEntities

        public void setUddiEntities(java.lang.String keysFilePath)
                             throws com.ibm.uddi.promoter.exception.PromoterIOException
        Reads the list of UDDI entity keys from the specified file.

        Parameters:
        keysFilePath -
        Throws:
        com.ibm.uddi.promoter.exception.PromoterIOException
      • setUddiEntity

        public void setUddiEntity(java.lang.String entityType,
                         java.lang.String entityKey)
        Specifys a single UDDI entity to be exported, promoted or deleted.

        Parameters:
        entityType - Can be one of 'tModel', 'business', 'service' or 'binding'.
        entityKey -
      • getConfiguration

        public com.ibm.uddi.promoter.config.Configuration getConfiguration()
        Returns the configuration.

        Returns:
        Configuration
      • setConfiguration

        public void setConfiguration(com.ibm.uddi.promoter.config.Configuration configuration)
        Sets the configuration.

        Parameters:
        configuration -
      • exportEntities

        public void exportEntities()
                            throws com.ibm.uddi.promoter.exception.PromoterException
        Drives the export of UDDI entities from the source registry.

        The UDDI entities are persisted to an XML file, the entity definition file (EDF), which can be later used to import into a target UDDI registry.

        The EDF is generated according to the UDDI Utility Tools schema, promoter.xsd.

        Throws:
        com.ibm.uddi.promoter.exception.PromoterException
      • extractKeysFromInquiry

        public void extractKeysFromInquiry(org.uddi4j.request.FindTModel findTModel,
                                  org.uddi4j.request.FindBusiness findBusiness,
                                  org.uddi4j.request.FindService findService,
                                  org.uddi4j.request.FindBinding findBinding,
                                  org.uddi4j.request.FindRelatedBusinesses findRelatedBusiness)
                                    throws com.ibm.uddi.promoter.exception.PromoterException
        Performs inquiry requests on the source registry and uses the results to set the UddiEntityKeys in PromoterAPI that can be used by the exportEntities, promoteEntities and deleteEntities methods.

        The five possible arguments are all UDDI4J find objects and are optional. To omit a find object just set the argument to null. For example, to invoke this method specifying only business and tModel search criteria, the invocation would be similar to:

        promoterAPI.extractKeysFromInquiry(findTModel, findBusiness, null, null, null);

        Parameters:
        findTModel -
        findBusiness -
        findService -
        findBinding -
        findRelatedBusiness -
        Throws:
        com.ibm.uddi.promoter.exception.PromoterException
      • importEntities

        public void importEntities()
                            throws com.ibm.uddi.promoter.exception.PromoterException
        Drives the import of UDDI entities to target registry, where the source of UDDI entities is an entity definition file in XML format, according to the UDDI Utility Tools schema, promoter.xsd.

        Throws:
        com.ibm.uddi.promoter.exception.PromoterException
      • promoteEntities

        public void promoteEntities(boolean writeXML)
                             throws com.ibm.uddi.promoter.exception.PromoterException
        Drives the single step process of extracting UDDI entities from the source registry and importing them to the target registry.

        In this case, although an intermediate XML file may be written, it is not used for the import step.

        Parameters:
        writeXML - true will generate an intermediate EDF.
        Throws:
        com.ibm.uddi.promoter.exception.PromoterException
      • deleteEntities

        public void deleteEntities()
                            throws com.ibm.uddi.promoter.exception.PromoterUDDI4JException,
                                   com.ibm.uddi.promoter.exception.PromoterTransportException,
                                   com.ibm.uddi.promoter.exception.PromoterConfigurationException
        Drives deletion of entities from the target registry.

        Throws:
        com.ibm.uddi.promoter.exception.PromoterUDDI4JException
        com.ibm.uddi.promoter.exception.PromoterTransportException
        com.ibm.uddi.promoter.exception.PromoterConfigurationException
IBM WebSphere Application ServerTM
Release 8.5