The NetworkAction.ActionType

Action Types invoke their bound processes on the server. Aedons offers a wide-array of actions that allow you to handle any type of processing requirement.
                          public enum ActionType {

                                SEARCH,
                                LOGON,
                                CHANGE_ENCRYPTION,
                                SEND_MESSAGE,
                                SEND_FILE,
                                REQUEST_FILE,
                                MESSAGE_RECEIVED,
                                SERVER_INFO,
                                PING,
                                QUERY;
                           }
                          

The Basics. Several types of example-sample calls to the server.

   @Action
    public void doGetVersionInfoAction() {
        try {
            NetworkCommunication incomm = new NetworkCommunication();
            NetworkAction action = new NetworkAction();
            action.setAction(NetworkAction.ActionType.SERVER_INFO);
            String uuid = UUID.genUUID();
            action.setUuid(uuid);
            incomm.addMessage(action);
 

            NetworkCommunication respc = NetworkManager.send(incomm);
            if (respc != null) {

                NetworkResponse resp = (NetworkResponse) respc.getMessageByUuid(uuid);
                String data = resp.getContent();
                Document doc = XMLHelper.parseDocumentFromString(data);
                Log.logToWindow(getClass(), doc.getRootElement().getText());

            } else {
                Log.logToWindow(getClass(), "Response was null");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}

Click here for a detailed explanation of this method.

How to Send a Query:

            // Select
            String query = "SELECT * FROM " + TABLE_NAME;
            Document doc = NetworkManager.sendQuery(QueryType.SELECT, query);
            
             // Insert
            String query = "INSERT INTO" + TABLE_NAME + " (foo) VALUES ('bar')";
            Document doc = NetworkManager.sendQuery(QueryType.INSERT, query);
            
            // Update
            String query = "UPATE " + TABLE_NAME + " SET foo='bar'";
            Document doc = NetworkManager.sendQuery(QueryType.UPDATE, query);
            
    
It doesn't get much easier than that. The document returned will reflect the column names of the table, or the columns specified in the query.

Send a Prepared Statement

       public static boolean updateComments(int id, String comment) {
        boolean result = true;
        try {
            comment = comment.replaceFirst("'", "\\'");
            String query = "UPDATE daily_billing SET comments=? where rowid=" + id;
            Hashtable params = new Hashtable();
            params.put(NetworkAction.PS_DATA_KEY, comment);
            Document doc = NetworkManager.sendQuery(QueryType.PREPARED_UPDATE, query, params);

            if (doc != null) {
                String tresult = doc.getRootElement().getTextTrim();
                if (!tresult.equals(ResponseType.SUCCESS.name())) {
                    result = false;
                }
            }

        } catch (Exception e) {
            e.printStackTrace();
            result = false;
        }

        return result;
    }