Class CloudFlareAPI

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class CloudFlareAPI
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • 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
    • Constructor Detail

      • CloudFlareAPI

        public CloudFlareAPI()
    • Method Detail

      • 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:
        close in interface java.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()