Examples of marshallToJSON()


Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

  private String marshallToJson(AccessToken token) throws JAXBException {
    JSONJAXBContext context = new JSONJAXBContext(AccessToken.class);
    JSONMarshaller marshaller = context.createJSONMarshaller();

    StringWriter writer = new StringWriter();
    marshaller.marshallToJSON(token, writer);

    return writer.toString();
  }

  private Client createClient(String id, String secret) {
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

          ADMIN_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = ADMIN_USERNAME;
      model.admin = true;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + ADMIN_TOKEN,
        os.toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    }
    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          USER_TOKEN, null) == null) {
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          USER_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = USER_USERNAME;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + USER_TOKEN,
        os.toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    }
    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +
          DISABLED_TOKEN, null) == null) {
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

          DISABLED_TOKEN, null) == null) {
      UserModel model = new UserModel();
      model.name = DISABLED_USERNAME;
      model.disabled = true;
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      marshaller.marshallToJSON(model, os);
      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +DISABLED_TOKEN,
        os.toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
    }
  }
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

  private static String appStateToJSON(AppState state) throws Exception {
    StringWriter sw = new StringWriter();
    JSONJAXBContext ctx = new JSONJAXBContext(AppState.class);
    JSONMarshaller jm = ctx.createJSONMarshaller();
    jm.marshallToJSON(state, sw);
    return sw.toString();
  }

  protected static void verifyAppStateJson(ClientResponse response,
      RMAppState... states) throws JSONException {
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

    JSONJAXBContext context =
      new JSONJAXBContext(JSONConfiguration.natural().build(),
        FilterModel.class);
    JSONMarshaller marshaller = context.createJSONMarshaller();
    StringWriter writer = new StringWriter();
    marshaller.marshallToJSON(new FilterModel(filter), writer);
    return writer.toString();
  }

  private static final byte[] COLUMN_DIVIDER = Bytes.toBytes(":");
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

    JSONJAXBContext context =
      new JSONJAXBContext(JSONConfiguration.natural().build(),
        FilterModel.class);
    JSONMarshaller marshaller = context.createJSONMarshaller();
    StringWriter writer = new StringWriter();
    marshaller.marshallToJSON(new FilterModel(filter), writer);
    return writer.toString();
  }

  private static final byte[] COLUMN_DIVIDER = Bytes.toBytes(":");
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

    JSONJAXBContext context =
      new JSONJAXBContext(JSONConfiguration.natural().build(),
        FilterModel.class);
    JSONMarshaller marshaller = context.createJSONMarshaller();
    StringWriter writer = new StringWriter();
    marshaller.marshallToJSON(new FilterModel(filter), writer);
    return writer.toString();
  }

  private static final byte[] COLUMN_DIVIDER = Bytes.toBytes(":");
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

    JSONJAXBContext context =
      new JSONJAXBContext(JSONConfiguration.natural().build(),
        FilterModel.class);
    JSONMarshaller marshaller = context.createJSONMarshaller();
    StringWriter writer = new StringWriter();
    marshaller.marshallToJSON(new FilterModel(filter), writer);
    return writer.toString();
  }

  private static final byte[] COLUMN_DIVIDER = Bytes.toBytes(":");
View Full Code Here

Examples of com.sun.jersey.api.json.JSONMarshaller.marshallToJSON()

    JSONJAXBContext context =
      new JSONJAXBContext(JSONConfiguration.natural().build(),
        FilterModel.class);
    JSONMarshaller marshaller = context.createJSONMarshaller();
    StringWriter writer = new StringWriter();
    marshaller.marshallToJSON(new FilterModel(filter), writer);
    return writer.toString();
  }

  private static final byte[] COLUMN_DIVIDER = Bytes.toBytes(":");
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.