Examples of ReturnCodeBean


Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

    form.add("owner", "system");
    form.add("view_name","test");
    form.add("view_vid","default");
    client = Client.create();
    resource = client.resource("http://localhost:"+restPort);
    ReturnCodeBean result = resource.path("/hicc/v1/view").
    header("Authorization", authorization).
    post(ReturnCodeBean.class,form);
    assertEquals(1,result.getCode());
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

    resource = client.resource("http://localhost:"+restPort);
    ViewBean view = resource.path("/hicc/v1/view/vid/test").header("Authorization", authorization).get(ViewBean.class);
    view.setPermissionType("private");
    client = Client.create();
    resource = client.resource("http://localhost:"+restPort);
    ReturnCodeBean result = (ReturnCodeBean) resource.path("/hicc/v1/view").
    header("Content-Type","application/json").
    header("Authorization", authorization).
    put(ReturnCodeBean.class, view);
    assertEquals(1, result.getCode());
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

  }
 
  public void testViewDelete() {
    client = Client.create();
    resource = client.resource("http://localhost:"+restPort);
    ReturnCodeBean result = resource.path("/hicc/v1/view/delete/admin/vid/test").
    header("Authorization", authorization).
    delete(ReturnCodeBean.class);
    assertEquals(1,result.getCode());
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

    user.setProperty("testKey", "testValue");
    JSONArray ja = new JSONArray();
    user.setViews(ja);
    client = Client.create();
    resource = client.resource("http://localhost:"+restPort);
    ReturnCodeBean result = resource.path("/hicc/v1/user").
    header("Content-Type","application/json").
    header("Authorization", authorization).
    put(ReturnCodeBean.class, user);
    assertEquals(1, result.getCode());
    } catch (Exception e) {
      fail(ExceptionUtil.getStackTrace(e));
    }
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

    } catch (IllegalAccessException e) {
      log.error(ExceptionUtil.getStackTrace(e));
      throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
          .entity("View save failed.").build());
    }
    return new ReturnCodeBean(ReturnCodeBean.SUCCESS,"Saved");
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

    } catch (Exception e) {
      log.error(ExceptionUtil.getStackTrace(e));
      throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR)
          .entity("View save failed.").build());     
    }
    return new ReturnCodeBean(ReturnCodeBean.SUCCESS,"Saved");
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

    } catch (Exception e) {
      log.error(ExceptionUtil.getStackTrace(e));
      throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR)
          .entity("View save failed.").build());     
    }
    return new ReturnCodeBean(ReturnCodeBean.SUCCESS,"Saved");
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

    } catch (Exception e) {
      log.error(ExceptionUtil.getStackTrace(e));
      throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR)
          .entity("View delete failed.").build());     
    }
    return new ReturnCodeBean(ReturnCodeBean.SUCCESS,"Deleted");
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

    } catch(Exception e) {
      log.error(ExceptionUtil.getStackTrace(e));
      throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
          .entity("User does not exist.").build());
    }
    return new ReturnCodeBean(ReturnCodeBean.SUCCESS,"Saved.");
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.ReturnCodeBean

      ws.set(widget);
    } catch(Exception e) {
      throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
          .entity("Widget save failed.").build());
    }
    return new ReturnCodeBean(ReturnCodeBean.SUCCESS,"Saved");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.