Examples of BulkResponseImpl


Examples of com.sun.xml.registry.common.BulkResponseImpl

        */
       BulkResponse transformResponse(BusinessDetail detail,
                                             Collection keys, String type)
       throws JAXRException {

           BulkResponseImpl bResponse = null;
           if (detail != null) {
               bResponse = new BulkResponseImpl();
               Collection fbResponse = new ArrayList();
               Collection entities =
                       detail.getBusinessEntity();
               if (entities != null) {
                   Iterator iter = entities.iterator();
                   while (iter.hasNext()){
                       Organization org =
                               mapper.businessEntity2Organization((BusinessEntity)iter.next());
                       if (type.equalsIgnoreCase(mapper.FIND))
                           fbResponse.add(org);
                       else
                           fbResponse.add(org.getKey());
                   }
                   bResponse.setCollection(fbResponse);
               }
           }
           return bResponse;
       }
View Full Code Here

Examples of com.sun.xml.registry.common.BulkResponseImpl

        *
        */
       BulkResponse transformResponse(ServiceDetail detail, Collection keys, String type)
       throws JAXRException {

           BulkResponseImpl bResponse = null;
           if (detail != null) {
               bResponse = new BulkResponseImpl();
               Collection fbResponse = new ArrayList();
               //todo - why is this commented out?
               //bResponse.setPartialResponse(detail.getTruncated());
               Collection services =
                       detail.getBusinessService();
               if (services != null) {
                   Iterator iter = services.iterator();
                   while (iter.hasNext()){
                       Service service =
                               mapper.businessService2Service((BusinessService)iter.next());
                       if (type.equals(mapper.FIND)) {
                           fbResponse.add(service);
                       } else {
                           fbResponse.add(service.getKey());
                       }
                   }
                   bResponse.setCollection(fbResponse);
               }
           }
           return bResponse;
       }
View Full Code Here

Examples of com.sun.xml.registry.common.BulkResponseImpl

        */

       BulkResponse transformResponse(BindingDetail detail, Collection keys,
       String type) throws JAXRException {

           BulkResponseImpl bResponse = null;
           if (detail != null) {
               bResponse = new BulkResponseImpl();
               Collection fbResponse = new ArrayList();

               Collection templates =
                  detail.getBindingTemplate();
               Iterator iter = templates.iterator();
               while (iter.hasNext()){
                   ServiceBinding binding =
                   mapper.bindingTemplate2ServiceBinding((BindingTemplate)iter.next());
                   if (type.equals(mapper.FIND))
                       fbResponse.add(binding);
                   else
                       fbResponse.add(binding.getKey());
               }
               bResponse.setCollection(fbResponse);
           }
           return bResponse;
       }
View Full Code Here

Examples of org.apache.oozie.client.rest.BulkResponseImpl

        q.setFirstResult(start - 1);
        q.setMaxResults(len);

        List<Object[]> response = q.getResultList();
        for (Object[] r : response) {
            BulkResponseImpl br = getResponseFromObject(bundleBean, r);
            responseList.add(br);
        }
        return q.toString();
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.BulkResponseImpl

            eachTime.put("endNominal", ts);
        }
    }

    private BulkResponseImpl getResponseFromObject(BundleJobBean bundleBean, Object arr[]) {
        BulkResponseImpl bean = new BulkResponseImpl();
        CoordinatorJobBean coordBean = new CoordinatorJobBean();
        CoordinatorActionBean actionBean = new CoordinatorActionBean();
        if (arr[0] != null) {
            actionBean.setId((String) arr[0]);
        }
        if (arr[1] != null) {
            actionBean.setActionNumber((Integer) arr[1]);
        }
        if (arr[2] != null) {
            actionBean.setErrorCode((String) arr[2]);
        }
        if (arr[3] != null) {
            actionBean.setErrorMessage((String) arr[3]);
        }
        if (arr[4] != null) {
            actionBean.setExternalId((String) arr[4]);
        }
        if (arr[5] != null) {
            actionBean.setExternalStatus((String) arr[5]);
        }
        if (arr[6] != null) {
            actionBean.setStatus(CoordinatorAction.Status.valueOf((String) arr[6]));
        }
        if (arr[7] != null) {
            actionBean.setCreatedTime(DateUtils.toDate((Timestamp) arr[7]));
        }
        if (arr[8] != null) {
            actionBean.setNominalTime(DateUtils.toDate((Timestamp) arr[8]));
        }
        if (arr[9] != null) {
            actionBean.setMissingDependencies((String) arr[9]);
        }
        if (arr[10] != null) {
            coordBean.setId((String) arr[10]);
            actionBean.setJobId((String) arr[10]);
        }
        if (arr[11] != null) {
            coordBean.setAppName((String) arr[11]);
        }
        if (arr[12] != null) {
            coordBean.setStatus(CoordinatorJob.Status.valueOf((String) arr[12]));
        }
        bean.setBundle(bundleBean);
        bean.setCoordinator(coordBean);
        bean.setAction(actionBean);
        return bean;
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.BulkResponseImpl

                + "startcreatedtime=2012-07-21T00:00Z;endcreatedtime=2012-07-22T02:00Z";

        List<BulkResponseImpl> brList = _execQuery(request);
        assertEquals(1, brList.size()); // only 1 action satisfies the
                                        // conditions
        BulkResponseImpl br = brList.get(0);
        assertEquals(bundleName, br.getBundle().getAppName());
        assertEquals("Coord1", br.getCoordinator().getAppName());
        assertEquals(CoordinatorAction.Status.FAILED, br.getAction().getStatus());
        assertEquals(DateUtils.parseDateUTC(CREATE_TIME).toString(), br.getAction().getCreatedTime().toString());
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.BulkResponseImpl

        // repeatedly execute above query for each bundle
        for (BundleJobBean bundle : bundles) {
            q.setParameter("bundleId", bundle.getId());
            List<Object[]> response = q.getResultList();
            for (Object[] r : response) {
                BulkResponseImpl br = getResponseFromObject(bundle, r);
                responseList.add(br);
            }
        }
        return q.toString();
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.BulkResponseImpl

            eachTime.put("endNominal", ts);
        }
    }

    private BulkResponseImpl getResponseFromObject(BundleJobBean bundleBean, Object arr[]) {
        BulkResponseImpl bean = new BulkResponseImpl();
        CoordinatorJobBean coordBean = new CoordinatorJobBean();
        CoordinatorActionBean actionBean = new CoordinatorActionBean();
        if (arr[0] != null) {
            actionBean.setId((String) arr[0]);
        }
        if (arr[1] != null) {
            actionBean.setActionNumber((Integer) arr[1]);
        }
        if (arr[2] != null) {
            actionBean.setErrorCode((String) arr[2]);
        }
        if (arr[3] != null) {
            actionBean.setErrorMessage((String) arr[3]);
        }
        if (arr[4] != null) {
            actionBean.setExternalId((String) arr[4]);
        }
        if (arr[5] != null) {
            actionBean.setExternalStatus((String) arr[5]);
        }
        if (arr[6] != null) {
            actionBean.setStatus(CoordinatorAction.Status.valueOf((String) arr[6]));
        }
        if (arr[7] != null) {
            actionBean.setCreatedTime(DateUtils.toDate((Timestamp) arr[7]));
        }
        if (arr[8] != null) {
            actionBean.setNominalTime(DateUtils.toDate((Timestamp) arr[8]));
        }
        if (arr[9] != null) {
            actionBean.setMissingDependenciesBlob((StringBlob) arr[9]);
        }
        if (arr[10] != null) {
            coordBean.setId((String) arr[10]);
            actionBean.setJobId((String) arr[10]);
        }
        if (arr[11] != null) {
            coordBean.setAppName((String) arr[11]);
        }
        if (arr[12] != null) {
            coordBean.setStatus(CoordinatorJob.Status.valueOf((String) arr[12]));
        }
        bean.setBundle(bundleBean);
        bean.setCoordinator(coordBean);
        bean.setAction(actionBean);
        return bean;
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.BulkResponseImpl

        BulkResponseInfo response = _execQuery(request);
        List<BulkResponseImpl> brList = response.getResponses();
        assertEquals(1, brList.size()); // only 1 action satisfies the
                                        // conditions
        assertEquals(1, response.getTotal());
        BulkResponseImpl br = brList.get(0);
        assertEquals(bundleName, br.getBundle().getAppName());
        assertEquals("Coord1", br.getCoordinator().getAppName());
        assertEquals(CoordinatorAction.Status.FAILED, br.getAction().getStatus());
        assertEquals(DateUtils.parseDateUTC(CREATE_TIME).toString(), br.getAction().getCreatedTime().toString());
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.BulkResponseImpl

        BulkResponseInfo response = _execQuery(request);
        List<BulkResponseImpl> brList = response.getResponses();
        assertEquals(1, brList.size()); // only 1 action satisfies the
                                        // conditions
        assertEquals(1, response.getTotal());
        BulkResponseImpl br = brList.get(0);
        assertEquals(bundleId, br.getBundle().getId());
        assertEquals("Coord1", br.getCoordinator().getAppName());
        assertEquals(CoordinatorAction.Status.FAILED, br.getAction().getStatus());
        assertEquals(DateUtils.parseDateUTC(CREATE_TIME).toString(), br.getAction().getCreatedTime().toString());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.