Example usage for javax.xml.registry.infomodel Service getName

List of usage examples for javax.xml.registry.infomodel Service getName

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel Service getName.

Prototype

InternationalString getName() throws JAXRException;

Source Link

Document

Gets the user-friendly name of this object.

Usage

From source file:org.apache.ws.scout.util.ScoutJaxrUddiHelper.java

public static BusinessService getBusinessServiceFromJAXRService(Service service) throws JAXRException {
    BusinessService bs = objectFactory.createBusinessService();
    try {/*from w w w  . j  a va2s .co  m*/
        InternationalString iname = service.getName();

        addNames(bs.getName(), iname);

        InternationalString idesc = service.getDescription();

        addDescriptions(bs.getDescription(), idesc);

        Organization o = service.getProvidingOrganization();

        /*
         * there may not always be a key...
         */
        if (o != null) {
            Key k = o.getKey();

            if (k != null && k.getId() != null) {
                bs.setBusinessKey(k.getId());
            }

        } else {
            /*
             * gmj - I *think* this is the right thing to do
             */
            throw new JAXRException("Service has no associated organization");
        }

        if (service.getKey() != null && service.getKey().getId() != null) {
            bs.setServiceKey(service.getKey().getId());
        } else {
            bs.setServiceKey("");
        }

        CategoryBag catBag = getCategoryBagFromClassifications(service.getClassifications());
        if (catBag != null) {
            bs.setCategoryBag(catBag);
        }

        //Add the ServiceBinding information
        BindingTemplates bt = getBindingTemplates(service.getServiceBindings());
        if (bt != null) {
            bs.setBindingTemplates(bt);
        }

        log.debug("BusinessService=" + bs.toString());
    } catch (Exception ud) {
        throw new JAXRException("Apache JAXR Impl:", ud);
    }
    return bs;
}