Пример #1
0
 @GET
 public Collection<HostTypeBean> getAll(
     @QueryParam("pageIndex") Optional<Integer> pageIndex,
     @QueryParam("pageSize") Optional<Integer> pageSize)
     throws Exception {
   return hostTypeDAO.getAll(pageIndex.or(DEFAULT_INDEX), pageSize.or(DEFAULT_SIZE));
 }
Пример #2
0
 @GET
 @Path("/basic")
 public Collection<HostTypeBean> getByProviderAndBasic(
     @QueryParam("provider") String provider, @QueryParam("basic") Optional<Boolean> basic)
     throws Exception {
   return hostTypeDAO.getByProviderAndBasic(provider, basic.or(true));
 }
Пример #3
0
 @POST
 public void create(@Context SecurityContext sc, @Valid HostTypeBean bean) throws Exception {
   bean.setId(CommonUtils.getBase64UUID());
   LOG.info(String.format("Create new host type %s", bean.toString()));
   hostTypeDAO.insert(bean);
   // TODO udpate clusters, deprecated old host type
 }