Example usage for javax.xml.registry RegistryException getLocalizedMessage

List of usage examples for javax.xml.registry RegistryException getLocalizedMessage

Introduction

In this page you can find the example usage for javax.xml.registry RegistryException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:org.apache.ws.scout.registry.BusinessLifeCycleManagerImpl.java

public BulkResponse saveClassificationSchemes(Collection schemes) throws JAXRException {
    //Now we need to convert the collection into a vector for juddi
    BulkResponseImpl bulk = new BulkResponseImpl();
    TModel[] entityarr = new TModel[schemes.size()];

    LinkedHashSet<Key> coll = new LinkedHashSet<Key>();
    Collection<Exception> exceptions = new ArrayList<Exception>();

    Iterator iter = schemes.iterator();
    int currLoc = 0;
    while (iter.hasNext()) {
        try {//from  ww w .  ja v  a2s.  co  m
            TModel en = ScoutJaxrUddiHelper
                    .getTModelFromJAXRClassificationScheme((ClassificationScheme) iter.next());
            entityarr[currLoc] = en;
            currLoc++;
        } catch (ClassCastException ce) {
            throw new UnexpectedObjectException();
        }
    }
    log.debug("Method:save_classificationscheme: ENlength=" + entityarr.length);
    // Save business
    TModelDetail td = null;
    try {
        td = (TModelDetail) executeOperation(entityarr, "SAVE_TMODEL");
    } catch (RegistryException e) {
        exceptions.add(new SaveException(e.getLocalizedMessage()));
        bulk.setStatus(JAXRResponse.STATUS_FAILURE);
        return bulk;
    }

    List<TModel> tmodelList = td.getTModel();
    entityarr = new TModel[tmodelList.size()];
    tmodelList.toArray(entityarr);
    log.debug("After Saving TModel. Obtained vector size:" + entityarr != null ? entityarr.length : 0);
    for (int i = 0; entityarr != null && i < entityarr.length; i++) {
        TModel tm = (TModel) entityarr[i];
        coll.add(new KeyImpl(tm.getTModelKey()));
    }

    bulk.setCollection(coll);
    bulk.setExceptions(exceptions);

    return bulk;
}

From source file:org.apache.ws.scout.registry.BusinessLifeCycleManagerImpl.java

public BulkResponse saveConcepts(Collection concepts) throws JAXRException {
    //Now we need to convert the collection into a vector for juddi
    BulkResponseImpl bulk = new BulkResponseImpl();
    TModel[] entityarr = new TModel[concepts.size()];

    LinkedHashSet<Key> coll = new LinkedHashSet<Key>();
    Collection<Exception> exceptions = new ArrayList<Exception>();

    Iterator iter = concepts.iterator();
    int currLoc = 0;
    while (iter.hasNext()) {
        try {//  w w w.ja v a  2  s. co  m
            TModel en = ScoutJaxrUddiHelper.getTModelFromJAXRConcept((Concept) iter.next());
            entityarr[currLoc] = en;
            currLoc++;
        } catch (ClassCastException ce) {
            throw new UnexpectedObjectException();
        }
    }
    log.debug("Method:save_concept: ENlength=" + entityarr.length);
    // Save business
    TModelDetail td = null;
    try {
        td = (TModelDetail) executeOperation(entityarr, "SAVE_TMODEL");
    } catch (RegistryException e) {
        exceptions.add(new SaveException(e.getLocalizedMessage()));
        bulk.setStatus(JAXRResponse.STATUS_FAILURE);
        return bulk;
    }

    List<TModel> tmodelList = td.getTModel();
    entityarr = new TModel[tmodelList.size()];
    tmodelList.toArray(entityarr);

    log.debug("After Saving TModel. Obtained vector size:" + entityarr != null ? entityarr.length : 0);
    for (int i = 0; entityarr != null && i < entityarr.length; i++) {
        TModel tm = (TModel) entityarr[i];
        coll.add(new KeyImpl(tm.getTModelKey()));
    }

    bulk.setCollection(coll);
    bulk.setExceptions(exceptions);

    return bulk;
}

From source file:org.apache.ws.scout.registry.BusinessLifeCycleManagerImpl.java

public BulkResponse saveOrganizations(Collection organizations) throws JAXRException {
    //Now we need to convert the collection into a vector for juddi
    BulkResponseImpl bulk = new BulkResponseImpl();
    BusinessEntity[] entityarr = new BusinessEntity[organizations.size()];

    LinkedHashSet<Key> coll = new LinkedHashSet<Key>();
    Collection<Exception> exceptions = new ArrayList<Exception>();

    Iterator iter = organizations.iterator();
    int currLoc = 0;
    while (iter.hasNext()) {
        try {/*from  ww  w . j a v a 2  s. c  o  m*/
            BusinessEntity en = ScoutJaxrUddiHelper.getBusinessEntityFromJAXROrg((Organization) iter.next());
            entityarr[currLoc] = en;
            currLoc++;
        } catch (ClassCastException ce) {
            throw new UnexpectedObjectException();
        }
    }
    log.debug("Method:save_business: ENlength=" + entityarr.length);
    // Save business
    BusinessDetail bd = null;
    try {
        bd = (BusinessDetail) executeOperation(entityarr, "SAVE_ORG");
    } catch (RegistryException e) {
        exceptions.add(new SaveException(e.getLocalizedMessage()));
        bulk.setStatus(JAXRResponse.STATUS_FAILURE);
        bulk.setExceptions(exceptions);
        return bulk;
    }

    List<BusinessEntity> bizEntityList = bd.getBusinessEntity();

    entityarr = new BusinessEntity[bizEntityList.size()];
    bizEntityList.toArray(entityarr);

    log.debug("After Saving Business. Obtained vector size:" + entityarr != null ? entityarr.length : 0);
    for (int i = 0; entityarr != null && i < entityarr.length; i++) {
        BusinessEntity entity = (BusinessEntity) entityarr[i];
        coll.add(new KeyImpl(entity.getBusinessKey()));
    }

    bulk.setCollection(coll);
    bulk.setExceptions(exceptions);

    return bulk;
}

From source file:org.apache.ws.scout.registry.BusinessLifeCycleManagerImpl.java

public BulkResponse saveServiceBindings(Collection bindings) throws JAXRException {
    BulkResponseImpl bulk = new BulkResponseImpl();
    BindingTemplate[] sbarr = new BindingTemplate[bindings.size()];

    LinkedHashSet<Key> coll = new LinkedHashSet<Key>();
    Collection<Exception> exceptions = new ArrayList<Exception>();

    Iterator iter = bindings.iterator();
    int currLoc = 0;
    while (iter.hasNext()) {
        try {/*from  w  ww.  j a  v a2 s  .c om*/
            BindingTemplate bs = ScoutJaxrUddiHelper.getBindingTemplateFromJAXRSB((ServiceBinding) iter.next());
            sbarr[currLoc] = bs;
            currLoc++;
        } catch (ClassCastException ce) {
            throw new UnexpectedObjectException();
        }
    }
    // Save ServiceBinding
    BindingDetail bd = null;
    try {
        bd = (BindingDetail) executeOperation(sbarr, "SAVE_SERVICE_BINDING");
    } catch (RegistryException e) {
        exceptions.add(new SaveException(e.getLocalizedMessage()));
        bulk.setStatus(JAXRResponse.STATUS_FAILURE);
        return bulk;
    }

    List<BindingTemplate> bindingTemplateList = bd.getBindingTemplate();
    sbarr = new BindingTemplate[bindingTemplateList.size()];
    bindingTemplateList.toArray(sbarr);

    for (int i = 0; sbarr != null && i < sbarr.length; i++) {
        BindingTemplate bt = (BindingTemplate) sbarr[i];
        coll.add(new KeyImpl(bt.getBindingKey()));
    }
    if (coll.size() > 0) {
        bulk.setCollection(coll);
    }
    bulk.setExceptions(exceptions);

    return bulk;
}

From source file:org.apache.ws.scout.registry.BusinessLifeCycleManagerImpl.java

public BulkResponse saveServices(Collection services) throws JAXRException {
    BulkResponseImpl bulk = new BulkResponseImpl();
    BusinessService[] sarr = new BusinessService[services.size()];

    LinkedHashSet<Key> coll = new LinkedHashSet<Key>();
    Collection<Exception> exceptions = new ArrayList<Exception>();

    Iterator iter = services.iterator();
    int currLoc = 0;
    while (iter.hasNext()) {
        try {/*from   ww  w  . j a  v  a2 s. c  o  m*/
            BusinessService bs = ScoutJaxrUddiHelper.getBusinessServiceFromJAXRService((Service) iter.next());
            sarr[currLoc] = bs;
            currLoc++;
        } catch (ClassCastException ce) {
            throw new UnexpectedObjectException();
        }
    }
    // Save Service
    ServiceDetail sd = null;
    try {
        sd = (ServiceDetail) executeOperation(sarr, "SAVE_SERVICE");
    } catch (RegistryException e) {
        exceptions.add(new SaveException(e.getLocalizedMessage()));
        bulk.setStatus(JAXRResponse.STATUS_FAILURE);
        return bulk;
    }

    List<BusinessService> bizServiceList = sd.getBusinessService();
    sarr = new BusinessService[bizServiceList.size()];
    bizServiceList.toArray(sarr);

    for (int i = 0; sarr != null && i < sarr.length; i++) {
        BusinessService entity = (BusinessService) sarr[i];
        coll.add(new KeyImpl(entity.getServiceKey()));
    }
    bulk.setCollection(coll);
    bulk.setExceptions(exceptions);

    return bulk;
}

From source file:org.apache.ws.scout.registry.BusinessQueryManagerImpl.java

/**
 *  TODO - need to support the qualifiers
 *
 * @param findQualifiers//from  www .  j a v  a2s .  c om
 * @param namePatterns
 * @return ClassificationScheme
 * @throws JAXRException
 */
public ClassificationScheme findClassificationSchemeByName(Collection findQualifiers, String namePatterns)
        throws JAXRException {
    ClassificationScheme scheme = null;

    if (namePatterns.indexOf("uddi-org:types") != -1) {

        scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
        scheme.setName(new InternationalStringImpl(namePatterns));
        scheme.setKey(new KeyImpl(Constants.TMODEL_TYPES_TMODEL_KEY));
    } else if (namePatterns.indexOf("dnb-com:D-U-N-S") != -1) {

        scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
        scheme.setName(new InternationalStringImpl(namePatterns));
        scheme.setKey(new KeyImpl(Constants.TMODEL_D_U_N_S_TMODEL_KEY));
    } else if (namePatterns.indexOf("uddi-org:iso-ch:3166:1999") != -1) {
        scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
        scheme.setName(new InternationalStringImpl(namePatterns));
        scheme.setKey(new KeyImpl(Constants.TMODEL_ISO_CH_TMODEL_KEY));
    } else if (namePatterns.indexOf("uddi-org:iso-ch:3166-1999") != -1) {
        scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
        scheme.setName(new InternationalStringImpl(namePatterns));
        scheme.setKey(new KeyImpl(Constants.TMODEL_ISO_CH_TMODEL_KEY));
    } else if (namePatterns.indexOf("iso-ch:3166:1999") != -1) {
        scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
        scheme.setName(new InternationalStringImpl(namePatterns));
        scheme.setKey(new KeyImpl(Constants.TMODEL_ISO_CH_TMODEL_KEY));
    } else if (namePatterns.indexOf("iso-ch:3166-1999") != -1) {
        scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
        scheme.setName(new InternationalStringImpl(namePatterns));
        scheme.setKey(new KeyImpl(Constants.TMODEL_ISO_CH_TMODEL_KEY));
    } else if (namePatterns.indexOf("unspsc-org:unspsc") != -1) {

        scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
        scheme.setName(new InternationalStringImpl(namePatterns));
        scheme.setKey(new KeyImpl(Constants.TMODEL_UNSPSC_TMODEL_KEY));
    } else if (namePatterns.indexOf("ntis-gov:naics") != -1) {

        scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
        scheme.setName(new InternationalStringImpl(namePatterns));
        scheme.setKey(new KeyImpl(Constants.TMODEL_NAICS_TMODEL_KEY));
    } else { //TODO:Before going to the registry, check if it a predefined Enumeration

        /*
         * predefined Enumerations
         */

        if ("AssociationType".equals(namePatterns)) {
            scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());

            scheme.setName(new InternationalStringImpl(namePatterns));

            scheme.setKey(new KeyImpl(Constants.TMODEL_UNSPSC_TMODEL_KEY));

            addChildConcept((ClassificationSchemeImpl) scheme, "RelatedTo");
            addChildConcept((ClassificationSchemeImpl) scheme, "HasChild");
            addChildConcept((ClassificationSchemeImpl) scheme, "HasMember");
            addChildConcept((ClassificationSchemeImpl) scheme, "HasParent");
            addChildConcept((ClassificationSchemeImpl) scheme, "ExternallyLinks");
            addChildConcept((ClassificationSchemeImpl) scheme, "Contains");
            addChildConcept((ClassificationSchemeImpl) scheme, "EquivalentTo");
            addChildConcept((ClassificationSchemeImpl) scheme, "Extends");
            addChildConcept((ClassificationSchemeImpl) scheme, "Implements");
            addChildConcept((ClassificationSchemeImpl) scheme, "InstanceOf");
            addChildConcept((ClassificationSchemeImpl) scheme, "Supersedes");
            addChildConcept((ClassificationSchemeImpl) scheme, "Uses");
            addChildConcept((ClassificationSchemeImpl) scheme, "Replaces");
            addChildConcept((ClassificationSchemeImpl) scheme, "ResponsibleFor");
            addChildConcept((ClassificationSchemeImpl) scheme, "SubmitterOf");
        } else if ("ObjectType".equals(namePatterns)) {
            scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());

            scheme.setName(new InternationalStringImpl(namePatterns));

            scheme.setKey(new KeyImpl(Constants.TMODEL_UNSPSC_TMODEL_KEY));

            addChildConcept((ClassificationSchemeImpl) scheme, "CPP");
            addChildConcept((ClassificationSchemeImpl) scheme, "CPA");
            addChildConcept((ClassificationSchemeImpl) scheme, "Process");
            addChildConcept((ClassificationSchemeImpl) scheme, "WSDL");
            addChildConcept((ClassificationSchemeImpl) scheme, "Association");
            addChildConcept((ClassificationSchemeImpl) scheme, "AuditableEvent");
            addChildConcept((ClassificationSchemeImpl) scheme, "Classification");
            addChildConcept((ClassificationSchemeImpl) scheme, "Concept");
            addChildConcept((ClassificationSchemeImpl) scheme, "ExternalIdentifier");
            addChildConcept((ClassificationSchemeImpl) scheme, "ExternalLink");
            addChildConcept((ClassificationSchemeImpl) scheme, "ExtrinsicObject");
            addChildConcept((ClassificationSchemeImpl) scheme, "Organization");
            addChildConcept((ClassificationSchemeImpl) scheme, "Package");
            addChildConcept((ClassificationSchemeImpl) scheme, "Service");
            addChildConcept((ClassificationSchemeImpl) scheme, "ServiceBinding");
            addChildConcept((ClassificationSchemeImpl) scheme, "User");
        } else if ("PhoneType".equals(namePatterns)) {
            scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());

            scheme.setName(new InternationalStringImpl(namePatterns));

            scheme.setKey(new KeyImpl(Constants.TMODEL_UNSPSC_TMODEL_KEY));

            addChildConcept((ClassificationSchemeImpl) scheme, "OfficePhone");
            addChildConcept((ClassificationSchemeImpl) scheme, "HomePhone");
            addChildConcept((ClassificationSchemeImpl) scheme, "MobilePhone");
            addChildConcept((ClassificationSchemeImpl) scheme, "Beeper");
            addChildConcept((ClassificationSchemeImpl) scheme, "FAX");
        } else if ("URLType".equals(namePatterns)) {
            scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());

            scheme.setName(new InternationalStringImpl(namePatterns));

            scheme.setKey(new KeyImpl(Constants.TMODEL_UNSPSC_TMODEL_KEY));

            addChildConcept((ClassificationSchemeImpl) scheme, "HTTP");
            addChildConcept((ClassificationSchemeImpl) scheme, "HTTPS");
            addChildConcept((ClassificationSchemeImpl) scheme, "SMTP");
            addChildConcept((ClassificationSchemeImpl) scheme, "PHONE");
            addChildConcept((ClassificationSchemeImpl) scheme, "FAX");
            addChildConcept((ClassificationSchemeImpl) scheme, "OTHER");
        } else if ("PostalAddressAttributes".equals(namePatterns)) {
            scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());

            scheme.setName(new InternationalStringImpl(namePatterns));

            scheme.setKey(new KeyImpl(Constants.TMODEL_UNSPSC_TMODEL_KEY));

            addChildConcept((ClassificationSchemeImpl) scheme, "StreetNumber");
            addChildConcept((ClassificationSchemeImpl) scheme, "Street");
            addChildConcept((ClassificationSchemeImpl) scheme, "City");
            addChildConcept((ClassificationSchemeImpl) scheme, "State");
            addChildConcept((ClassificationSchemeImpl) scheme, "PostalCode");
            addChildConcept((ClassificationSchemeImpl) scheme, "Country");
        } else {

            //Lets ask the uddi registry if it has the TModels
            IRegistry registry = (IRegistry) registryService.getRegistry();
            FindQualifiers juddiFindQualifiers = mapFindQualifiers(findQualifiers);
            try {
                //We are looking for one exact match, so getting upto 3 records is fine
                TModelList list = registry.findTModel(namePatterns, null, null, juddiFindQualifiers, 3);
                if (list != null) {
                    TModelInfos infos = list.getTModelInfos();
                    if (infos != null) {
                        List<TModelInfo> tmodelInfoList = infos.getTModelInfo();
                        if (tmodelInfoList.size() > 1) {
                            throw new InvalidRequestException(
                                    "Multiple matches found:" + tmodelInfoList.size());
                        }
                        if (tmodelInfoList.size() == 1) {
                            TModelInfo info = tmodelInfoList.get(0);
                            scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl());
                            scheme.setName(new InternationalStringImpl(info.getName().getValue()));
                            scheme.setKey(new KeyImpl(info.getTModelKey()));
                        }
                    }
                }

            } catch (RegistryException e) {
                throw new JAXRException(e.getLocalizedMessage());
            }
        }
    }
    return scheme;
}

From source file:org.apache.ws.scout.registry.BusinessQueryManagerImpl.java

public BulkResponse findConcepts(Collection findQualifiers, Collection namePatterns, Collection classifications,
        Collection externalIdentifiers, Collection externalLinks) throws JAXRException {
    LinkedHashSet<Concept> col = new LinkedHashSet<Concept>();

    //Lets ask the uddi registry if it has the TModels
    IRegistry registry = (IRegistry) registryService.getRegistry();
    FindQualifiers juddiFindQualifiers = mapFindQualifiers(findQualifiers);
    Iterator iter = null;//from  w w w  .  ja  va  2s . c  o  m
    if (namePatterns != null)
        iter = namePatterns.iterator();
    while (iter.hasNext()) {
        String namestr = (String) iter.next();
        try {
            TModelList list = registry.findTModel(namestr,
                    ScoutJaxrUddiHelper.getCategoryBagFromClassifications(classifications),
                    ScoutJaxrUddiHelper.getIdentifierBagFromExternalIdentifiers(externalIdentifiers),
                    juddiFindQualifiers, 10);

            if (list != null && list.getTModelInfos() != null) {
                List<TModelInfo> tmodelInfoList = list.getTModelInfos().getTModelInfo();
                if (tmodelInfoList != null) {
                    for (TModelInfo info : tmodelInfoList) {
                        col.add(ScoutUddiJaxrHelper.getConcept(info,
                                this.registryService.getBusinessLifeCycleManager()));
                    }
                }
            }
        } catch (RegistryException e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    }

    return new BulkResponseImpl(col);
}

From source file:org.apache.ws.scout.registry.BusinessQueryManagerImpl.java

public BulkResponse findServiceBindings(Key serviceKey, Collection findQualifiers, Collection classifications,
        Collection specifications) throws JAXRException {
    BulkResponseImpl blkRes = new BulkResponseImpl();

    IRegistry iRegistry = (IRegistry) registryService.getRegistry();
    FindQualifiers juddiFindQualifiers = mapFindQualifiers(findQualifiers);

    try {/*from   ww  w .j a  va2  s. c  om*/

        BindingDetail bindingDetail = iRegistry.findBinding(serviceKey.getId(),
                ScoutJaxrUddiHelper.getCategoryBagFromClassifications(classifications),
                ScoutJaxrUddiHelper.getTModelBagFromSpecifications(specifications), juddiFindQualifiers,
                registryService.getMaxRows());

        /*
         * now convert  from jUDDI ServiceInfo objects to JAXR Services
         */
        if (bindingDetail != null) {

            List<BindingTemplate> bindingTemplateList = bindingDetail.getBindingTemplate();
            BindingTemplate[] bindarr = new BindingTemplate[bindingTemplateList.size()];
            bindingTemplateList.toArray(bindarr);

            LinkedHashSet<ServiceBinding> col = new LinkedHashSet<ServiceBinding>();

            for (int i = 0; bindarr != null && i < bindarr.length; i++) {
                BindingTemplate si = bindarr[i];
                ServiceBinding sb = ScoutUddiJaxrHelper.getServiceBinding(si,
                        registryService.getBusinessLifeCycleManager());
                col.add(sb);
                //Fill the Service object by making a call to registry
                Service s = (Service) getRegistryObject(serviceKey.getId(), LifeCycleManager.SERVICE);
                ((ServiceBindingImpl) sb).setService(s);
            }

            blkRes.setCollection(col);
        }
    } catch (RegistryException e) {
        throw new JAXRException(e.getLocalizedMessage());
    }

    return blkRes;
}

From source file:org.apache.ws.scout.registry.BusinessQueryManagerImpl.java

/**
 * Finds all Service objects that match all of the criteria specified by
 * the parameters of this call.  This is a logical AND operation between
 * all non-null parameters//  ww w.  j  a  va2  s  .co m
 *
 * TODO - support findQualifiers, classifications and specifications
 *
 * @param orgKey
 * @param findQualifiers
 * @param namePatterns
 * @param classifications
 * @param specificationa
 * @return BulkResponse
 * @throws JAXRException
 */
public BulkResponse findServices(Key orgKey, Collection findQualifiers, Collection namePatterns,
        Collection classifications, Collection specificationa) throws JAXRException {
    BulkResponseImpl blkRes = new BulkResponseImpl();

    IRegistry iRegistry = (IRegistry) registryService.getRegistry();
    FindQualifiers juddiFindQualifiers = mapFindQualifiers(findQualifiers);
    Name[] juddiNames = mapNamePatterns(namePatterns);

    try {
        /*
         * hit the registry.  The key is not required for UDDI2
         */

        String id = null;

        if (orgKey != null) {
            id = orgKey.getId();
        }

        ServiceList serviceList = iRegistry.findService(id, juddiNames,
                ScoutJaxrUddiHelper.getCategoryBagFromClassifications(classifications), null,
                juddiFindQualifiers, registryService.getMaxRows());

        /*
         * now convert  from jUDDI ServiceInfo objects to JAXR Services
         */
        if (serviceList != null) {

            ServiceInfos serviceInfos = serviceList.getServiceInfos();
            LinkedHashSet<Service> col = new LinkedHashSet<Service>();

            if (serviceInfos != null && serviceInfos.getServiceInfo() != null) {
                for (ServiceInfo si : serviceInfos.getServiceInfo()) {
                    Service srv = (Service) getRegistryObject(si.getServiceKey(), LifeCycleManager.SERVICE);
                    col.add(srv);
                }

            }
            blkRes.setCollection(col);
        }
    } catch (RegistryException e) {
        throw new JAXRException(e.getLocalizedMessage());
    }

    return blkRes;
}

From source file:org.apache.ws.scout.registry.BusinessQueryManagerImpl.java

public RegistryObject getRegistryObject(String id, String objectType) throws JAXRException {
    IRegistry registry = (IRegistry) registryService.getRegistry();
    BusinessLifeCycleManager lcm = registryService.getBusinessLifeCycleManager();

    if (LifeCycleManager.CLASSIFICATION_SCHEME.equalsIgnoreCase(objectType)) {

        try {//from  w  w  w . j av a2 s  .c o m

            TModelDetail tmodeldetail = registry.getTModelDetail(id);
            Concept c = ScoutUddiJaxrHelper.getConcept(tmodeldetail, lcm);

            /*
             * now turn into a concrete ClassificationScheme
             */

            ClassificationScheme scheme = new ClassificationSchemeImpl(lcm);

            scheme.setName(c.getName());
            scheme.setDescription(c.getDescription());
            scheme.setKey(c.getKey());

            return scheme;
        } catch (RegistryException e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(objectType)) {
        try {
            BusinessDetail orgdetail = registry.getBusinessDetail(id);
            return ScoutUddiJaxrHelper.getOrganization(orgdetail, lcm);
        } catch (RegistryException e) {
            throw new JAXRException(e.getLocalizedMessage());
        }

    } else if (LifeCycleManager.CONCEPT.equalsIgnoreCase(objectType)) {

        try {
            TModelDetail tmodeldetail = registry.getTModelDetail(id);
            return ScoutUddiJaxrHelper.getConcept(tmodeldetail, lcm);
        } catch (RegistryException e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.SERVICE.equalsIgnoreCase(objectType)) {

        try {
            ServiceDetail sd = registry.getServiceDetail(id);
            if (sd != null && sd.getBusinessService() != null) {
                for (BusinessService businessService : sd.getBusinessService()) {
                    Service service = getServiceFromBusinessService(businessService, lcm);
                    return service;
                }
            }
        } catch (RegistryException e) {
            throw new RuntimeException(e);
        }
    }

    return null;
}