Class JSonClient


  • public class JSonClient
    extends Object
    A very simple, self-contained demo REST client that exercises an Espresso Logic API.

    You will need the following jars:
    1. httpclient-4.x.x.jar
    2. httpcore-4.x.x.jar
    3. commons-logging-1.1.1.jar
    4. jackson-core-2.x.x.jar
    5. jackson-databind-2.x.x.jar
    6. jackson-annotations-2.x.x.jar
    See Also:
    Using https
    • Field Detail

      • MY_API_KEY

        protected static String MY_API_KEY
      • API_KEY

        protected static String API_KEY
    • Constructor Detail

      • JSonClient

        public JSonClient()
    • Method Detail

      • getBaseURL

        public static String getBaseURL()
      • put

        public static com.fasterxml.jackson.databind.JsonNode put​(String resource,
                                                                  com.fasterxml.jackson.databind.JsonNode object,
                                                                  String preConfParam)
                                                           throws Exception
        Throws:
        Exception
      • post

        public static com.fasterxml.jackson.databind.JsonNode post​(String resource,
                                                                   com.fasterxml.jackson.databind.JsonNode object,
                                                                   String preConfParam)
                                                            throws Exception
        Throws:
        Exception
      • delete

        public static com.fasterxml.jackson.databind.JsonNode delete​(com.fasterxml.jackson.databind.JsonNode object,
                                                                     String preConfParam)
                                                              throws Exception
        Throws:
        Exception
      • getIdentOfResource

        public static String getIdentOfResource​(String resourceName,
                                                boolean cache,
                                                String preConfParam)
      • getDataTypeFromTable

        public static String getDataTypeFromTable​(String resourceName,
                                                  String field,
                                                  boolean cache,
                                                  String preConfParam)
      • getColumnsFromTable

        public static com.fasterxml.jackson.databind.JsonNode getColumnsFromTable​(String resourceName,
                                                                                  String subResourceName,
                                                                                  boolean cache,
                                                                                  String preConfParam)
      • keepFKinHT

        public static void keepFKinHT​(String resourceName,
                                      String subResourceName,
                                      boolean cache,
                                      String preConfParam)
      • keepJoinConditionSubResources

        public static void keepJoinConditionSubResources​(com.fasterxml.jackson.databind.JsonNode resource)
      • putParentsInCache

        public static void putParentsInCache​(String resourceName,
                                             boolean cache,
                                             String preConfParam)
      • getParents

        public static Hashtable<String,​com.fasterxml.jackson.databind.JsonNode> getParents()
      • getTableNameRoot

        public static String getTableNameRoot()
      • setTableNameRoot

        public static void setTableNameRoot​(String tableNameRoot)
      • fillKeepJson

        public void fillKeepJson​(String resource,
                                 String filter,
                                 boolean useCache,
                                 String preConfParam)
      • getRowCount

        public int getRowCount()
      • getValueFromRow

        public String getValueFromRow​(String field,
                                      int rowNumber)
      • getValueFromRow

        public String getValueFromRow​(String node,
                                      String field,
                                      int rowNumber)
      • getResult

        public String getResult()
      • setApiKeyHeader

        public static void setApiKeyHeader​(String apiKey)
      • setBaseURL

        public static void setBaseURL​(String baseURL)
      • getResourceTableName

        public static String getResourceTableName()
      • setResourceTableName

        public static void setResourceTableName​(String resourceTableName)