Package codes.thischwa.cf.fluent
Class RecordOperationsImpl
java.lang.Object
codes.thischwa.cf.fluent.RecordOperationsImpl
- All Implemented Interfaces:
RecordOperations
Implementation of RecordOperations for fluent API access to record-level operations.
-
Constructor Summary
ConstructorsConstructorDescriptionRecordOperationsImpl(CfDnsClient client, ZoneEntity zone, String sld, @Nullable RecordType[] types) Constructs a RecordOperationsImpl instance. -
Method Summary
Modifier and TypeMethodDescriptioncreate(RecordType type, String content, int ttl) Creates a new DNS record with the specified parameters.voiddelete(RecordType... types) Deletes DNS records of the specified types.get()Retrieves DNS records for the selected subdomain.Updates an existing DNS record with new content.
-
Constructor Details
-
RecordOperationsImpl
public RecordOperationsImpl(CfDnsClient client, ZoneEntity zone, String sld, @Nullable @Nullable RecordType[] types) Constructs a RecordOperationsImpl instance.- Parameters:
client- the CfDnsClient instance to use for operationszone- the ZoneEntity representing the DNS zonesld- the subdomain (second-level domain) nametypes- optional array of RecordType to filter by
-
-
Method Details
-
get
Description copied from interface:RecordOperationsRetrieves DNS records for the selected subdomain.- Specified by:
getin interfaceRecordOperations- Returns:
- a list of RecordEntity objects matching the criteria
- Throws:
CloudflareApiException- if an error occurs while retrieving records
-
create
Description copied from interface:RecordOperationsCreates a new DNS record with the specified parameters.- Specified by:
createin interfaceRecordOperations- Parameters:
type- the DNS record type (e.g., A, AAAA, CNAME)content- the content of the DNS record (e.g., IP address)ttl- the time-to-live value in seconds- Returns:
- the created RecordEntity
- Throws:
CloudflareApiException- if an error occurs while creating the record
-
update
Description copied from interface:RecordOperationsUpdates an existing DNS record with new content.- Specified by:
updatein interfaceRecordOperations- Parameters:
newContent- the new content for the DNS record- Returns:
- the updated RecordEntity
- Throws:
CloudflareApiException- if an error occurs while updating the record
-
delete
Description copied from interface:RecordOperationsDeletes DNS records of the specified types.- Specified by:
deletein interfaceRecordOperations- Parameters:
types- the DNS record types to delete- Throws:
CloudflareApiException- if an error occurs while deleting records
-