Exemplo n.º 1
0
  public QueueMessage() {
    this._modifiedColumns = new ArrayList<String>();
    this._modifiedColumns.add("createdAt");
    this._modifiedColumns.add("updatedAt");
    this._modifiedColumns.add("ACL");
    this._modifiedColumns.add("expires");
    this._modifiedColumns.add("timeout");
    this._modifiedColumns.add("delay");
    this._modifiedColumns.add("message");

    this.acl = new ACL();
    document = new JSONObject();
    try {
      document.put("_id", JSONObject.NULL);
      document.put("timeout", timeout);
      document.put("delay", JSONObject.NULL);

      document.put("_type", type);
      document.put("ACL", acl.getACL());
      document.put("expires", JSONObject.NULL);
      document.put("_modifiedColumns", this._modifiedColumns);
      document.put("_isModified", true);
      document.put("message", message);

    } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
Exemplo n.º 2
0
 public void addElement(String key, Object val) {
   try {
     document.put(key, val);
   } catch (JSONException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }
Exemplo n.º 3
0
 public Object getElement(String key) {
   Object obj = null;
   try {
     obj = document.get(key);
   } catch (JSONException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   return obj;
 }
Exemplo n.º 4
0
 public boolean hasKey(String key) {
   return document.has(key);
 }