Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.kie.remote.services.rest;
  
  import java.util.Map;
  
  import  javax.enterprise.context.RequestScoped;
  import  javax.inject.Inject;
  import javax.ws.rs.GET;
  import javax.ws.rs.POST;
  import javax.ws.rs.Path;
 
 import  org.jbpm.services.api.model.DeploymentUnit;
 import  org.kie.internal.runtime.conf.DeploymentDescriptor;
 import  org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentDescriptor;
 import  org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentJobResult;
 import  org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentUnit;
 import  org.kie.services.client.serialization.jaxb.impl.process.JaxbProcessDefinitionList;
 import  org.kie.services.client.serialization.jaxb.rest.JaxbGenericResponse;
 import  org.slf4j.Logger;
 import  org.slf4j.LoggerFactory;

This REST resource is responsible for retrieving information about and managing deployment units.
 
 @RequestScoped
 @Path("/deployment/{deploymentId: [\\w\\.-]+(:[\\w\\.-]+){2,2}(:[\\w\\.-]*){0,2}}")
 public class DeploymentResourceImpl extends ResourceBase {
 
     private static final Logger logger = LoggerFactory.getLogger(DeploymentResourceImpl.class);
     
     /* REST information */
     
     @Context
     private HttpHeaders headers;
     
     @PathParam("deploymentId")
     private String deploymentId;
     
     /* Deployment operations */
    
     @Inject 
    
     // REST operations -----------------------------------------------------------------------------------------------------------
 
    
Retrieve the status of the DeploymentUnit specified in the URL.

Returns:
A JaxbDeploymentUnit instance
 
     @GET
     public Response getConfig() { 
         JaxbDeploymentUnit jaxbDepUnit = .determineStatus(true);
         .debug("Returning deployment unit information for " + );
         return createCorrectVariant(jaxbDepUnit);
     }

    
Queues a request to deploy the given deployment unit. If the deployment already exist, this operation will fail.

Parameters:
deployDescriptor An optional DeploymentDescriptor instance specifying additional information about how the deployment unit should be deployed.
Returns:
A JaxbDeploymentJobResult instance with the initial status of the job
 
     @POST
     @Path("/deploy")
     public Response deploy(JaxbDeploymentDescriptor deployDescriptor) {
         // parse request/options 
         Map<StringString []> params = getRequestParams();
         String oper = getRelativePath();
         String strategy = getStringParam("strategy"falseparamsoper);
         String mergeMode = getStringParam("mergemode"falseparamsoper);
         
         // schedule deployment
         JaxbDeploymentJobResult jobResult = .submitDeployJob(strategymergeModedeployDescriptor);
         return createCorrectVariant(jobResult.);
     }
   
    
Queues a request to undeploy the deployment unit specified in the URL

Returns:
A JaxbDeploymentJobResult instance with the initial status of the job
 
     @POST
     @Path("/undeploy")
     public Response undeploy() { 
         JaxbDeploymentJobResult jobResult = .submitUndeployJob();
         return createCorrectVariant(jobResult.);
     }
   

    
Returns a list of process definitions for the specified deployment.

Returns:
A JaxbProcessDefinitionList instance
    @GET
    @Path("/processes")
    public Response listProcessDefinitions() { 
        String oper = getRelativePath();
        Map<StringString[]> params = getRequestParams();
        int [] pageInfo = getPageNumAndPageSize(paramsoper);
        int maxNumResults = getMaxNumResultsNeeded(pageInfo); 
        
        JaxbProcessDefinitionList jaxbProcDefList  = new JaxbProcessDefinitionList();
        .fillProcessDefinitionList(pageInfomaxNumResultsjaxbProcDefList.getProcessDefinitionList());
        JaxbProcessDefinitionList resultList 
            = paginateAndCreateResult(pageInfojaxbProcDefList.getProcessDefinitionList(), new JaxbProcessDefinitionList());
        return createCorrectVariant(resultList);
    }
    @POST
    @Path("/activate")
    public Response activate() {
        return createCorrectVariant(new JaxbGenericResponse(getRequestUri()), );
    }
    @POST
    @Path("/deactivate")
    public Response deactivate() {
        return createCorrectVariant(new JaxbGenericResponse(getRequestUri()), );
    }
New to GrepCode? Check out our FAQ X