@Override public String getName() { return this.wrappedServer.getName(); }
@Override public boolean isStarted() { return this.wrappedServer.isStarted(); }
@Override public List<String> getAssociations() { return this.wrappedServer.getAssociations(); }
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()); String[] secondaryHostAdd = server.getExtraHostAddresses(); List<String> associations = server.getAssociations(); sb.append(M3UAOAMMessages.NEW_LINE); sb.append("Associations:");
public void startServer(String serverName) throws Exception { if (!this.started) { throw new Exception(String.format("Management=%s not started", this.name)); } if (name == null) { throw new Exception("Server name cannot be null"); } FastList<Server> tempServers = servers; for (FastList.Node<Server> n = tempServers.head(), end = tempServers.tail(); (n = n.getNext()) != end;) { Server serverTemp = n.getValue(); if (serverName.equals(serverTemp.getName())) { if (serverTemp.isStarted()) { throw new Exception(String.format("Server=%s is already started", serverName)); } ((ServerImpl) serverTemp).start(); this.store(); return; } } throw new Exception(String.format("No Server foubd with name=%s", serverName)); }
for (FastList.Node<Server> n = this.servers.head(), end = this.servers.tail(); (n = n.getNext()) != end;) { Server serverTemp = n.getValue(); if (serverName.equals(serverTemp.getName())) { throw new Exception(String.format("Server name=%s already exist", serverName)); if (hostAddress.equals(serverTemp.getHostAddress()) && port == serverTemp.getHostport()) { throw new Exception(String.format("Server name=%s is already bound to %s:%d", serverTemp.getName(), serverTemp.getHostAddress(), serverTemp.getHostport()));
if (s.getName().equals(serverName)) { server = s; break; for (String assocName : server.getAssociations()) { Association a = management.getAssociation(assocName); if (a.getName().equals(serverAssociationName)) { serverAssociation.setAssociationListener(new ServerAssociationListener()); this.management.startAssociation(serverAssociationName); if (!server.isStarted()) { logger.debug("Starting server"); this.management.startServer(serverName);
if (serverTemp.getName().equals(serverName)) { server = serverTemp; if (server.getIpChannelType() != ipChannelType) throw new Exception(String.format("Server and Accociation has different IP channel type"));
if (srv.getName().equals(association.getServerName())) { if (!provisioned && srv.isAcceptAnonymousConnections() && this.management.getServerListener() != null) { AssociationImpl anonymAssociation = new AssociationImpl(firstInetAddress.getHostAddress(), firstPort, srv.getName(), srv.getIpChannelType(), srvv); anonymAssociation.setManagement(this.management); anonymAssociation.setSocketChannel(socketChannel);
@Override public int getHostport() { return this.wrappedServer.getHostport(); }
@Override public IpChannelType getIpChannelType() { return this.wrappedServer.getIpChannelType(); }
@Override public String getHostAddress() { return this.wrappedServer.getHostAddress(); }
@Override public String[] getExtraHostAddresses() { return this.wrappedServer.getExtraHostAddresses(); }
@Override public boolean isAcceptAnonymousConnections() { return this.wrappedServer.isAcceptAnonymousConnections(); }
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()); String[] secondaryHostAdd = server.getExtraHostAddresses(); List<String> associations = server.getAssociations(); sb.append(M3UAOAMMessages.NEW_LINE); sb.append("Associations:");
@Override public void startServer(String serverName) throws Exception { if (!this.started) { throw new Exception(String.format("Management=%s not started", this.name)); } if (name == null) { throw new Exception("Server name cannot be null"); } FastList<Server> tempServers = servers; for (FastList.Node<Server> n = tempServers.head(), end = tempServers.tail(); (n = n.getNext()) != end;) { Server serverTemp = n.getValue(); if (serverName.equals(serverTemp.getName())) { if (serverTemp.isStarted()) { throw new Exception(String.format("Server=%s is already started", serverName)); } ((NettyServerImpl) serverTemp).start(); this.store(); return; } } throw new Exception(String.format("No Server foubd with name=%s", serverName)); }
for (FastList.Node<Server> n = this.servers.head(), end = this.servers.tail(); (n = n.getNext()) != end;) { Server serverTemp = n.getValue(); if (serverName.equals(serverTemp.getName())) { throw new Exception(String.format("Server name=%s already exist", serverName)); if (hostAddress.equals(serverTemp.getHostAddress()) && port == serverTemp.getHostport()) { throw new Exception(String.format("Server name=%s is already bound to %s:%d", serverTemp.getName(), serverTemp.getHostAddress(), serverTemp.getHostport()));
if (serverTemp.getName().equals(serverName)) { server = serverTemp; if (server.getIpChannelType() != ipChannelType) throw new Exception(String.format("Server and Accociation has different IP channel type"));
for (FastList.Node<Server> n = tempServers.head(), end = tempServers.tail(); (n = n.getNext()) != end;) { Server serverTemp = n.getValue(); if (serverTemp.isStarted()) { try { ((ServerImpl) serverTemp).stop(); } catch (Exception e) { logger.error(String.format("Exception while stopping the Server=%s", serverTemp.getName()), e);
private void removeServerFromManagement(Server srv) { synchronized (this) { Server srvBeanX = null; for (Server srvBean : lstServers) { if (srvBean.getName().equals(srv.getName())) { srvBeanX = srvBean; break; } } lstServers.remove(srvBeanX); this.ss7Management.unregisterMBean(Ss7Layer.SCTP, SctpManagementType.SERVER, srv.getName()); } }