1 11 12 package org.jivesoftware.messenger.spi; 13 14 import org.jivesoftware.util.Version; 15 import org.jivesoftware.messenger.XMPPServerInfo; 16 import org.jivesoftware.messenger.ConnectionManager; 17 import org.jivesoftware.util.JiveGlobals; 18 19 import java.util.Date ; 20 import java.util.Iterator ; 21 import java.util.Collections ; 22 23 29 public class XMPPServerInfoImpl implements XMPPServerInfo { 30 31 private Date startDate; 32 private Date stopDate; 33 private String name; 34 private Version ver; 35 private ConnectionManager connectionManager; 36 37 48 public XMPPServerInfoImpl(String serverName, Version version, Date startDate, Date stopDate, 49 ConnectionManager connectionManager) 50 { 51 this.name = serverName; 52 this.ver = version; 53 this.startDate = startDate; 54 this.stopDate = stopDate; 55 this.connectionManager = connectionManager; 56 } 57 58 public Version getVersion() { 59 return ver; 60 } 61 62 public String getName() { 63 return name; 64 } 65 66 public void setName(String serverName) { 67 name = serverName; 68 if (serverName == null) { 69 JiveGlobals.deleteProperty("xmpp.domain"); 70 } 71 else { 72 JiveGlobals.setProperty("xmpp.domain", serverName); 73 } 74 } 75 76 public Date getLastStarted() { 77 return startDate; 78 } 79 80 public Date getLastStopped() { 81 return stopDate; 82 } 83 84 public Iterator getServerPorts() { 85 if (connectionManager == null) { 86 return Collections.EMPTY_LIST.iterator(); 87 } 88 else { 89 return connectionManager.getPorts(); 90 } 91 } 92 } | Popular Tags |