Examples of ProtocolCodingException


Examples of net.windwards.dnsfrontend.dialog.ProtocolCodingException

public class JSONClientProtocol extends JSONProtocol {
    public byte[] encode(Update update) throws ProtocolCodingException {
        try {
            return this.mapper.writeValueAsBytes(update);
        } catch (IOException e) {
            throw new ProtocolCodingException(e);
        }
    }
View Full Code Here

Examples of net.windwards.dnsfrontend.dialog.ProtocolCodingException

    public Message decode(byte[] data) throws ProtocolCodingException {
        try {
            return this.mapper.readValue(data, Message.class);
        } catch (IOException e) {
            throw new ProtocolCodingException(e);
        }
    }
View Full Code Here

Examples of net.windwards.dnsfrontend.dialog.ProtocolCodingException

            if(!(message instanceof Update)) return null; // For now
            update = (Update) message;
            qualified = configuration.qualifiedDomainName(update.name, update.moniker);
            address = InetAddress.getByName(update.address);
        } catch (IOException e) {
            throw new ProtocolCodingException(e);
        }

        int ttl = configuration.getTtl(update.moniker);

        Record record;
        if("ipv4".equals(update.family)) {
            record =  new ARecord(qualified, DClass.IN, ttl, address);
        } else if ("ipv6".equals(update.family)) {
            record = new AAAARecord(qualified, DClass.IN, ttl, address);
        } else {
            throw new ProtocolCodingException("Can't decode " + new String(data));
        }
        return record;
    }
View Full Code Here

Examples of net.windwards.dnsfrontend.dialog.ProtocolCodingException

                    break;
                case IPV6_UPDATE:
                    addr = getIPv6Address(buf);
                    break;
                default:
                    throw new ProtocolCodingException("Unkown operation: " + type);
            }
        } catch (UnknownHostException e) {
            throw new ProtocolCodingException(e);
        }

        String host = getSizedString(buf);
        String moniker = getSizedString(buf);

        Name qualified;
        try {
            qualified = configuration.qualifiedDomainName(host, moniker);
        } catch (TextParseException e) {
            throw new ProtocolCodingException(e);
        }

        long ttl = configuration.getTtl(moniker);

        switch (type) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.