@Test public void testFindVideos() { List<VideoInfo> videolist = mongoOperation.getCollection(VIDEOS_COLLECTION_NAME , VideoInfo.class); assertNotNull(videolist); }
@GET @Path (REST_API_VIDEOS) @Produces (MediaType.APPLICATION_JSON) public Response findVideos() { if (isDebugEnabled) { S_LOGGER.debug("Entered into AdminService.findVideos()"); } try { List<VideoInfo> videoList = mongoOperation.getCollection(VIDEOS_COLLECTION_NAME , VideoInfo.class); if (videoList != null) { return Response.status(Response.Status.OK).entity(videoList).build(); } } catch (Exception e) { throw new PhrescoWebServiceException(e, EX_PHEX00005, VIDEOS_COLLECTION_NAME); } return Response.status(Response.Status.OK).entity(ERROR_MSG_NOT_FOUND).build(); }
AdminService extends DbService implements ServiceConstants { @GET @Path (REST_API_VIDEOS) @Produces (MediaType.APPLICATION_JSON) public Response findVideos() { if (isDebugEnabled) { S_LOGGER.debug("Entered into AdminService.findVideos()"); } try { List<VideoInfo> videoList = mongoOperation.getCollection(VIDEOS_COLLECTION_NAME , VideoInfo.class); if (videoList != null) { return Response.status(Response.Status.OK).entity(videoList).build(); } } catch (Exception e) { throw new PhrescoWebServiceException(e, EX_PHEX00005, VIDEOS_COLLECTION_NAME); } return Response.status(Response.Status.OK).entity(ERROR_MSG_NOT_FOUND).build(); } }
AdminService extends DbService implements ServiceConstants { @GET @Path (REST_API_VIDEOS) @Produces (MediaType.APPLICATION_JSON) public Response findVideos() { if (isDebugEnabled) { S_LOGGER.debug("Entered into AdminService.findVideos()"); } try { List<VideoInfo> videoList = mongoOperation.getCollection(VIDEOS_COLLECTION_NAME , VideoInfo.class); if (videoList != null) { return Response.status(Response.Status.OK).entity(videoList).build(); } } catch (Exception e) { throw new PhrescoWebServiceException(e, EX_PHEX00005, VIDEOS_COLLECTION_NAME); } return Response.status(Response.Status.OK).entity(ERROR_MSG_NOT_FOUND).build(); } AdminService(); }
AdminService extends DbService implements ServiceConstants { @GET @Path (REST_API_VIDEOS) @Produces (MediaType.APPLICATION_JSON) public Response findVideos() { if (isDebugEnabled) { S_LOGGER.debug("Entered into AdminService.findVideos()"); } try { List<VideoInfo> videoList = mongoOperation.getCollection(VIDEOS_COLLECTION_NAME , VideoInfo.class); if (videoList != null) { return Response.status(Response.Status.OK).entity(videoList).build(); } } catch (Exception e) { throw new PhrescoWebServiceException(e, EX_PHEX00005, VIDEOS_COLLECTION_NAME); } return Response.status(Response.Status.OK).entity(ERROR_MSG_NOT_FOUND).build(); } AdminService(); @GET @Path (REST_API_CUSTOMERS) @Produces (MediaType.APPLICATION_JSON) Response findCustomer(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_CUSTOMERS) Response createCustomer(List<Customer> customer); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_CUSTOMERS) Response updateCustomer(List<Customer> customers); @DELETE @Path (REST_API_CUSTOMERS) void deleteCustomer(List<Customer> deleteCustomers); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_CUSTOMERS + REST_API_PATH_ID) Response getCustomer(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_CUSTOMERS + REST_API_PATH_ID) Response updateCustomer(@PathParam(REST_API_PATH_PARAM_ID) String id , Customer updateCustomers); @DELETE @Path (REST_API_CUSTOMERS + REST_API_PATH_ID) Response deleteCustomer(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_VIDEOS) @Produces (MediaType.APPLICATION_JSON) Response findVideos(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_VIDEOS) Response createVideo(List<VideoInfo> videos); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_VIDEOS) Response updateVideos(List<VideoInfo> videos); @DELETE @Path(REST_API_VIDEOS) void deleteVideos(List<VideoInfo> videos); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_VIDEOS + REST_API_PATH_ID) Response getVideo(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_VIDEOS + REST_API_PATH_ID) Response updateVideo(@PathParam(REST_API_PATH_PARAM_ID) String id , VideoInfo videoInfo); @DELETE @Path(REST_API_VIDEOS + REST_API_PATH_ID) Response deleteVideo(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_USERS) @Produces (MediaType.APPLICATION_JSON) Response findUsers(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_USERS) Response createUser(List<User> users); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_USERS) Response updateUsers(List<User> users); @DELETE @Path (REST_API_USERS) void deleteUsers(List<User> users); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_USERS + REST_API_PATH_ID) Response getUser(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_USERS + REST_API_PATH_ID) Response updateUser(@PathParam(REST_API_PATH_PARAM_ID) String id , User user); @DELETE @Path (REST_API_USERS + REST_API_PATH_ID) Response deleteUser(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_DOWNLOADS) @Produces (MediaType.APPLICATION_JSON) Response findDownloadInfo(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_DOWNLOADS) Response createDownloadInfo(List<DownloadInfo> downloadInfos); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_DOWNLOADS) Response updateDownloadInfo(List<DownloadInfo> downloads); @DELETE @Path (REST_API_DOWNLOADS) void deleteDownloadInfo(List<DownloadInfo> downloadInfos); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_DOWNLOADS + REST_API_PATH_ID) Response getDownloadInfo(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_DOWNLOADS + REST_API_PATH_ID) Response updateDownloadInfo(@PathParam(REST_API_PATH_PARAM_ID) String id , DownloadInfo downloadInfo); @DELETE @Path (REST_API_DOWNLOADS + REST_API_PATH_ID) Response deleteDownloadInfo(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_GLOBALURL) @Produces (MediaType.APPLICATION_JSON) Response findGlobalURL(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_GLOBALURL) Response createGlobalURL(List<GlobalURL> globalURL); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_GLOBALURL) Response updateGlobalURL(List<GlobalURL> globalURLs); @DELETE @Path (REST_API_GLOBALURL) void deleteGlobalURL(List<GlobalURL> globalURL); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_GLOBALURL + REST_API_PATH_ID) Response getGlobalURL(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_GLOBALURL + REST_API_PATH_ID) Response updateGlobalURL(@PathParam(REST_API_PATH_PARAM_ID) String id , GlobalURL globalURL); @DELETE @Path (REST_API_GLOBALURL + REST_API_PATH_ID) Response deleteGlobalURL(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_ROLES) @Produces (MediaType.APPLICATION_JSON) Response findRoles(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_ROLES) Response createRoles(List<Role> roles); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_ROLES) Response updateRoles(List<Role> roles); @DELETE @Path (REST_API_ROLES) void deleteRoles(List<Role> roles); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_ROLES + REST_API_PATH_ID) Response getRole(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_ROLES + REST_API_PATH_ID) Response updateRole(@PathParam(REST_API_PATH_PARAM_ID) String id , Role role); @DELETE @Path (REST_API_ROLES + REST_API_PATH_ID) Response deleteRole(@PathParam(REST_API_PATH_PARAM_ID) String id); }
AdminService extends DbService implements ServiceConstants { @GET @Path (REST_API_VIDEOS) @Produces (MediaType.APPLICATION_JSON) public Response findVideos() { if (isDebugEnabled) { S_LOGGER.debug("Entered into AdminService.findVideos()"); } try { List<VideoInfo> videoList = mongoOperation.getCollection(VIDEOS_COLLECTION_NAME , VideoInfo.class); if (videoList != null) { return Response.status(Response.Status.OK).entity(videoList).build(); } } catch (Exception e) { throw new PhrescoWebServiceException(e, EX_PHEX00005, VIDEOS_COLLECTION_NAME); } return Response.status(Response.Status.OK).entity(ERROR_MSG_NOT_FOUND).build(); } AdminService(); @GET @Path (REST_API_CUSTOMERS) @Produces (MediaType.APPLICATION_JSON) Response findCustomer(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_CUSTOMERS) Response createCustomer(List<Customer> customer); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_CUSTOMERS) Response updateCustomer(List<Customer> customers); @DELETE @Path (REST_API_CUSTOMERS) void deleteCustomer(List<Customer> deleteCustomers); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_CUSTOMERS + REST_API_PATH_ID) Response getCustomer(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_CUSTOMERS + REST_API_PATH_ID) Response updateCustomer(@PathParam(REST_API_PATH_PARAM_ID) String id , Customer updateCustomers); @DELETE @Path (REST_API_CUSTOMERS + REST_API_PATH_ID) Response deleteCustomer(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_VIDEOS) @Produces (MediaType.APPLICATION_JSON) Response findVideos(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_VIDEOS) Response createVideo(List<VideoInfo> videos); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_VIDEOS) Response updateVideos(List<VideoInfo> videos); @DELETE @Path(REST_API_VIDEOS) void deleteVideos(List<VideoInfo> videos); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_VIDEOS + REST_API_PATH_ID) Response getVideo(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_VIDEOS + REST_API_PATH_ID) Response updateVideo(@PathParam(REST_API_PATH_PARAM_ID) String id , VideoInfo videoInfo); @DELETE @Path(REST_API_VIDEOS + REST_API_PATH_ID) Response deleteVideo(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_USERS) @Produces (MediaType.APPLICATION_JSON) Response findUsers(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_USERS) Response createUser(List<User> users); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_USERS) Response updateUsers(List<User> users); @DELETE @Path (REST_API_USERS) void deleteUsers(List<User> users); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_USERS + REST_API_PATH_ID) Response getUser(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_USERS + REST_API_PATH_ID) Response updateUser(@PathParam(REST_API_PATH_PARAM_ID) String id , User user); @DELETE @Path (REST_API_USERS + REST_API_PATH_ID) Response deleteUser(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_DOWNLOADS) @Produces (MediaType.APPLICATION_JSON) Response findDownloadInfo(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_DOWNLOADS) Response createDownloadInfo(List<DownloadInfo> downloadInfos); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_DOWNLOADS) Response updateDownloadInfo(List<DownloadInfo> downloads); @DELETE @Path (REST_API_DOWNLOADS) void deleteDownloadInfo(List<DownloadInfo> downloadInfos); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_DOWNLOADS + REST_API_PATH_ID) Response getDownloadInfo(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_DOWNLOADS + REST_API_PATH_ID) Response updateDownloadInfo(@PathParam(REST_API_PATH_PARAM_ID) String id , DownloadInfo downloadInfo); @DELETE @Path (REST_API_DOWNLOADS + REST_API_PATH_ID) Response deleteDownloadInfo(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_GLOBALURL) @Produces (MediaType.APPLICATION_JSON) Response findGlobalURL(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_GLOBALURL) Response createGlobalURL(List<GlobalURL> globalURL); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_GLOBALURL) Response updateGlobalURL(List<GlobalURL> globalURLs); @DELETE @Path (REST_API_GLOBALURL) void deleteGlobalURL(List<GlobalURL> globalURL); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_GLOBALURL + REST_API_PATH_ID) Response getGlobalURL(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_GLOBALURL + REST_API_PATH_ID) Response updateGlobalURL(@PathParam(REST_API_PATH_PARAM_ID) String id , GlobalURL globalURL); @DELETE @Path (REST_API_GLOBALURL + REST_API_PATH_ID) Response deleteGlobalURL(@PathParam(REST_API_PATH_PARAM_ID) String id); @GET @Path (REST_API_ROLES) @Produces (MediaType.APPLICATION_JSON) Response findRoles(); @POST @Consumes (MediaType.APPLICATION_JSON) @Path (REST_API_ROLES) Response createRoles(List<Role> roles); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_ROLES) Response updateRoles(List<Role> roles); @DELETE @Path (REST_API_ROLES) void deleteRoles(List<Role> roles); @GET @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_ROLES + REST_API_PATH_ID) Response getRole(@PathParam(REST_API_PATH_PARAM_ID) String id); @PUT @Consumes (MediaType.APPLICATION_JSON) @Produces (MediaType.APPLICATION_JSON) @Path (REST_API_ROLES + REST_API_PATH_ID) Response updateRole(@PathParam(REST_API_PATH_PARAM_ID) String id , Role role); @DELETE @Path (REST_API_ROLES + REST_API_PATH_ID) Response deleteRole(@PathParam(REST_API_PATH_PARAM_ID) String id);  }