Package org.opendaylight.aaa.shiro.idm
Class RoleHandler
java.lang.Object
org.opendaylight.aaa.shiro.idm.RoleHandler
REST application used to manipulate the H2 database roles table. The REST
endpoint is
/auth/v1/roles
.
A wrapper script called idmtool
is provided to manipulate AAA
data.
- Author:
- [email protected]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
createRole
(javax.ws.rs.core.UriInfo info, Role role) Creates a role.javax.ws.rs.core.Response
deleteRole
(javax.ws.rs.core.UriInfo info, String id) Delete a role.javax.ws.rs.core.Response
Extract a specific role identified byid
.javax.ws.rs.core.Response
getRoles()
Extracts all roles.javax.ws.rs.core.Response
Updates a specific role identified byid
.
-
Constructor Details
-
RoleHandler
-
-
Method Details
-
getRoles
@GET @Produces("application/json") public javax.ws.rs.core.Response getRoles()Extracts all roles.- Returns:
- A response with all roles in the H2 database, or internal error if one is encountered
-
getRole
@GET @Path("/{id}") @Produces("application/json") public javax.ws.rs.core.Response getRole(@PathParam("id") String id) Extract a specific role identified byid
.- Parameters:
id
- the String id for the role- Returns:
- A response with the role identified by
id
, or internal error if one is encountered
-
createRole
@POST @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response createRole(@Context javax.ws.rs.core.UriInfo info, Role role) Creates a role.- Parameters:
info
- passed from Jerseyrole
- the role JSON payload- Returns:
- A response stating success or failure of role creation, or internal error if one is encountered
-
putRole
@PUT @Path("/{id}") @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response putRole(@Context javax.ws.rs.core.UriInfo info, Role role, @PathParam("id") String id) Updates a specific role identified byid
.- Parameters:
info
- passed from Jerseyrole
- the role JSON payloadid
- the String id for the role- Returns:
- A response stating success or failure of role update, or internal error if one occurs
-
deleteRole
@DELETE @Path("/{id}") public javax.ws.rs.core.Response deleteRole(@Context javax.ws.rs.core.UriInfo info, @PathParam("id") String id) Delete a role.- Parameters:
info
- passed from Jerseyid
- the String id for the role- Returns:
- A response stating success or failure of user deletion, or internal error if one occurs
-