Package javax.xml.registry

Examples of javax.xml.registry.BulkResponse


        try {
            ArrayList names = new ArrayList();
            names.add(match);
            Collection fQualifiers = new ArrayList();
            fQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
            BulkResponse br = bqm.findOrganizations(fQualifiers,
                    names, null, null, null, null);
            if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
                System.out.println("Successfully queried the  registry");
                System.out.println("for organizations matching the " +
                        "name pattern: \"" + match + "\"");
                Collection orgs = br.getCollection();
                System.out.println("Results found: " + orgs.size() + "\n");
                Iterator iter = orgs.iterator();
                while (iter.hasNext()) {
                    Organization org = (Organization) iter.next();
                    keys.add(org.getKey());
                }
            } else {
                System.err.println("One or more JAXRExceptions " +
                        "occurred during the query operation:");
                Collection exceptions = br.getExceptions();
                Iterator iter = exceptions.iterator();
                while (iter.hasNext()) {
                    Exception e = (Exception) iter.next();
                    System.err.println(e.toString());
                }
View Full Code Here


            String qname = "%";
            names.add(qname);
            Collection fQualifiers = new ArrayList();
            fQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
            Key key = new KeyImpl("67AB9FD0-C3D9-11D8-BC4B-D52B9593C1C0");
            BulkResponse br = bqm.findServices(key, fQualifiers,
                    names, null, null);
            if (br != null &&
                    br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
                System.out.println("Successfully queried the  registry");
                System.out.println("for services matching the " +
                        "name pattern: \"" + qname + "\"");
                Collection sers = br.getCollection();
                System.out.println("Results found: " + sers.size() + "\n");
                Iterator iter = sers.iterator();
                while (iter.hasNext()) {
                    Service s = (Service) iter.next();
                    System.out.println("Service Name: " +
                            getName(s));
                    System.out.println("Service Key: " +
                            s.getKey().getId());
                    System.out.println("Organization Description: " +
                            getDescription(s));
                }
            } else {
                System.err.println("One or more JAXRExceptions " +
                        "occurred during the query operation:");
                Collection exceptions = br.getExceptions();
                Iterator iter = exceptions.iterator();
                while (iter.hasNext()) {
                    Exception e = (Exception) iter.next();
                    System.err.println(e.toString());
                }
View Full Code Here

            //String qname= "%S%";
            String qname = "%";
            names.add(qname);
            Collection fQualifiers = new ArrayList();
            fQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
            BulkResponse br = bqm.findOrganizations(fQualifiers,
                    names, null, null, null, null);
            if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
                System.out.println("Successfully queried the  registry");
                System.out.println("for organizations matching the " +
                        "name pattern: \"" + qname + "\"");
                Collection orgs = br.getCollection();
                System.out.println("Results found: " + orgs.size() + "\n");
                Iterator iter = orgs.iterator();
                while (iter.hasNext()) {
                    Organization org = (Organization) iter.next();
                    System.out.println("Organization Name: " +
                            getName(org));
                    System.out.println("Organization Key: " +
                            org.getKey().getId());
                    System.out.println("Organization Description: " +
                            getDescription(org));
                    Collection services = org.getServices();
                    Iterator siter = services.iterator();
                    while (siter.hasNext()) {
                        Service service = (Service) siter.next();
                        System.out.println("\tService Name: " +
                                getName(service));
                        System.out.println("\tService Key: " +
                                service.getKey().getId());
                        System.out.println("\tService Description: " +
                                getDescription(service));
                    }
                }
            } else {
                System.err.println("One or more JAXRExceptions " +
                        "occurred during the query operation:");
                Collection exceptions = br.getExceptions();
                Iterator iter = exceptions.iterator();
                while (iter.hasNext()) {
                    Exception e = (Exception) iter.next();
                    System.err.println(e.toString());
                }
View Full Code Here

     * @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) {
View Full Code Here

        Collection<Exception> exc = new ArrayList<Exception>();

        while (iter.hasNext()) {
            RegistryObject reg = (RegistryObject) iter.next();

            BulkResponse br = null;

            Collection<RegistryObject> c = new ArrayList<RegistryObject>();
            c.add(reg);

            if (reg instanceof javax.xml.registry.infomodel.Association) {
                br = saveAssociations(c, true);
            }
            else if (reg instanceof javax.xml.registry.infomodel.ClassificationScheme) {
                br = saveClassificationSchemes(c);
            }
            else if (reg instanceof javax.xml.registry.infomodel.Concept) {
                br = saveConcepts(c);
            }
            else if (reg instanceof javax.xml.registry.infomodel.Organization) {
                br = saveOrganizations(c);
            }
            else if (reg instanceof javax.xml.registry.infomodel.Service) {
                br = saveServices(c);
            }
            else if (reg instanceof javax.xml.registry.infomodel.ServiceBinding) {
                br = saveServiceBindings(c);
            }
            else {
                throw new JAXRException("Delete Operation for " + reg.getClass()
                        + " not implemented by Scout");
            }

            if (br.getCollection() != null) {
                suc.addAll(br.getCollection());
            }

            if (br.getExceptions() != null) {
                exc.addAll(br.getExceptions());
            }
        }

        BulkResponseImpl bulk = new BulkResponseImpl();
View Full Code Here

    public void confirmAssociation(Association assoc) throws JAXRException, InvalidRequestException {
       //Store it in the UDDI registry
       HashSet<Association> col = new HashSet<Association>();
       col.add(assoc);
       BulkResponse br = this.saveAssociations(col, true);
       if(br.getExceptions()!= null)
          throw new JAXRException("Confiming the Association Failed");
    }
View Full Code Here

    public void unConfirmAssociation(Association assoc) throws JAXRException, InvalidRequestException {
       //TODO
       //Delete it from the UDDI registry
       Collection<Key> col = new ArrayList<Key>();
       col.add(assoc.getKey());
       BulkResponse br = this.deleteAssociations(col);
       if(br.getExceptions()!= null)
          throw new JAXRException("UnConfiming the Association Failed");
    }
View Full Code Here

     * @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) {
View Full Code Here

        Collection<Exception> exc = new ArrayList<Exception>();

        while (iter.hasNext()) {
            RegistryObject reg = (RegistryObject) iter.next();

            BulkResponse br = null;

            Collection<RegistryObject> c = new ArrayList<RegistryObject>();
            c.add(reg);

            if (reg instanceof javax.xml.registry.infomodel.Association) {
                br = saveAssociations(c, true);
            }
            else if (reg instanceof javax.xml.registry.infomodel.ClassificationScheme) {
                br = saveClassificationSchemes(c);
            }
            else if (reg instanceof javax.xml.registry.infomodel.Concept) {
                br = saveConcepts(c);
            }
            else if (reg instanceof javax.xml.registry.infomodel.Organization) {
                br = saveOrganizations(c);
            }
            else if (reg instanceof javax.xml.registry.infomodel.Service) {
                br = saveServices(c);
            }
            else if (reg instanceof javax.xml.registry.infomodel.ServiceBinding) {
                br = saveServiceBindings(c);
            }
            else {
                throw new JAXRException("Delete Operation for " + reg.getClass()
                        + " not implemented by Scout");
            }

            if (br.getCollection() != null) {
                suc.addAll(br.getCollection());
            }

            if (br.getExceptions() != null) {
                exc.addAll(br.getExceptions());
            }
        }

        BulkResponseImpl bulk = new BulkResponseImpl();
View Full Code Here

    public void confirmAssociation(Association assoc) throws JAXRException, InvalidRequestException {
       //Store it in the UDDI registry
       HashSet<Association> col = new HashSet<Association>();
       col.add(assoc);
       BulkResponse br = this.saveAssociations(col, true);
       if(br.getExceptions()!= null)
          throw new JAXRException("Confiming the Association Failed");
    }
View Full Code Here

TOP

Related Classes of javax.xml.registry.BulkResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.