* Only none default values are dumped for performance reasons
* @param extraOffset indenting of tags for nice output
* @return The xml representation
*/
public final String toXml(String extraOffset) {
XmlBuffer sb = new XmlBuffer(1200);
if (extraOffset == null) extraOffset = "";
String offset = Constants.OFFSET + extraOffset;
sb.append(offset).append("<").append(rootTag).append(" type='").appendAttributeEscaped(getType()).append("'");
// For debugging only:
//sb.append(" nodeId='").append(this.nodeId).append("'");
//sb.append(" context='").append(this.context).append("'");
//sb.append(" className='").append(this.className).append("'");
//sb.append(" instanceName='").append(this.instanceName).append("'");
//sb.append(" envPrefix='").append(this.envPrefix).append("'");
if (this.version.isModified())
sb.append(" version='").appendAttributeEscaped(getVersion()).append("'");
if (this.bootstrapHostname.isModified())
sb.append(" bootstrapHostname='").appendAttributeEscaped(getBootstrapHostname()).append("'");
if (this.bootstrapPort.isModified())
sb.append(" bootstrapPort='").append(getBootstrapPort()).append("'");
if (this.sessionId.isModified())
sb.append(" sessionId='").appendAttributeEscaped(getSecretSessionId()).append("'");
if (this.pingInterval.isModified())
sb.append(" pingInterval='").append(getPingInterval()).append("'");
if (this.retries.isModified())
sb.append(" retries='").append(getRetries()).append("'");
if (this.delay.isModified())
sb.append(" delay='").append(getDelay()).append("'");
if (this.oneway.isModified())
sb.append(" oneway='").append(oneway()).append("'");
if (this.dispatcherActive.isModified())
sb.append(" dispatcherActive='").append(isDispatcherActive()).append("'");
if (this.useForSubjectQueue.isModified())
sb.append(" useForSubjectQueue='").append(this.useForSubjectQueue.getValue()).append("'");
if (this.dispatchPlugin.isModified())
sb.append(" dispatchPlugin='").appendAttributeEscaped(this.dispatchPlugin.getValue()).append("'");
if (this.stallOnPingTimeout.isModified())
sb.append(" stallOnPingTimeout='").append(isStallOnPingTimeout()).append("'");
sb.append(">");
sb.append(offset).append(" ").append(getRawAddress());
if (this.collectTime.isModified() || this.burstModeMaxEntries.isModified() || this.burstModeMaxBytes.isModified()) {
sb.append(offset).append(" ").append("<burstMode");
if (this.collectTime.isModified())
sb.append(" collectTime='").append(getCollectTime()).append("'");
if (this.burstModeMaxEntries.isModified())
sb.append(" maxEntries='").append(getBurstModeMaxEntries()).append("'");
if (this.burstModeMaxBytes.isModified())
sb.append(" maxBytes='").append(getBurstModeMaxBytes()).append("'");
sb.append("/>");
}
if (this.compressType.isModified())
sb.append(offset).append(" ").append("<compress type='").appendAttributeEscaped(getCompressType()).append("' minSize='").append(getMinSize()).append("'/>");
if (this.ptpAllowed.isModified()) {
if (this.ptpAllowed.getValue()) {
sb.append(offset).append(" ").append("<ptp/>");
}
else {
sb.append(offset).append(" ").append("<ptp>").append(this.ptpAllowed.getValue()).append("</ptp>");
}
}
if (this.pluginAttributes != null) {
Iterator it = this.pluginAttributes.getClientPropertyMap().values().iterator();
while (it.hasNext()) {
Object obj = it.next();
EncodableData cp = (EncodableData)obj;
sb.append(cp.toXml(offset+" ", ClientProperty.ATTRIBUTE_TAG));
}
}
sb.append(offset).append("</").append(rootTag).append(">");
return sb.toString();
}