Association asso = associations.get(s); sb.append(M3UAOAMMessages.NEW_LINE); sb.append("ASSOCIATION ").append(asso.getIpChannelType().getType()).append(" name=").append(asso.getName()) .append(" started=").append(asso.isStarted()).append(" peerIp=").append(asso.getPeerAddress()) .append(" peerPort=").append(asso.getPeerPort());
@Override public Server addSctpServer(String serverName, String hostAddress, int port, String ipChannelType, boolean acceptAnonymousConnections, int maxConcurrentConnectionsCount, String extraHostAddresses) throws Exception { this.wrappedSctpManagement.addServer(serverName, hostAddress, port, IpChannelType.valueOf(ipChannelType.toUpperCase()), acceptAnonymousConnections, maxConcurrentConnectionsCount, (extraHostAddresses != null && !extraHostAddresses.isEmpty()) ? extraHostAddresses.split(",") : null); return null; }
@Override public String getSctpIPChannelType_Value() { return this.testerHost.getConfigurationData().getM3uaConfigurationData().getIpChannelType().toString(); }
@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); }
ipChnnelType = IpChannelType.getInstance(args[i + 1]); ipChnnelType = IpChannelType.getInstance(args[i + 1]); ipChnnelType = IpChannelType.getInstance(args[i + 1]);
@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); } };
@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); } }
ipChnnelType = IpChannelType.getInstance(args[i + 1]); case "port": port = Integer.valueOf(args[i + 1]); break; case "sockettype": ipChannelType = IpChannelType.getInstance(args[i + 1]); break; case "anonymconnect": acceptAnonymousConnections = Boolean.valueOf(args[i + 1]); ipChnnelType = IpChannelType.getInstance(args[i + 1]); ipChnnelType = IpChannelType.getInstance(args[i + 1]); case "peerport": peerPort = Integer.valueOf(args[i + 1]); break; case "sockettype": ipChannelType = IpChannelType.getInstance(args[i + 1]); break; case "host": hostAddress = args[i + 1]; case "peerport": peerPort = Integer.valueOf(args[i + 1]); break; case "sockettype": ipChannelType = IpChannelType.getInstance(args[i + 1]); break; case "servername": serverName = args[i + 1];
@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); } };
@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); }
@Override public Association addSctpAssociation(String hostAddress, int hostPort, String peerAddress, int peerPort, String assocName, String ipChannelType, String extraHostAddresses) throws Exception { this.wrappedSctpManagement.addAssociation(hostAddress, hostPort, peerAddress, peerPort, assocName, IpChannelType.valueOf(ipChannelType.toUpperCase()), (extraHostAddresses != null && !extraHostAddresses.isEmpty()) ? extraHostAddresses.split(",") : null); return null; }
for (Server server : servers) { sb.append(M3UAOAMMessages.NEW_LINE); sb.append("SERVER ").append(server.getIpChannelType().getType()).append(" name=").append(server.getName()) .append(" started=").append(server.isStarted()).append(" hostIp=").append(server.getHostAddress()) .append(" hostPort=").append(server.getHostport());
@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); } } } };
public void write(M3uaConfigurationData m3ua, OutputElement xml) throws XMLStreamException { xml.setAttribute(STORE_PCAP_TRACE, m3ua.storePcapTrace); xml.setAttribute(IS_SCTP_SERVER, m3ua.isSctpServer); xml.setAttribute(LOCAL_PORT, m3ua.localPort); xml.setAttribute(LOCAL_PORT_2, m3ua.localPort2); xml.setAttribute(REMOTE_PORT, m3ua.remotePort); xml.setAttribute(REMOTE_PORT_2, m3ua.remotePort2); xml.setAttribute(IP_CHANNEL_TYPE, m3ua.ipChannelType.toString()); xml.setAttribute(DPC, m3ua.dpc); xml.setAttribute(DPC_2, m3ua.dpc2); xml.setAttribute(OPC, m3ua.opc); xml.setAttribute(OPC_2, m3ua.opc2); xml.setAttribute(SI, m3ua.si); xml.setAttribute(ROUTING_CONTEXT, m3ua.routingContext); xml.setAttribute(NETWORK_APPEARANCE, m3ua.networkAppearance); xml.setAttribute(TRAFFIC_MODE_TYPE, m3ua.trafficModeType); xml.setAttribute(M3UA_FUNCTIONALITY, m3ua.m3uaFunctionality.toString()); xml.setAttribute(M3UA_EXCHANGE_TYPE, m3ua.m3uaExchangeType.toString()); xml.setAttribute(ROUTING_LABEL_FORMAT, m3ua.routingLabelFormat.toString()); xml.setAttribute(M3UA_IPSPType, m3ua.m3uaIPSPType.toString()); xml.add(m3ua.localHost, LOCAL_HOST, String.class); xml.add(m3ua.localHost2, LOCAL_HOST_2, String.class); xml.add(m3ua.remoteHost, REMOTE_HOST, String.class); xml.add(m3ua.remoteHost2, REMOTE_HOST_2, String.class); if (m3ua.getSctpExtraHostAddresses() != null && !m3ua.getSctpExtraHostAddresses().equals("")) { xml.add(m3ua.getSctpExtraHostAddresses(), EXTRA_HOST_ADDRESSES, 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); } }
@Override public Association addSctpServerAssociation(String peerAddress, int peerPort, String serverName, String assocName, String ipChannelType) throws Exception { this.wrappedSctpManagement.addServerAssociation(peerAddress, peerPort, serverName, assocName, IpChannelType.valueOf(ipChannelType.toUpperCase())); return null; }
for (Server server : servers) { sb.append(M3UAOAMMessages.NEW_LINE); sb.append("SERVER ").append(server.getIpChannelType().getType()).append(" name=").append(server.getName()) .append(" started=").append(server.isStarted()).append(" hostIp=").append(server.getHostAddress()) .append(" hostPort=").append(server.getHostport());
@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); } } } };
@Override public Association modifySctpServerAssociation(String peerAddress, String peerPort, String serverName, String assocName, String ipChannelType) throws Exception { String currPeerAddress = null; if(peerAddress!=null && !peerAddress.isEmpty()) currPeerAddress = peerAddress; Integer currPeerPort = null; if(peerPort!=null && !peerPort.isEmpty()) currPeerPort = Integer.valueOf(peerPort); String currServerName = null; if(serverName!=null && !serverName.isEmpty()) currServerName = serverName; IpChannelType currIpChannelType = null; if(ipChannelType!=null && !ipChannelType.isEmpty()) currIpChannelType = IpChannelType.valueOf(ipChannelType.toUpperCase()); this.wrappedSctpManagement.modifyServerAssociation(assocName, currPeerAddress, currPeerPort, currServerName, currIpChannelType); return null; }
Association asso = associations.get(s); sb.append(M3UAOAMMessages.NEW_LINE); sb.append("ASSOCIATION ").append(asso.getIpChannelType().getType()).append(" name=").append(asso.getName()) .append(" started=").append(asso.isStarted()).append(" peerIp=").append(asso.getPeerAddress()) .append(" peerPort=").append(asso.getPeerPort());