123 lines
4.3 KiB
Java
123 lines
4.3 KiB
Java
package com.baidu.uaq.agent.android.customtransmission;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
/* compiled from: UploadConfigureStorage.java */
|
|
/* loaded from: classes.dex */
|
|
public class b {
|
|
private static final com.baidu.uaq.agent.android.logging.a a = com.baidu.uaq.agent.android.logging.b.a();
|
|
private static final ConcurrentHashMap<String, APMUploadConfigure> b = new ConcurrentHashMap<>();
|
|
private static final ConcurrentHashMap<String, ArrayList<a>> c = new ConcurrentHashMap<>();
|
|
|
|
public static synchronized void a(APMUploadConfigure aPMUploadConfigure) {
|
|
synchronized (b.class) {
|
|
if (com.baidu.uaq.agent.android.harvest.multiharvest.a.c().a() < 1) {
|
|
a.a("Agent has shutdown when add Upload Configure");
|
|
} else {
|
|
b.put(aPMUploadConfigure.getUploadName(), aPMUploadConfigure);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static synchronized ConcurrentHashMap<String, ArrayList<a>> b() {
|
|
ConcurrentHashMap<String, ArrayList<a>> concurrentHashMap;
|
|
synchronized (b.class) {
|
|
concurrentHashMap = c;
|
|
}
|
|
return concurrentHashMap;
|
|
}
|
|
|
|
public static synchronized void b(String str, Boolean bool) {
|
|
synchronized (b.class) {
|
|
ArrayList<a> arrayList = c.get(str);
|
|
if (bool.booleanValue()) {
|
|
ArrayList arrayList2 = new ArrayList();
|
|
Iterator<a> it = arrayList.iterator();
|
|
while (it.hasNext()) {
|
|
a next = it.next();
|
|
if (next.c() == 0) {
|
|
arrayList2.add(next);
|
|
}
|
|
}
|
|
a(str, (ArrayList<a>) arrayList2);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Deprecated
|
|
static synchronized void a(String str) {
|
|
synchronized (b.class) {
|
|
b.remove(str);
|
|
}
|
|
}
|
|
|
|
static synchronized void a(String str, String str2) {
|
|
synchronized (b.class) {
|
|
if (com.baidu.uaq.agent.android.harvest.multiharvest.a.c().a() < 1) {
|
|
a.a("Agent has shutdown when add Upload Block");
|
|
} else {
|
|
synchronized (c) {
|
|
ArrayList<a> arrayList = c.get(str);
|
|
if (arrayList == null) {
|
|
arrayList = new ArrayList<>();
|
|
}
|
|
arrayList.add(new a(str2));
|
|
c.put(str, arrayList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public static synchronized ArrayList<String> a(String str, Boolean bool) {
|
|
synchronized (b.class) {
|
|
ArrayList<String> arrayList = new ArrayList<>();
|
|
ArrayList arrayList2 = new ArrayList();
|
|
synchronized (c) {
|
|
ArrayList<a> arrayList3 = c.get(str);
|
|
if (arrayList3 != null && arrayList3.size() != 0) {
|
|
if (bool.booleanValue()) {
|
|
for (int i = 0; i < arrayList3.size(); i++) {
|
|
if (arrayList3.get(i).c() < 3) {
|
|
arrayList2.add(arrayList3.get(i));
|
|
arrayList3.get(i).b();
|
|
arrayList.add(arrayList3.get(i).a());
|
|
}
|
|
}
|
|
a(str, (ArrayList<a>) arrayList2);
|
|
} else {
|
|
Iterator<a> it = arrayList3.iterator();
|
|
while (it.hasNext()) {
|
|
arrayList.add(it.next().a());
|
|
}
|
|
c.remove(str);
|
|
}
|
|
return arrayList;
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static synchronized ConcurrentHashMap<String, APMUploadConfigure> a() {
|
|
ConcurrentHashMap<String, APMUploadConfigure> concurrentHashMap;
|
|
synchronized (b.class) {
|
|
concurrentHashMap = b;
|
|
}
|
|
return concurrentHashMap;
|
|
}
|
|
|
|
static synchronized void a(String str, ArrayList<a> arrayList) {
|
|
synchronized (b.class) {
|
|
synchronized (c) {
|
|
if (arrayList != null) {
|
|
c.put(str, arrayList);
|
|
} else {
|
|
c.remove(str);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|