org.jboss.resteasy.keystone.server

## Class ProjectsService

- java.lang.Object
- - org.jboss.resteasy.keystone.server.ProjectsService

-     @Path(value="/projects")
      public class ProjectsService
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProjectsService(org.infinispan.Cache cache, UsersService usersResource, RolesService rolesResource)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addUserRole(String id, String userId, String roleId)`
    `Response` | `create(Project project)`
    `void` | `createProject(Project project)`
    `Response` | `delete(String id)`
    `Project` | `getProject(String id)`
    `Projects` | `getProjects(String name)`
    `String` | `getUserIdByName(String projectId, String username)`
    `Roles` | `getUserRoles(String id, String userId)`
    `static String` | `projectCacheId(String id)`
    `void` | `removeUserRole(String id, String userId, String roleId)`
    `void` | `update(String id, Project project)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProjectsService

          public ProjectsService(org.infinispan.Cache cache,
                         UsersService usersResource,
                         RolesService rolesResource)

  - ### Method Detail

    - #### createProject

          public void createProject(Project project)
                             throws Exception

      Throws:
        `Exception`

    - #### getProjects

          @GET
          @Produces(value="application/json")
          public Projects getProjects(@QueryParam(value="name")
                                               String name)

    - #### create

          @POST
          @Consumes(value="application/json")
          @Produces(value="application/json")
          @RolesAllowed(value="admin")
          public Response create(Project project)
                          throws Exception

      Throws:
        `Exception`

    - #### update

          @PUT
          @Consumes(value="application/json")
          @Produces(value="application/json")
          @Path(value="{id}")
          @RolesAllowed(value="admin")
          public void update(@PathParam(value="id")
                                                                           String id,
                                                                           Project project)
                      throws Exception

      Throws:
        `Exception`

    - #### delete

          @DELETE
          @Path(value="{id}")
          @RolesAllowed(value="admin")
          public Response delete(@PathParam(value="id")
                                                      String id)

    - #### projectCacheId

          public static String projectCacheId(String id)

    - #### getProject

          @GET
          @Path(value="{id}")
          @Produces(value="application/json")
          public Project getProject(@PathParam(value="id")
                                                       String id)

    - #### getUserIdByName

          public String getUserIdByName(String projectId,
                               String username)

    - #### getUserRoles

          public Roles getUserRoles(String id,
                           String userId)

    - #### addUserRole

          @PUT
          @Path(value="{id}/users/{user}/roles/{role}")
          @RolesAllowed(value="admin")
          public void addUserRole(@PathParam(value="id")
                                                    String id,
                                                    @PathParam(value="user")
                                                    String userId,
                                                    @PathParam(value="role")
                                                    String roleId)

    - #### removeUserRole

          @DELETE
          @Path(value="{id}/users/{user}/roles/{role}")
          @RolesAllowed(value="admin")
          public void removeUserRole(@PathParam(value="id")
                                                          String id,
                                                          @PathParam(value="user")
                                                          String userId,
                                                          @PathParam(value="role")
                                                          String roleId)

Copyright © 2014. All Rights Reserved.