Skip to content

Instantly share code, notes, and snippets.

@cleuton
Last active August 29, 2015 13:57
Show Gist options
  • Save cleuton/9435139 to your computer and use it in GitHub Desktop.
Save cleuton/9435139 to your computer and use it in GitHub Desktop.
JSON DAO Interface
package com.obomprogramador.discoarq.microblog.persistence;
import java.util.List;
import org.json.JSONObject;
public interface JsonDao {
boolean addUser(JSONObject user) throws Exception;
JSONObject findUser(String username, String password) throws Exception;
List<JSONObject> getMessages(JSONObject user) throws Exception;
boolean follow(JSONObject user, String followUserName) throws Exception;
boolean postMessage(JSONObject user, String message) throws Exception;
boolean abandon(JSONObject user, String followUserName) throws Exception;
boolean validateSession(JSONObject session) throws Exception;
JSONObject getSession(JSONObject user) throws Exception;
boolean updateSession(JSONObject session) throws Exception;
JSONObject pullSession(JSONObject session) throws Exception;
JSONObject getUserFromSession(JSONObject session) throws Exception;
}
@cleuton
Copy link
Author

cleuton commented Mar 8, 2014

This is a Json DAO sample. This Gist is only the interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment