Examples of JaxbDeploymentUnitList


Examples of org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentUnitList

    public JaxbDeploymentUnitList getDeploymentList(int [] pageInfo, int maxNumResults) {
        List<String> deploymentIds = new ArrayList<String>(deploymentInfoBean.getDeploymentIds());
        Collections.sort(deploymentIds);

        JaxbDeploymentUnitList jaxbDepUnitList = new JaxbDeploymentUnitList();
        List<JaxbDeploymentUnit> depUnitList = jaxbDepUnitList.getDeploymentUnitList();
        for( String deploymentId : deploymentIds ) {
            DeployedUnit deployedUnit = deploymentService.getDeployedUnit(deploymentId);
            if( deployedUnit != null ) {
                JaxbDeploymentUnit jaxbDepUnit = convertKModuleDepUnitToJaxbDepUnit((KModuleDeploymentUnit) deployedUnit.getDeploymentUnit());
                jaxbDepUnit.setStatus(JaxbDeploymentStatus.DEPLOYED);
                depUnitList.add(jaxbDepUnit);
                if( depUnitList.size() >= maxNumResults) {
                    // pagination parameters indicate that no more than current list is needed
                    break;
                }
            }
        }

        JaxbDeploymentUnitList resultList = paginateAndCreateResult(pageInfo, depUnitList, new JaxbDeploymentUnitList());
        return resultList;
    }
View Full Code Here

Examples of org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentUnitList

        String oper = getRelativePath();
        Map<String, String[]> params = getRequestParams();
        int [] pageInfo = getPageNumAndPageSize(params, oper);
        int maxNumResults = getMaxNumResultsNeeded(pageInfo);
       
       JaxbDeploymentUnitList resultList = deployResourceBase.getDeploymentList(pageInfo, maxNumResults);
      
        return createCorrectVariant(resultList, headers);
    }
View Full Code Here

Examples of org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentUnitList

    @Override
    public JaxbDeploymentUnitList getDeploymentInfo( DeploymentIdRequest request ) throws DeploymentWebServiceException {
        int [] pageInfo = PaginationUtil.getPageInfo(request.getPageNumber(), request.getPageSize());
        int maxNumResults = getMaxNumResultsNeeded(pageInfo);
        JaxbDeploymentUnitList jaxbDepUnitList = deployBase.getDeploymentList(pageInfo, maxNumResults);
        return jaxbDepUnitList;
    }
View Full Code Here

Examples of org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentUnitList

    @Test
    public void deploymentObjectsTest() throws Exception {
        Assume.assumeFalse(getType().equals(TestType.YAML));
       
        // for test at end, fill during test
        JaxbDeploymentUnitList depUnitList = new JaxbDeploymentUnitList();
      
        // dep jobs
        JaxbDeploymentJobResult jaxbJob = new JaxbDeploymentJobResult();
        testRoundTrip(jaxbJob);

        // complex dep jobs
        KModuleDeploymentUnit kDepUnit = new KModuleDeploymentUnit("org", "jar", "1.0", "kbase", "ksession" );
        kDepUnit.setStrategy(RuntimeStrategy.PER_PROCESS_INSTANCE);
       
        JaxbDeploymentUnit depUnit = new JaxbDeploymentUnit(kDepUnit.getGroupId(), kDepUnit.getArtifactId(), kDepUnit.getArtifactId());
        depUnit.setKbaseName(kDepUnit.getKbaseName());
        depUnit.setKsessionName(kDepUnit.getKsessionName());
        depUnit.setStrategy(kDepUnit.getStrategy());
        depUnit.setStatus(JaxbDeploymentStatus.NONEXISTENT);
        depUnitList.getDeploymentUnitList().add(depUnit);

        jaxbJob = new JaxbDeploymentJobResult(null, "test", depUnit, "deploy");
        jaxbJob.setIdentifier(23L);
        jaxbJob.setSuccess(false);
        JaxbDeploymentJobResult copyJaxbJob = testRoundTrip(jaxbJob);
        ComparePair.compareObjectsViaFields(jaxbJob, copyJaxbJob, "jobId", "identifier");
       
        depUnit = new JaxbDeploymentUnit("g", "a", "v");
        depUnit.setKbaseName("kbase");
        depUnit.setKsessionName("ksession");
        depUnit.setStatus(JaxbDeploymentStatus.DEPLOY_FAILED);
        depUnit.setStrategy(RuntimeStrategy.PER_PROCESS_INSTANCE);
        depUnitList.getDeploymentUnitList().add(depUnit);
       
        JaxbDeploymentUnit copyDepUnit = testRoundTrip(depUnit);
       
        ComparePair.compareObjectsViaFields(depUnit, copyDepUnit, "identifier");

        JaxbDeploymentJobResult depJob = new JaxbDeploymentJobResult(null, "testing stuff", copyDepUnit, "test");
        depJob.setSuccess(true);
        JaxbDeploymentJobResult copyDepJob = testRoundTrip(depJob);
       
        ComparePair.compareObjectsViaFields(copyDepJob, depJob, "jobId", "identifier");
       
        JaxbDeploymentUnitList roundTripUnitList = testRoundTrip(depUnitList);
        ComparePair.compareObjectsViaFields(depUnitList.getDeploymentUnitList().get(0), roundTripUnitList.getDeploymentUnitList().get(0), "jobId", "identifier");
    }
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.