Class CloudFlareAPI
- java.lang.Object
-
- de.dytanic.cloudnet.ext.cloudflare.cloudflare.CloudFlareAPI
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class CloudFlareAPI extends java.lang.Object implements java.lang.AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringCLOUDFLARE_ENDPOINTprotected com.google.common.collect.Multimap<java.util.UUID,DnsRecordDetail>createdRecordsprotected static java.lang.StringZONE_RECORDS_ENDPOINTprotected static java.lang.StringZONE_RECORDS_MANAGEMENT_ENDPOINT
-
Constructor Summary
Constructors Constructor Description CloudFlareAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()@Nullable DnsRecordDetailcreateRecord(@NotNull java.util.UUID serviceUniqueId, @NotNull CloudflareConfigurationEntry configuration, @NotNull DNSRecord record)@NotNull java.util.Collection<DnsRecordDetail>deleteAllRecords(@NotNull de.dytanic.cloudnet.service.ICloudService service)@NotNull java.util.Collection<DnsRecordDetail>deleteAllRecords(@NotNull java.util.UUID serviceUniqueId)booleandeleteRecord(@NotNull DnsRecordDetail recordDetail)booleandeleteRecord(@NotNull CloudflareConfigurationEntry configuration, @NotNull java.lang.String id)@NotNull java.util.Collection<DnsRecordDetail>getCreatedRecords()@NotNull java.util.Collection<DnsRecordDetail>getCreatedRecords(@NotNull java.util.UUID serviceUniqueId)@NotNull java.util.Collection<java.util.UUID>getServiceUniqueIds()protected @NotNull java.net.HttpURLConnectionprepareConnection(@NotNull java.lang.String endpoint, @NotNull java.lang.String method, @NotNull CloudflareConfigurationEntry entry)protected @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocumentsendRequestAndReadResponse(@NotNull java.net.HttpURLConnection connection)protected @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocumentsendRequestAndReadResponse(@NotNull java.net.HttpURLConnection connection, @NotNull DNSRecord record)protected @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocumentsendRequestAndReadResponse(@NotNull java.net.HttpURLConnection connection, @Nullable java.lang.String data)
-
-
-
Field Detail
-
CLOUDFLARE_ENDPOINT
protected static final java.lang.String CLOUDFLARE_ENDPOINT
- See Also:
- Constant Field Values
-
ZONE_RECORDS_ENDPOINT
protected static final java.lang.String ZONE_RECORDS_ENDPOINT
- See Also:
- Constant Field Values
-
ZONE_RECORDS_MANAGEMENT_ENDPOINT
protected static final java.lang.String ZONE_RECORDS_MANAGEMENT_ENDPOINT
- See Also:
- Constant Field Values
-
createdRecords
protected final com.google.common.collect.Multimap<java.util.UUID,DnsRecordDetail> createdRecords
-
-
Method Detail
-
createRecord
@Nullable public @Nullable DnsRecordDetail createRecord(@NotNull @NotNull java.util.UUID serviceUniqueId, @NotNull @NotNull CloudflareConfigurationEntry configuration, @NotNull @NotNull DNSRecord record)
-
deleteRecord
public boolean deleteRecord(@NotNull @NotNull DnsRecordDetail recordDetail)
-
deleteAllRecords
@NotNull public @NotNull java.util.Collection<DnsRecordDetail> deleteAllRecords(@NotNull @NotNull de.dytanic.cloudnet.service.ICloudService service)
-
deleteAllRecords
@NotNull public @NotNull java.util.Collection<DnsRecordDetail> deleteAllRecords(@NotNull @NotNull java.util.UUID serviceUniqueId)
-
deleteRecord
public boolean deleteRecord(@NotNull @NotNull CloudflareConfigurationEntry configuration, @NotNull @NotNull java.lang.String id)
-
prepareConnection
@NotNull protected @NotNull java.net.HttpURLConnection prepareConnection(@NotNull @NotNull java.lang.String endpoint, @NotNull @NotNull java.lang.String method, @NotNull @NotNull CloudflareConfigurationEntry entry) throws java.io.IOException- Throws:
java.io.IOException
-
sendRequestAndReadResponse
@NotNull protected @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument sendRequestAndReadResponse(@NotNull @NotNull java.net.HttpURLConnection connection) throws java.io.IOException- Throws:
java.io.IOException
-
sendRequestAndReadResponse
@NotNull protected @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument sendRequestAndReadResponse(@NotNull @NotNull java.net.HttpURLConnection connection, @NotNull @NotNull DNSRecord record) throws java.io.IOException- Throws:
java.io.IOException
-
sendRequestAndReadResponse
@NotNull protected @NotNull de.dytanic.cloudnet.common.document.gson.JsonDocument sendRequestAndReadResponse(@NotNull @NotNull java.net.HttpURLConnection connection, @Nullable @Nullable java.lang.String data) throws java.io.IOException- Throws:
java.io.IOException
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
getCreatedRecords
@NotNull public @NotNull java.util.Collection<DnsRecordDetail> getCreatedRecords(@NotNull @NotNull java.util.UUID serviceUniqueId)
-
getCreatedRecords
@NotNull public @NotNull java.util.Collection<DnsRecordDetail> getCreatedRecords()
-
getServiceUniqueIds
@NotNull public @NotNull java.util.Collection<java.util.UUID> getServiceUniqueIds()
-
-