예제 #1
0
 /**
  * Creates a unique entry name string for a request. It consists of the method name and all the
  * parameter names and values concatenated in alphabetical order. It is used to identify cache
  * entries in the backend storage. If <code>hashCacheEntryNames</code> is set to <code>true</code>
  * this method will return a MD5 hash of the generated name.
  *
  * @param method The request method
  * @param params The request parameters
  * @return a cache entry name
  */
 public static String createCacheEntryName(String method, Map<String, String> params) {
   if (!(params instanceof SortedMap)) {
     params = new TreeMap<String, String>(params);
   }
   StringBuilder b = new StringBuilder(100);
   b.append(method.toLowerCase(Locale.US));
   b.append('.');
   for (Map.Entry<String, String> e : params.entrySet()) {
     b.append(e.getKey());
     b.append(e.getValue());
   }
   String name = b.toString();
   if (hashCacheEntryNames) return StringUtilities.md5(name);
   return StringUtilities.cleanUp(name);
 }
예제 #2
0
파일: Geo.java 프로젝트: junwuwei/jSona
 public static Chart<Track> getMetroUniqueTrackChart(
     String country, String metro, String start, String end, String apiKey) {
   return Chart.getChart(
       "geo.getMetroUniqueTrackChart",
       "track",
       StringUtilities.map("country", country, "metro", metro),
       start,
       end,
       -1,
       apiKey);
 }
예제 #3
0
파일: Geo.java 프로젝트: junwuwei/jSona
 public static Chart<Artist> getMetroHypeArtistChart(
     String country, String metro, String start, String end, String apiKey) {
   return Chart.getChart(
       "geo.getMetroHypeArtistChart",
       "artist",
       StringUtilities.map("country", country, "metro", metro),
       start,
       end,
       -1,
       apiKey);
 }