Commit 818c37e7 authored by Alex Proca's avatar Alex Proca

Plugin: userservice. Get REST responses in JSON too

parent ee1801ee
...@@ -25,7 +25,7 @@ public class UserGroupService { ...@@ -25,7 +25,7 @@ public class UserGroupService {
} }
@GET @GET
@Produces(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public UserGroupsEntity getUserGroups(@PathParam("username") String username) throws ServiceException { public UserGroupsEntity getUserGroups(@PathParam("username") String username) throws ServiceException {
return new UserGroupsEntity(plugin.getUserGroups(username)); return new UserGroupsEntity(plugin.getUserGroups(username));
} }
......
...@@ -35,7 +35,7 @@ public class UserRosterService { ...@@ -35,7 +35,7 @@ public class UserRosterService {
} }
@GET @GET
@Produces(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public RosterEntities getUserRoster(@PathParam("username") String username) throws ServiceException { public RosterEntities getUserRoster(@PathParam("username") String username) throws ServiceException {
return plugin.getRosterEntities(username); return plugin.getRosterEntities(username);
} }
......
...@@ -28,7 +28,7 @@ public class UserService { ...@@ -28,7 +28,7 @@ public class UserService {
} }
@GET @GET
@Produces(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public UserEntities getUsers(@QueryParam("search") String userSearch) { public UserEntities getUsers(@QueryParam("search") String userSearch) {
return plugin.getUserEntities(userSearch); return plugin.getUserEntities(userSearch);
} }
...@@ -41,7 +41,7 @@ public class UserService { ...@@ -41,7 +41,7 @@ public class UserService {
@GET @GET
@Path("/{username}") @Path("/{username}")
@Produces(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public UserEntity getUser(@PathParam("username") String username) throws ServiceException { public UserEntity getUser(@PathParam("username") String username) throws ServiceException {
return plugin.getUserEntity(username); return plugin.getUserEntity(username);
} }
......
...@@ -22,14 +22,14 @@ public class UserServiceProperties { ...@@ -22,14 +22,14 @@ public class UserServiceProperties {
} }
@GET @GET
@Produces(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Path("/{key}") @Path("/{key}")
public UserEntities getUsersByPropertyKey(@PathParam("key") String key) throws ServiceException { public UserEntities getUsersByPropertyKey(@PathParam("key") String key) throws ServiceException {
return plugin.getUserEntitiesByProperty(key, null); return plugin.getUserEntitiesByProperty(key, null);
} }
@GET @GET
@Produces(MediaType.APPLICATION_XML) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Path("/{key}/{value}") @Path("/{key}/{value}")
public UserEntities getUsersByPropertyKeyValue(@PathParam("key") String key, @PathParam("value") String value) public UserEntities getUsersByPropertyKeyValue(@PathParam("key") String key, @PathParam("value") String value)
throws ServiceException { throws ServiceException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment