|
11 | 11 | import de.dytanic.cloudnet.lib.MultiValue;
|
12 | 12 | import de.dytanic.cloudnet.lib.database.Database;
|
13 | 13 | import de.dytanic.cloudnet.lib.database.DatabaseDocument;
|
14 |
| -import de.dytanic.cloudnet.lib.utility.Acceptable; |
15 |
| -import de.dytanic.cloudnet.lib.utility.CollectionWrapper; |
16 | 14 | import de.dytanic.cloudnet.lib.utility.MapWrapper;
|
17 | 15 | import de.dytanic.cloudnet.lib.utility.Return;
|
18 | 16 | import de.dytanic.cloudnet.lib.utility.document.Document;
|
@@ -56,17 +54,33 @@ public void putPostResponse(MultiValue<PostResponse, String> postResponse)
|
56 | 54 | public boolean contains(CloudFlareConfig cloudFlareConfig, String wrapper)
|
57 | 55 | {
|
58 | 56 | Document document = database.getDocument(CLOUDFLARE_CACHE);
|
| 57 | + |
| 58 | + /* |
59 | 59 | Map<String, MultiValue<PostResponse, String>> responses = document.getObject("requests", new TypeToken<Map<String, MultiValue<PostResponse, String>>>() {
|
60 | 60 | }.getType());
|
| 61 | + */ |
61 | 62 |
|
| 63 | + /* |
62 | 64 | return CollectionWrapper.filter(responses.values(), new Acceptable<MultiValue<PostResponse, String>>() {
|
63 | 65 | @Override
|
64 | 66 | public boolean isAccepted(MultiValue<PostResponse, String> value)
|
65 | 67 | {
|
66 | 68 | return value.getSecond().equalsIgnoreCase(wrapper) && value.getFirst().getCloudFlareConfig().getDomainName().equalsIgnoreCase(cloudFlareConfig.getDomainName());
|
67 | 69 | }
|
68 | 70 | }) != null;
|
| 71 | + */ |
| 72 | + |
| 73 | + for (String key : document.keys()) |
| 74 | + if (!key.equalsIgnoreCase(Database.UNIQUE_NAME_KEY)) |
| 75 | + { |
| 76 | + MultiValue<PostResponse, String> value = document.getObject(key, new TypeToken<MultiValue<PostResponse, String>>() { |
| 77 | + }.getType()); |
| 78 | + |
| 79 | + if (value.getSecond().equalsIgnoreCase(wrapper) && value.getFirst().getCloudFlareConfig().getDomainName().equalsIgnoreCase(cloudFlareConfig.getDomainName())) |
| 80 | + return true; |
| 81 | + } |
69 | 82 |
|
| 83 | + return false; |
70 | 84 | //return document.contains(wrapper);
|
71 | 85 | }
|
72 | 86 |
|
|
0 commit comments