Class ProjectResource


  • @Path("/")
    @Named
    @ApplicationScoped
    public class ProjectResource
    extends Object
    REST services for project management related operations
    • Field Detail

      • uriInfo

        @Context
        protected javax.ws.rs.core.UriInfo uriInfo
    • Constructor Detail

      • ProjectResource

        public ProjectResource()
    • Method Detail

      • getDefaultVariant

        protected javax.ws.rs.core.Variant getDefaultVariant()
      • getJobStatus

        @GET
        @Produces("application/json")
        @Path("/jobs/{jobId}")
        @RolesAllowed({"rest-all","rest-project"})
        public org.guvnor.rest.client.JobResult getJobStatus​(@PathParam("jobId")
                                                             String jobId)
      • removeJob

        @DELETE
        @Produces("application/json")
        @Path("/jobs/{jobId}")
        @RolesAllowed({"rest-all","rest-project"})
        public org.guvnor.rest.client.JobResult removeJob​(@PathParam("jobId")
                                                          String jobId)
      • cloneProject

        @POST
        @Consumes("application/json")
        @Produces("application/json")
        @Path("/spaces/{spaceName}/git/clone")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response cloneProject​(@PathParam("spaceName")
                                                      String spaceName,
                                                      org.guvnor.rest.client.CloneProjectRequest cloneProjectRequest)
      • createProject

        @POST
        @Consumes("application/json")
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response createProject​(@PathParam("spaceName")
                                                       String spaceName,
                                                       @HeaderParam("Accept-Language")
                                                       Locale locales,
                                                       org.guvnor.rest.client.CreateProjectRequest createProjectRequest)
      • getProjects

        @GET
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects")
        @RolesAllowed({"rest-all","rest-project"})
        public Collection<org.guvnor.rest.client.ProjectResponse> getProjects​(@PathParam("spaceName")
                                                                              String spaceName)
      • deleteProject

        @DELETE
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response deleteProject​(@PathParam("spaceName")
                                                       String spaceName,
                                                       @PathParam("projectName")
                                                       String projectName)
      • getProject

        @GET
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}")
        @RolesAllowed({"rest-all","rest-project"})
        public org.guvnor.rest.client.ProjectResponse getProject​(@PathParam("spaceName")
                                                                 String spaceName,
                                                                 @PathParam("projectName")
                                                                 String projectName)
      • getBranches

        @GET
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/branches")
        @RolesAllowed({"rest-all","rest-project"})
        public Collection<org.guvnor.rest.client.BranchResponse> getBranches​(@PathParam("spaceName")
                                                                             String spaceName,
                                                                             @PathParam("projectName")
                                                                             String projectName)
      • addBranch

        @POST
        @Consumes("application/json")
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/branches")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response addBranch​(@PathParam("spaceName")
                                                   String spaceName,
                                                   @PathParam("projectName")
                                                   String projectName,
                                                   org.guvnor.rest.client.AddBranchRequest addBranchRequest)
      • removeBranch

        @DELETE
        @Consumes("application/json")
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/branches/{branchName}")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response removeBranch​(@PathParam("spaceName")
                                                      String spaceName,
                                                      @PathParam("projectName")
                                                      String projectName,
                                                      @PathParam("branchName")
                                                      String branchName)
      • compileProject

        @POST
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/maven/compile")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response compileProject​(@PathParam("spaceName")
                                                        String spaceName,
                                                        @PathParam("projectName")
                                                        String projectName)
      • compileProject

        @POST
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/compile")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response compileProject​(@PathParam("spaceName")
                                                        String spaceName,
                                                        @PathParam("projectName")
                                                        String projectName,
                                                        @PathParam("branchName")
                                                        String branchName)
      • installProject

        @POST
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/maven/install")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response installProject​(@PathParam("spaceName")
                                                        String spaceName,
                                                        @PathParam("projectName")
                                                        String projectName)
      • installProject

        @POST
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/install")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response installProject​(@PathParam("spaceName")
                                                        String spaceName,
                                                        @PathParam("projectName")
                                                        String projectName,
                                                        @PathParam("branchName")
                                                        String branchName)
      • testProject

        @POST
        @Consumes("application/json")
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/maven/test")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response testProject​(@PathParam("spaceName")
                                                     String spaceName,
                                                     @PathParam("projectName")
                                                     String projectName)
      • testProject

        @POST
        @Consumes("application/json")
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/test")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response testProject​(@PathParam("spaceName")
                                                     String spaceName,
                                                     @PathParam("projectName")
                                                     String projectName,
                                                     @PathParam("branchName")
                                                     String branchName)
      • deployProject

        @POST
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/maven/deploy")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response deployProject​(@PathParam("spaceName")
                                                       String spaceName,
                                                       @PathParam("projectName")
                                                       String projectName)
      • deployProject

        @POST
        @Produces("application/json")
        @Path("/spaces/{spaceName}/projects/{projectName}/branches/{branchName}/maven/deploy")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response deployProject​(@PathParam("spaceName")
                                                       String spaceName,
                                                       @PathParam("projectName")
                                                       String projectName,
                                                       @PathParam("branchName")
                                                       String branchName)
      • getSpaces

        @GET
        @Produces("application/json")
        @Path("/spaces")
        @RolesAllowed({"rest-all","rest-project"})
        public Collection<org.guvnor.rest.client.Space> getSpaces()
      • getSpace

        @GET
        @Produces("application/json")
        @Path("/spaces/{spaceName}")
        @RolesAllowed({"rest-all","rest-project"})
        public org.guvnor.rest.client.Space getSpace​(@PathParam("spaceName")
                                                     String spaceName)
      • createSpace

        @POST
        @Consumes("application/json")
        @Produces("application/json")
        @Path("/spaces")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response createSpace​(org.guvnor.rest.client.Space space)
      • updateSpace

        @PUT
        @Consumes("application/json")
        @Produces("application/json")
        @Path("/spaces")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response updateSpace​(org.guvnor.rest.client.Space space)
      • deleteSpace

        @DELETE
        @Produces("application/json")
        @Path("/spaces/{spaceName}")
        @RolesAllowed({"rest-all","rest-project"})
        public javax.ws.rs.core.Response deleteSpace​(@PathParam("spaceName")
                                                     String spaceName)
      • assertObjectExists

        protected void assertObjectExists​(Object o,
                                          String objectInfo,
                                          String objectName)
      • createAcceptedStatusResponse

        protected javax.ws.rs.core.Response createAcceptedStatusResponse​(org.guvnor.rest.client.JobRequest jobRequest)