Examples of HubInfoData


Examples of org.apache.hedwig.protocol.PubSubProtocol.HubInfoData

            }
            return new HubInfo(owner, 0L);
        }

        // it is a protobuf encoded hub info.
        HubInfoData hubInfoData;

        try {
            BufferedReader reader = new BufferedReader(
                new StringReader(hubInfoStr));
            HubInfoData.Builder dataBuilder = HubInfoData.newBuilder();
            TextFormat.merge(reader, dataBuilder);
            hubInfoData = dataBuilder.build();
        } catch (InvalidProtocolBufferException ipbe) {
            throw new InvalidHubInfoException("Corrupted hub info : " + hubInfoStr, ipbe);
        } catch (IOException ie) {
            throw new InvalidHubInfoException("Corrupted hub info : " + hubInfoStr, ie);
        }

        final HedwigSocketAddress owner;
        try {
            owner = new HedwigSocketAddress(hubInfoData.getHostname().trim());
        } catch (Exception e) {
            throw new InvalidHubInfoException("Corrupted hub server address : " + hubInfoData.getHostname(), e);
        }
        long ownerZxid = hubInfoData.getCzxid();
        return new HubInfo(owner, ownerZxid, hubInfoData);
    }
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.