1 23 24 package com.sun.enterprise.connectors.system; 25 26 import java.util.logging.Logger ; 27 import com.sun.logging.LogDomains; 28 import com.sun.enterprise.util.i18n.StringManager; 29 30 31 36 public class MQUrl { 37 38 static Logger logger = LogDomains.getLogger(LogDomains.RSR_LOGGER); 39 private String host = null; 40 private String port = null; 41 private String scheme = "mq"; 42 private String service = ""; 43 private String id = null; 44 45 51 public MQUrl(String id) { 52 this.id = id; 53 } 54 55 60 public void setHost(String host) { 61 this.host = host; 62 } 63 64 69 public void setPort(String port) { 70 this.port = port; 71 } 72 73 79 public void setScheme(String scheme) { 80 this.scheme = scheme; 81 } 82 83 89 public void setService(String service) { 90 this.service = service; 91 } 92 93 100 public String toString() { 101 if ( host.equals("")) { 102 return ""; 103 } 104 105 if ( port.equals("") && service.equals("")) { 106 return scheme + "://" + host; 107 } 108 109 if (service.equals("")) { 110 return scheme + "://" + host + ":" + port + "/"; 111 } 112 113 return scheme + "://" + host + ":" + port + "/" + service; 114 } 115 116 122 public boolean equals(Object obj) { 123 if (obj instanceof MQUrl) { 124 return this.id.equals(((MQUrl)obj).id); 125 } else { 126 return false; 127 } 128 } 129 130 135 public int hashCode() { 136 return id.hashCode(); 137 } 138 } 139 | Popular Tags |