1 23 24 29 30 package com.sun.enterprise.tools.upgrade.cluster; 31 32 36 37 41 42 public class ClusteredInstance { 43 44 private String instanceName; 45 private String user; 46 private String host; 47 private String port; 48 private String domain; 49 private String instancePort; 50 private boolean master; 51 52 public ClusteredInstance(String instName) { 53 this.instanceName = instName; 54 } 55 public void extractDataFromLine(String line){ 56 if(line.trim().startsWith("user")){ 57 this.user = line.substring("user".length()).trim(); 58 }else if(line.trim().startsWith("host")){ 59 this.host = line.substring("host".length()).trim(); 60 }else if(line.trim().startsWith("port")){ 61 this.port = line.substring("port".length()).trim(); 62 }else if(line.trim().startsWith("domain")){ 63 this.domain = line.substring("domain".length()).trim(); 64 }else if(line.trim().startsWith("instanceport")){ 65 this.instancePort = line.substring("instanceport".length()).trim(); 66 }else if(line.trim().startsWith("master")){ 67 String masterStr = line.substring("master".length()).trim(); 68 this.master = ("true".equals(masterStr)) ? true :false; 69 } 70 } 71 75 public java.lang.String getPort() { 76 return port; 77 } 78 79 83 public void setPort(java.lang.String port) { 84 this.port = port; 85 } 86 87 91 public java.lang.String getDomain() { 92 return domain; 93 } 94 95 99 public void setDomain(java.lang.String domain) { 100 this.domain = domain; 101 } 102 103 107 public java.lang.String getHost() { 108 return host; 109 } 110 111 115 public void setHost(java.lang.String host) { 116 this.host = host; 117 } 118 119 123 public java.lang.String getInstanceName() { 124 return instanceName; 125 } 126 127 131 public void setInstanceName(java.lang.String instanceName) { 132 this.instanceName = instanceName; 133 } 134 135 139 public java.lang.String getInstancePort() { 140 return instancePort; 141 } 142 143 147 public void setInstancePort(java.lang.String instancePort) { 148 this.instancePort = instancePort; 149 } 150 151 155 public java.lang.String getUser() { 156 return user; 157 } 158 159 163 public void setUser(java.lang.String user) { 164 this.user = user; 165 } 166 167 171 public boolean isMaster() { 172 return master; 173 } 174 175 179 public void setMaster(boolean master) { 180 this.master = master; 181 } 182 183 } 184 | Popular Tags |