/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A packet to broadcasts JMX URL
*
* Fields:
*
* <ul>
* discovery service</li>
* <li>JMX_URL - URL to connect to JMX service</li>
* <li>MAIN_CLASS - optional name of main class, filled from sun.java.command stripped for
* security reason to first space</li>
* <li>INSTANCE_NAME - optional custom name of particular instance as provided by customer</li>
* </ul>
*/
public final class JdpJmxPacket
extends JdpGenericPacket
implements JdpPacket {
/**
* Session ID
*/
/**
* Name of main class
*/
/**
* JMX service URL
*/
/**
* Name of Java instance
*/
/**
* Create new instance from user provided data. Set mandatory fields
*
* @param id - java instance id
* @param jmxServiceUrl - JMX service url
*/
this.jmxServiceUrl = jmxServiceUrl;
}
/**
* Create new instance from network data Parse packet and set fields.
*
* @param data - raw packet data as it came from a Net
* @throws JdpException
*/
throws JdpException {
}
/**
* Set main class field
*
* @param mainClass - main class of running app
*/
}
/**
* Set instance name field
*
* @param instanceName - name of instance as provided by customer
*/
this.instanceName = instanceName;
}
/**
* @return id of discovery session
*/
return id;
}
/**
*
* @return main class field
*/
return mainClass;
}
/**
*
* @return JMX service URL
*/
return jmxServiceUrl;
}
/**
*
* @return instance name
*/
return instanceName;
}
/**
*
* @return assembled packet ready to be sent across a Net
* @throws IOException
*/
// Assemble packet from fields to byte array
writer = new JdpPacketWriter();
return writer.getPacketBytes();
}
/**
*
* @return packet hash code
*/
public int hashCode() {
int hash = 1;
return hash;
}
/**
* Compare two packets
*
* @param o - packet to compare
* @return either packet equals or not
*/
if (o == null || ! (o instanceof JdpJmxPacket) ){
return false;
}
JdpJmxPacket p = (JdpJmxPacket) o;
}
}