@Override public void write(NettyServerImpl server, javolution.xml.XMLFormat.OutputElement xml) throws XMLStreamException { xml.setAttribute(NAME, server.name); xml.setAttribute(STARTED, server.started); xml.setAttribute(HOST_ADDRESS, server.hostAddress); xml.setAttribute(HOST_PORT, server.hostport); xml.setAttribute(IPCHANNEL_TYPE, server.ipChannelType.getCode()); xml.setAttribute(ACCEPT_ANONYMOUS_CONNECTIONS, server.acceptAnonymousConnections); xml.setAttribute(MAX_CONCURRENT_CONNECTIONS_COUNT, server.maxConcurrentConnectionsCount); xml.setAttribute(EXTRA_HOST_ADDRESS_SIZE, server.extraHostAddresses != null ? server.extraHostAddresses.length : 0); if (server.extraHostAddresses != null) { for (String s : server.extraHostAddresses) { xml.add(s, EXTRA_HOST_ADDRESS, String.class); } } xml.add(server.associations, ASSOCIATIONS, FastList.class); } };
@Override public void write(ServerImpl server, javolution.xml.XMLFormat.OutputElement xml) throws XMLStreamException { xml.setAttribute(NAME, server.name); xml.setAttribute(STARTED, server.started); xml.setAttribute(HOST_ADDRESS, server.hostAddress); xml.setAttribute(HOST_PORT, server.hostport); xml.setAttribute(IPCHANNEL_TYPE, server.ipChannelType.getCode()); xml.setAttribute(ACCEPT_ANONYMOUS_CONNECTIONS, server.acceptAnonymousConnections); xml.setAttribute(MAX_CONCURRENT_CONNECTIONS_COUNT, server.maxConcurrentConnectionsCount); xml.setAttribute(EXTRA_HOST_ADDRESS_SIZE, server.extraHostAddresses != null ? server.extraHostAddresses.length : 0); if (server.extraHostAddresses != null) { for (String s : server.extraHostAddresses) { xml.add(s, EXTRA_HOST_ADDRESS, String.class); } } xml.add(server.associations, ASSOCIATIONS, FastList.class); } };
@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); } } } };
@Override public void write(AssociationImpl 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); } } } };
@SuppressWarnings("unchecked") @Override public void read(javolution.xml.XMLFormat.InputElement xml, ServerImpl server) throws XMLStreamException { server.name = xml.getAttribute(NAME, ""); server.started = xml.getAttribute(STARTED, false); server.hostAddress = xml.getAttribute(HOST_ADDRESS, ""); server.hostport = xml.getAttribute(HOST_PORT, 0); server.ipChannelType = IpChannelType.getInstance(xml.getAttribute(IPCHANNEL_TYPE, IpChannelType.SCTP.getCode())); if (server.ipChannelType == null) throw new XMLStreamException("Bad value for server.ipChannelType"); server.acceptAnonymousConnections = xml.getAttribute(ACCEPT_ANONYMOUS_CONNECTIONS, false); server.maxConcurrentConnectionsCount = xml.getAttribute(MAX_CONCURRENT_CONNECTIONS_COUNT, 0); int extraHostAddressesSize = xml.getAttribute(EXTRA_HOST_ADDRESS_SIZE, 0); server.extraHostAddresses = new String[extraHostAddressesSize]; for(int i=0;i<extraHostAddressesSize;i++){ server.extraHostAddresses[i] = xml.get(EXTRA_HOST_ADDRESS, String.class); } server.associations = xml.get(ASSOCIATIONS, FastList.class); }
@SuppressWarnings("unchecked") @Override public void read(javolution.xml.XMLFormat.InputElement xml, NettyServerImpl server) throws XMLStreamException { server.name = xml.getAttribute(NAME, ""); server.started = xml.getAttribute(STARTED, false); server.hostAddress = xml.getAttribute(HOST_ADDRESS, ""); server.hostport = xml.getAttribute(HOST_PORT, 0); server.ipChannelType = IpChannelType.getInstance(xml.getAttribute(IPCHANNEL_TYPE, IpChannelType.SCTP.getCode())); if (server.ipChannelType == null) throw new XMLStreamException("Bad value for server.ipChannelType"); server.acceptAnonymousConnections = xml.getAttribute(ACCEPT_ANONYMOUS_CONNECTIONS, false); server.maxConcurrentConnectionsCount = xml.getAttribute(MAX_CONCURRENT_CONNECTIONS_COUNT, 0); int extraHostAddressesSize = xml.getAttribute(EXTRA_HOST_ADDRESS_SIZE, 0); server.extraHostAddresses = new String[extraHostAddressesSize]; for (int i = 0; i < extraHostAddressesSize; i++) { server.extraHostAddresses[i] = xml.get(EXTRA_HOST_ADDRESS, String.class); } server.associations = xml.get(ASSOCIATIONS, FastList.class); }
@SuppressWarnings("unchecked") @Override public void read(javolution.xml.XMLFormat.InputElement xml, NettyAssociationImpl association) throws XMLStreamException { association.name = xml.getAttribute(NAME, ""); association.type = AssociationType.getAssociationType(xml.getAttribute(ASSOCIATION_TYPE, "")); association.hostAddress = xml.getAttribute(HOST_ADDRESS, ""); association.hostPort = xml.getAttribute(HOST_PORT, 0); association.peerAddress = xml.getAttribute(PEER_ADDRESS, ""); association.peerPort = xml.getAttribute(PEER_PORT, 0); association.serverName = xml.getAttribute(SERVER_NAME, ""); association.ipChannelType = IpChannelType .getInstance(xml.getAttribute(IPCHANNEL_TYPE, IpChannelType.SCTP.getCode())); if (association.ipChannelType == null) association.ipChannelType = IpChannelType.SCTP; int extraHostAddressesSize = xml.getAttribute(EXTRA_HOST_ADDRESS_SIZE, 0); association.extraHostAddresses = new String[extraHostAddressesSize]; for (int i = 0; i < extraHostAddressesSize; i++) { association.extraHostAddresses[i] = xml.get(EXTRA_HOST_ADDRESS, String.class); } }
@SuppressWarnings("unchecked") @Override public void read(javolution.xml.XMLFormat.InputElement xml, AssociationImpl association) throws XMLStreamException { association.name = xml.getAttribute(NAME, ""); association.type = AssociationType.getAssociationType(xml.getAttribute(ASSOCIATION_TYPE, "")); association.hostAddress = xml.getAttribute(HOST_ADDRESS, ""); association.hostPort = xml.getAttribute(HOST_PORT, 0); association.peerAddress = xml.getAttribute(PEER_ADDRESS, ""); association.peerPort = xml.getAttribute(PEER_PORT, 0); association.serverName = xml.getAttribute(SERVER_NAME, ""); association.ipChannelType = IpChannelType.getInstance(xml.getAttribute(IPCHANNEL_TYPE, IpChannelType.SCTP.getCode())); if (association.ipChannelType == null) association.ipChannelType = IpChannelType.SCTP; int extraHostAddressesSize = xml.getAttribute(EXTRA_HOST_ADDRESS_SIZE, 0); association.extraHostAddresses = new String[extraHostAddressesSize]; for (int i = 0; i < extraHostAddressesSize; i++) { association.extraHostAddresses[i] = xml.get(EXTRA_HOST_ADDRESS, String.class); } }