00001
00022 package org.objectweb.jonas.discovery;
00023
00024 import javax.management.remote.JMXServiceURL;
00025
00030 public class DiscEvent extends DiscMessage {
00034 public static final String RUNNING = "running";
00038 public static final String STOPPING = "stopping";
00042 private String state = RUNNING;
00046 private String serverName = null;
00050 private String domainName = null;
00054 private String[] urls = null;
00055
00060 public DiscEvent(String sourceAddress, int sourcePort) {
00061 super(sourceAddress, sourcePort);
00062 }
00063
00079 public DiscEvent(String sourceAddress, int sourcePort, String serverName,
00080 String domainName, String[] connectorURLs) {
00081 super(sourceAddress, sourcePort);
00082 this.serverName = serverName;
00083 this.domainName = domainName;
00084 this.urls = connectorURLs;
00085 }
00086
00092 public String getServerName() {
00093 return serverName;
00094 }
00095
00101 public String getDomainName() {
00102 return domainName;
00103 }
00104
00110 public void setDomainName(String domainName) {
00111 this.domainName = domainName;
00112 }
00113
00119 public void setServerName(String serverName) {
00120 this.serverName = serverName;
00121 }
00122
00126 public String[] getConnectorURL() {
00127 return urls;
00128 }
00129
00133 public void setConnectorURL(String[] connectorURLs) {
00134 this.urls = connectorURLs;
00135 }
00136
00140 public String getState() {
00141 return state;
00142 }
00143
00149 public void setState(String state) {
00150 this.state = state;
00151 }
00152
00157 public String toString() {
00158 String str = super.getSourceAddress() + ": " + super.getSourcePort() + " State="
00159 + state + " DomainName=" + domainName + " ServerName= " + serverName;
00160 if (urls != null) {
00161 str = str + " URLs= ";
00162 for (int i = 0; i < urls.length; i++) {
00163 str = str + urls[i] + " ";
00164 }
00165 }
00166 return str;
00167
00168 }
00169 }