1 9 package org.jboss.portal.server; 10 11 import org.apache.log4j.Logger; 12 import org.jboss.portal.server.util.Parameters; 13 14 23 public class ServerURL 24 { 25 26 27 protected static final Logger log = Logger.getLogger(ServerURL.class); 28 29 30 protected final ServerObjectID target; 31 32 33 protected final Parameters controlParameters; 34 35 36 protected final Parameters targetParameters; 37 38 39 protected Boolean secure; 40 41 public ServerURL(ServerObjectID target) 42 { 43 this(target, new Parameters(), new Parameters(), null); 44 } 45 46 private ServerURL(ServerObjectID target, Parameters controlParameters, Parameters targetParameters, Boolean secure) 47 { 48 this.target = target; 49 this.controlParameters = controlParameters; 50 this.targetParameters = targetParameters; 51 this.secure = secure; 52 } 53 54 57 public ServerObjectID getTarget() 58 { 59 return target; 60 } 61 62 67 public void setSecure(Boolean secure) 68 { 69 this.secure = secure; 70 } 71 72 77 public Boolean getSecure() 78 { 79 return secure; 80 } 81 82 90 public void setControlParameter(String name, String value) 91 { 92 if (value != null) 93 { 94 controlParameters.setParameter(name, value); 95 } 96 else 97 { 98 controlParameters.removeParameter(name); 99 } 100 } 101 102 108 public void setControlParameter(String name, String [] values) 109 { 110 if (values != null) 111 { 112 controlParameters.setParameterValues(name, values); 113 } 114 else 115 { 116 controlParameters.removeParameter(name); 117 } 118 } 119 120 123 public Parameters getControlParameters() 124 { 125 return controlParameters; 126 } 127 128 136 public void setTargetParameter(String name, String value) 137 { 138 if (value != null) 139 { 140 targetParameters.setParameter(name, value); 141 } 142 else 143 { 144 targetParameters.removeParameter(name); 145 } 146 } 147 148 154 public void setTargetParameter(String name, String [] values) 155 { 156 if (values != null) 157 { 158 targetParameters.setParameterValues(name, values); 159 } 160 else 161 { 162 targetParameters.removeParameter(name); 163 } 164 } 165 166 169 public Parameters getTargetParameters() 170 { 171 return targetParameters; 172 } 173 174 177 public boolean isIdempotent() 178 { 179 return true; 180 } 181 } 182 | Popular Tags |