j.java
3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package com.instabug.library.internal.d.a;
import com.instabug.library.model.i;
import com.instabug.library.util.InstabugSDKLogger;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class j
{
private static j a;
public j()
{
InstabugSDKLogger.d(this, "Initializing ReadQueueCacheManager");
g localg = new g("read_queue_memory_cache_key");
e.a().a(localg);
}
public static j a()
{
if (a == null) {
a = new j();
}
return a;
}
public static g<Integer, i> b()
{
if ((!e.a().b("read_queue_memory_cache_key")) || (e.a().a("read_queue_memory_cache_key").b().size() > 0))
{
InstabugSDKLogger.d(j.class, "In-memory cache not found, loading it from disk " + e.a().a("read_queue_memory_cache_key"));
e.a().a("read_queue_disk_cache_key", "read_queue_memory_cache_key", new e.a() {});
InstabugSDKLogger.d(j.class, "In-memory cache restored from disk, " + e.a().a("read_queue_memory_cache_key").b().size() + " elements restored");
}
InstabugSDKLogger.d(j.class, "In-memory cache found");
return (g)e.a().a("read_queue_memory_cache_key");
}
public static void c()
{
if (!e.a().b("read_queue_memory_cache_key")) {
return;
}
InstabugSDKLogger.d(j.class, "Saving In-memory cache to disk, no. of items to save is " + e.a().a("read_queue_memory_cache_key").b());
e.a().a(e.a().a("read_queue_memory_cache_key"), e.a().a("read_queue_disk_cache_key"), new e.a() {});
InstabugSDKLogger.d(j.class, "In-memory cache had been persisted on-disk, " + e.a().a("read_queue_disk_cache_key").b().size() + " elements saved");
}
public void a(i parami)
{
InstabugSDKLogger.v(this, "Adding message " + parami + " to read queue in-memory cache");
e.a().a("read_queue_memory_cache_key").a(Integer.valueOf(parami.a()), parami);
InstabugSDKLogger.v(this, "Added message " + parami + " to read queue in-memory cache " + e.a().a("read_queue_memory_cache_key").c());
}
public void a(List<i> paramList)
{
ListIterator localListIterator = e().listIterator();
while (localListIterator.hasNext())
{
i locali1 = (i)localListIterator.next();
Iterator localIterator = paramList.iterator();
while (localIterator.hasNext())
{
i locali2 = (i)localIterator.next();
if ((locali1.a() == locali2.a()) && (locali1.c() == locali2.c()))
{
int i = locali2.a();
e.a().a("read_queue_memory_cache_key").a(Integer.valueOf(i));
}
}
}
}
public JSONArray d()
{
JSONArray localJSONArray = new JSONArray();
Iterator localIterator = e().iterator();
while (localIterator.hasNext())
{
i locali = (i)localIterator.next();
try
{
JSONObject localJSONObject = new JSONObject();
localJSONObject.put("issue_id", locali.a());
localJSONObject.put("last_email_id", locali.c());
localJSONObject.put("read_at", locali.b());
localJSONArray.put(localJSONObject);
}
catch (JSONException localJSONException)
{
localJSONException.printStackTrace();
}
}
return localJSONArray;
}
public List<i> e()
{
return e.a().a("read_queue_memory_cache_key").b();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/internal/d/a/j.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/