5652N/A/*
5744N/A * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
5652N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5652N/A *
5652N/A * This code is free software; you can redistribute it and/or modify it
5652N/A * under the terms of the GNU General Public License version 2 only, as
5744N/A * published by the Free Software Foundation. Oracle designates this
5744N/A * particular file as subject to the "Classpath" exception as provided
5744N/A * by Oracle in the LICENSE file that accompanied this code.
5652N/A *
5652N/A * This code is distributed in the hope that it will be useful, but WITHOUT
5652N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5652N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5652N/A * version 2 for more details (a copy is included in the LICENSE file that
5652N/A * accompanied this code).
5652N/A *
5652N/A * You should have received a copy of the GNU General Public License version
5652N/A * 2 along with this work; if not, write to the Free Software Foundation,
5652N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5652N/A *
5652N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5652N/A * or visit www.oracle.com if you need additional information or have any
5652N/A * questions.
5652N/A */
5652N/Apackage sun.management.jdp;
5652N/A
5652N/Aimport java.io.IOException;
5652N/A
5652N/A/**
5652N/A * Packet to broadcast
5652N/A *
5652N/A * <p>Each packet have to contain MAGIC and PROTOCOL_VERSION in order to be
5652N/A * recognized as a valid JDP packet.</p>
5652N/A *
5652N/A * <p>Default implementation build packet as a set of UTF-8 encoded Key/Value pairs
5652N/A * are stored as an ordered list of values, and are sent to the server
5652N/A * in that order.</p>
5652N/A *
5652N/A * <p>
5652N/A * Packet structure:
5652N/A *
5652N/A * 4 bytes JDP magic (0xC0FFE42)
5652N/A * 2 bytes JDP protocol version (01)
5652N/A *
5652N/A * 2 bytes size of key
5652N/A * x bytes key (UTF-8 encoded)
5652N/A * 2 bytes size of value
5652N/A * x bytes value (UTF-8 encoded)
5652N/A *
5652N/A * repeat as many times as necessary ...
5652N/A * </p>
5652N/A */
5652N/Apublic interface JdpPacket {
5652N/A
5652N/A /**
5652N/A * This method responsible to assemble packet and return a byte array
5652N/A * ready to be sent across a Net.
5652N/A *
5652N/A * @return assembled packet as an array of bytes
5652N/A * @throws IOException
5652N/A */
5652N/A public byte[] getPacketData() throws IOException;
5652N/A
5652N/A}