public class CloudFlareService extends Object
| Modifier and Type | Field and Description |
|---|---|
private Map<String,MultiValue<PostResponse,String>> |
bungeeSRVRecords |
private Collection<CloudFlareConfig> |
cloudFlareConfigs |
private static CloudFlareService |
instance |
private Map<String,MultiValue<PostResponse,String>> |
ipARecords |
private String |
prefix |
private static String |
PREFIX_URL |
| Constructor and Description |
|---|
CloudFlareService(Collection<CloudFlareConfig> cloudFlareConfigs)
Constructs a new CloudFlare Service module with a given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProxy(ProxyProcessMeta proxyServer,
CloudFlareDatabase cloudFlareDatabase)
Adds a new proxy to this service and creates the SRV record at CloudFlare for it.
|
boolean |
bootstrap(Map<String,SimpledWrapperInfo> wrapperInfoMap,
Map<String,ProxyGroup> groups,
CloudFlareDatabase cloudFlareDatabase)
Deprecated.
|
CloudFlareProxyGroup |
cloudFlareProxyGroup(CloudFlareConfig cloudFlareConfig,
String group)
Returns the first
CloudFlareProxyGroup for a given group name. |
PostResponse |
createRecord(CloudFlareConfig cloudFlareConfig,
DNSRecord dnsRecord)
Creates a new DNS record in the configured zone.
|
void |
deleteRecord(PostResponse postResponse)
Deletes a DNSRecord with the id of the DNS record
|
Map<String,MultiValue<PostResponse,String>> |
getBungeeSRVRecords() |
Collection<CloudFlareConfig> |
getCloudFlareConfigs() |
static CloudFlareService |
getInstance() |
Map<String,MultiValue<PostResponse,String>> |
getIpARecords() |
String |
getPrefix() |
void |
removeProxy(ProxyProcessMeta proxyServer,
CloudFlareDatabase cloudFlareDatabase)
Removes a proxy and its DNS records from CloudFlare.
|
boolean |
shutdown(CloudFlareDatabase cloudFlareDatabase) |
private com.google.gson.JsonObject |
toJsonInput(InputStream inputStream) |
private static final String PREFIX_URL
private static CloudFlareService instance
private final String prefix
private final Map<String,MultiValue<PostResponse,String>> ipARecords
private final Map<String,MultiValue<PostResponse,String>> bungeeSRVRecords
private Collection<CloudFlareConfig> cloudFlareConfigs
public CloudFlareService(Collection<CloudFlareConfig> cloudFlareConfigs)
cloudFlareConfigs - the configurations for this instancepublic static CloudFlareService getInstance()
public String getPrefix()
public Collection<CloudFlareConfig> getCloudFlareConfigs()
public Map<String,MultiValue<PostResponse,String>> getBungeeSRVRecords()
public Map<String,MultiValue<PostResponse,String>> getIpARecords()
@Deprecated public boolean bootstrap(Map<String,SimpledWrapperInfo> wrapperInfoMap, Map<String,ProxyGroup> groups, CloudFlareDatabase cloudFlareDatabase)
public void deleteRecord(PostResponse postResponse)
postResponse - the cached information about the dns recordpublic PostResponse createRecord(CloudFlareConfig cloudFlareConfig, DNSRecord dnsRecord)
dnsRecord - the record to createprivate com.google.gson.JsonObject toJsonInput(InputStream inputStream)
public boolean shutdown(CloudFlareDatabase cloudFlareDatabase)
public void addProxy(ProxyProcessMeta proxyServer, CloudFlareDatabase cloudFlareDatabase)
proxyServer - the proxy server to create the SRV record forcloudFlareDatabase - the database to store the response and configuration in.public CloudFlareProxyGroup cloudFlareProxyGroup(CloudFlareConfig cloudFlareConfig, String group)
CloudFlareProxyGroup for a given group name.group - the CloudFlare Proxy Group to search forpublic void removeProxy(ProxyProcessMeta proxyServer, CloudFlareDatabase cloudFlareDatabase)
proxyServer - the proxy server to removecloudFlareDatabase - the database to remove the proxy server fromCopyright © 2020. All rights reserved.