@Override
public void write(NettyAssociationImpl association, javolution.xml.XMLFormat.OutputElement xml)
throws XMLStreamException {
xml.setAttribute(NAME, association.name);
xml.setAttribute(ASSOCIATION_TYPE, association.type.getType());
xml.setAttribute(HOST_ADDRESS, association.hostAddress);
xml.setAttribute(HOST_PORT, association.hostPort);
xml.setAttribute(PEER_ADDRESS, association.peerAddress);
xml.setAttribute(PEER_PORT, association.peerPort);
xml.setAttribute(SERVER_NAME, association.serverName);
xml.setAttribute(IPCHANNEL_TYPE, association.ipChannelType.getCode());
xml.setAttribute(EXTRA_HOST_ADDRESS_SIZE,
association.extraHostAddresses != null ? association.extraHostAddresses.length : 0);
if (association.extraHostAddresses != null) {
for (String s : association.extraHostAddresses) {
xml.add(s, EXTRA_HOST_ADDRESS, String.class);
}
}
}
};