Example usage for javax.xml.registry LifeCycleManager CLASSIFICATION_SCHEME

List of usage examples for javax.xml.registry LifeCycleManager CLASSIFICATION_SCHEME

Introduction

In this page you can find the example usage for javax.xml.registry LifeCycleManager CLASSIFICATION_SCHEME.

Prototype

String CLASSIFICATION_SCHEME

To view the source code for javax.xml.registry LifeCycleManager CLASSIFICATION_SCHEME.

Click Source Link

Document

Constant representing the javax.xml.registry.infomodel.ClassificationScheme interface.

Usage

From source file:it.cnr.icar.eric.client.ui.thin.RegistryObjectCollectionBean.java

/** Initialize status types */
private List<SelectItem> loadStatusType_SelectItems() {
    // init items list with label item
    List<SelectItem> itemsList = new ArrayList<SelectItem>();
    itemsList.add(0, new SelectItem("", WebUIResourceBundle.getInstance().getString("selectStatusType")));
    try {/* w  ww  .  j  a  v a  2  s. com*/
        ClassificationScheme statusTypeScheme = (ClassificationScheme) RegistryBrowser.getBQM()
                .getRegistryObject(CanonicalConstants.CANONICAL_CLASSIFICATION_SCHEME_ID_StatusType,
                        LifeCycleManager.CLASSIFICATION_SCHEME);

        for (Iterator<?> it = statusTypeScheme.getChildrenConcepts().iterator(); it.hasNext();) {
            ConceptImpl concept = (ConceptImpl) it.next();
            createStatusTypeSelectItems(itemsList, concept, 0);
        }
    } catch (Exception ex) {
        log.error(WebUIResourceBundle.getInstance().getString("message.FailedToRetrieveStatusTypeConcepts"),
                ex);
        RegistryBrowser.getInstance()
                .setErrorMessage(WebUIResourceBundle.getInstance().getString("errorRetrivalOfStausTypes"));
    }
    return itemsList;
}

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

/**
 * Deletes one or more previously submitted objects from the registry
 * using the object keys and a specified objectType attribute.
 *
 * @param keys//from   ww w. ja  va2 s  .  co  m
 * @param objectType
 * @return BulkResponse object
 * @throws JAXRException
 */
public BulkResponse deleteObjects(Collection keys, String objectType) throws JAXRException {
    BulkResponse bulk = null;

    if (objectType == LifeCycleManager.ASSOCIATION) {
        bulk = this.deleteAssociations(keys);
    } else if (objectType == LifeCycleManager.CLASSIFICATION_SCHEME) {
        bulk = this.deleteClassificationSchemes(keys);
    } else if (objectType == LifeCycleManager.CONCEPT) {
        bulk = this.deleteConcepts(keys);
    } else if (objectType == LifeCycleManager.ORGANIZATION) {
        bulk = this.deleteOrganizations(keys);
    } else if (objectType == LifeCycleManager.SERVICE) {
        bulk = this.deleteServices(keys);
    } else if (objectType == LifeCycleManager.SERVICE_BINDING) {
        bulk = this.deleteServiceBindings(keys);
    } else {
        throw new JAXRException("Delete Operation for " + objectType + " not implemented by Scout");
    }

    return bulk;
}

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 ww  .jav a  2s . 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;
}

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

public BulkResponse getRegistryObjects(Collection objectKeys, String objectType) throws JAXRException {
    IRegistry registry = (IRegistry) registryService.getRegistry();
    //Convert into a vector of strings
    String[] keys = new String[objectKeys.size()];
    int currLoc = 0;
    for (Key key : (Collection<Key>) objectKeys) {
        keys[currLoc] = key.getId();/*from  ww w  .j av a  2 s .c  om*/
        currLoc++;
    }
    LinkedHashSet<RegistryObject> col = new LinkedHashSet<RegistryObject>();
    LifeCycleManager lcm = registryService.getLifeCycleManagerImpl();

    if (LifeCycleManager.CLASSIFICATION_SCHEME.equalsIgnoreCase(objectType)) {
        try {
            TModelDetail tmodeldetail = registry.getTModelDetail(keys);
            List<TModel> tmodelList = tmodeldetail.getTModel();

            for (TModel tModel : tmodelList) {
                col.add(ScoutUddiJaxrHelper.getConcept(tModel, lcm));
            }

        } catch (RegistryException e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(objectType)) {
        ConnectionImpl con = ((RegistryServiceImpl) getRegistryService()).getConnection();
        AuthToken auth = this.getAuthToken(con, registry);

        try {
            RegisteredInfo ri = null;
            try {
                ri = registry.getRegisteredInfo(auth.getAuthInfo());
            } catch (RegistryException rve) {
                String username = getUsernameFromCredentials(con.getCredentials());
                if (AuthTokenSingleton.getToken(username) != null) {
                    AuthTokenSingleton.deleteAuthToken(username);
                }
                auth = getAuthToken(con, registry);
                ri = registry.getRegisteredInfo(auth.getAuthInfo());
            }

            if (ri != null) {
                for (String key : keys) {
                    BusinessDetail detail = registry.getBusinessDetail(key);
                    col.add(((BusinessLifeCycleManagerImpl) registryService.getLifeCycleManagerImpl())
                            .createOrganization(detail));
                }

            }
        } catch (RegistryException e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.CONCEPT.equalsIgnoreCase(objectType)) {
        try {
            TModelDetail tmodeldetail = registry.getTModelDetail(keys);
            List<TModel> tmodelList = tmodeldetail.getTModel();

            for (TModel tmodel : tmodelList) {
                col.add(ScoutUddiJaxrHelper.getConcept(tmodel, lcm));
            }

        } catch (RegistryException e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.SERVICE.equalsIgnoreCase(objectType)) {

        try {
            ServiceDetail serviceDetail = registry.getServiceDetail(keys);

            if (serviceDetail != null) {
                List<BusinessService> bizServiceList = serviceDetail.getBusinessService();

                for (BusinessService businessService : bizServiceList) {

                    Service service = getServiceFromBusinessService(businessService, lcm);

                    col.add(service);
                }
            }
        } catch (RegistryException e) {
            throw new JAXRException(e);
        }
    } else {
        throw new JAXRException("Unsupported type " + objectType + " for getRegistryObjects() in Apache Scout");
    }

    return new BulkResponseImpl(col);

}

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

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

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

        try {/*from   ww w  . j  a  v a2  s . co  m*/

            TModelDetail tmodeldetail = registry.getTModelDetail(id);
            Concept c = ScoutUddiV3JaxrHelper.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 (RegistryV3Exception e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(objectType)) {
        try {
            BusinessDetail orgdetail = registry.getBusinessDetail(id);
            return ScoutUddiV3JaxrHelper.getOrganization(orgdetail, lcm);
        } catch (RegistryV3Exception e) {
            throw new JAXRException(e.getLocalizedMessage());
        }

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

        try {
            TModelDetail tmodeldetail = registry.getTModelDetail(id);
            return ScoutUddiV3JaxrHelper.getConcept(tmodeldetail, lcm);
        } catch (RegistryV3Exception 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 (RegistryV3Exception e) {
            throw new RuntimeException(e);
        }
    }

    return null;
}

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

public BulkResponse getRegistryObjects(Collection objectKeys, String objectType) throws JAXRException {
    IRegistryV3 registry = (IRegistryV3) registryService.getRegistry();
    //Convert into a vector of strings
    String[] keys = new String[objectKeys.size()];
    int currLoc = 0;
    for (Key key : (Collection<Key>) objectKeys) {
        String keyString = key.getId();
        keys[currLoc++] = keyString;//from  w ww .  j a  va 2 s .  c  o m
    }
    LinkedHashSet<RegistryObject> col = new LinkedHashSet<RegistryObject>();
    LifeCycleManager lcm = registryService.getLifeCycleManagerImpl();

    if (LifeCycleManager.CLASSIFICATION_SCHEME.equalsIgnoreCase(objectType)) {
        try {
            TModelDetail tmodeldetail = registry.getTModelDetail(keys);
            List<TModel> tmodelList = tmodeldetail.getTModel();

            for (TModel tModel : tmodelList) {
                col.add(ScoutUddiV3JaxrHelper.getConcept(tModel, lcm));
            }

        } catch (RegistryV3Exception e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(objectType)) {
        ConnectionImpl con = ((RegistryServiceImpl) getRegistryService()).getConnection();
        AuthToken auth = this.getAuthToken(con, registry);

        try {
            RegisteredInfo ri = null;
            try {
                ri = registry.getRegisteredInfo(auth.getAuthInfo());
            } catch (RegistryV3Exception rve) {
                String username = getUsernameFromCredentials(con.getCredentials());
                if (AuthTokenV3Singleton.getToken(username) != null) {
                    AuthTokenV3Singleton.deleteAuthToken(username);
                }
                auth = getAuthToken(con, registry);
                ri = registry.getRegisteredInfo(auth.getAuthInfo());
            }

            if (ri != null) {
                BusinessInfos infos = ri.getBusinessInfos();
                if (infos != null) {
                    for (String key : keys) {
                        BusinessDetail detail = registry.getBusinessDetail(key);
                        col.add(((BusinessLifeCycleManagerV3Impl) registryService.getLifeCycleManagerImpl())
                                .createOrganization(detail));
                    }
                }
            }
        } catch (RegistryV3Exception e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.CONCEPT.equalsIgnoreCase(objectType)) {
        try {
            TModelDetail tmodeldetail = registry.getTModelDetail(keys);
            List<TModel> tmodelList = tmodeldetail.getTModel();

            for (TModel tmodel : tmodelList) {
                col.add(ScoutUddiV3JaxrHelper.getConcept(tmodel, lcm));
            }

        } catch (RegistryV3Exception e) {
            throw new JAXRException(e.getLocalizedMessage());
        }
    } else if (LifeCycleManager.SERVICE.equalsIgnoreCase(objectType)) {

        try {
            ServiceDetail serviceDetail = registry.getServiceDetail(keys);

            if (serviceDetail != null) {
                List<BusinessService> bizServiceList = serviceDetail.getBusinessService();

                for (BusinessService businessService : bizServiceList) {

                    Service service = getServiceFromBusinessService(businessService, lcm);

                    col.add(service);
                }
            }
        } catch (RegistryV3Exception e) {
            throw new JAXRException(e);
        }
    } else {
        throw new JAXRException("Unsupported type " + objectType + " for getRegistryObjects() in Apache Scout");
    }

    return new BulkResponseImpl(col);

}