Example usage for com.amazonaws.services.route53.model RRType AAAA

List of usage examples for com.amazonaws.services.route53.model RRType AAAA

Introduction

In this page you can find the example usage for com.amazonaws.services.route53.model RRType AAAA.

Prototype

RRType AAAA

To view the source code for com.amazonaws.services.route53.model RRType AAAA.

Click Source Link

Usage

From source file:net.za.slyfox.dyn53.route53.Route53Updater.java

License:Apache License

/**
 * Maps the given {@link InetAddress} to a {@link RRType} enumeration value.
 *
 * @param address the address to map//from w w w .  ja  v  a  2s  .  c o  m
 * @return the {@code RRType} enumeration value corresponding to the type of address given
 * @throws IllegalArgumentException if {@code address} cannot be mapped to a value in the {@code RRType} enumeration
 */
private static RRType getResourceRecordType(InetAddress address) {
    if (address instanceof Inet4Address) {
        return RRType.A;
    } else if (address instanceof Inet6Address) {
        return RRType.AAAA;
    } else {
        throw new IllegalArgumentException("Unsupported address type " + address.getClass());
    }
}

From source file:org.ofbiz.tenant.amazonaws.util.AwsUtil.java

License:Apache License

/**
 * get resource record type//from   w  w  w .  jav  a2  s  . c o  m
 * @param value
 * @return
 * @throws GeneralException
 */
public static RRType getRRType(String value) throws GeneralException {
    RRType rrType = null;
    if ("A".equals(value)) {
        rrType = RRType.A;
    } else if ("CNAME".equals(value)) {
        rrType = RRType.CNAME;
    } else if ("MX".equals(value)) {
        rrType = RRType.MX;
    } else if ("AAAA".equals(value)) {
        rrType = RRType.AAAA;
    } else if ("TXT".equals(value)) {
        rrType = RRType.TXT;
    } else if ("PTR".equals(value)) {
        rrType = RRType.PTR;
    } else if ("SRV".equals(value)) {
        rrType = RRType.SRV;
    } else if ("SPF".equals(value)) {
        rrType = RRType.SPF;
    } else if ("NS".equals(value)) {
        rrType = RRType.NS;
    } else if ("SOA".equals(value)) {
        rrType = RRType.SOA;
    } else {
        throw new GeneralException(
                "The type need to be one of: A, CNAME, MX, AAAA, TXT, PTR, SRV, SPF, NS, SOA");
    }
    return rrType;
}