1 23 24 package org.objectweb.jonas.discovery; 25 26 37 public class DiscGreeting extends DiscMessage { 38 41 public static final String STARTUP = "starting up"; 42 45 public static final String DUPLICATE_NAME = "duplicate server name found"; 46 49 private String state = null; 50 53 private String serverName = null; 54 57 private String domainName = null; 58 59 private String serverId = null; 60 61 65 public DiscGreeting(String sourceAddress, int sourcePort) { 66 super(sourceAddress, sourcePort); 67 } 68 69 84 public DiscGreeting(String sourceAddress, int sourcePort, 85 String serverName, String domainName, boolean startingUp, 86 String serverId) { 87 super(sourceAddress, sourcePort); 88 this.serverName = serverName; 89 this.domainName = domainName; 90 this.serverId = serverId; 91 92 if (startingUp) { 93 this.state = STARTUP; 94 } else { 95 this.state = DUPLICATE_NAME; 96 } 97 98 } 99 100 105 public String getServerName() { 106 return serverName; 107 } 108 109 114 public String getDomainName() { 115 return domainName; 116 } 117 118 123 public void setDomainName(String domainName) { 124 this.domainName = domainName; 125 } 126 127 132 public void setServerName(String serverName) { 133 this.serverName = serverName; 134 } 135 136 139 public String getState() { 140 return state; 141 } 142 143 148 public void setState(String state) { 149 this.state = state; 150 } 151 152 156 public String toString() { 157 String str = super.getSourceAddress() + ": " + super.getSourcePort() + " State=" 158 + state + " DomainName=" + domainName + " ServerName= " + serverName + " serverId= " + serverId; 159 return str; 160 161 } 162 163 public String getServerId() { 164 return serverId; 165 } 166 167 public void setServerId(String serverId) { 168 this.serverId = serverId; 169 } 170 171 172 } 173 | Popular Tags |