FileDocCategorySizeDatePackage
MQUrl.javaAPI DocGlassfish v2 API4628Fri May 04 22:34:26 BST 2007com.sun.enterprise.connectors.system

MQUrl

public class MQUrl extends Object
Represents one of the MQ address list elements.
author
Binod P.G

Fields Summary
static Logger
logger
private String
host
private String
port
private String
scheme
private String
service
private String
id
Constructors Summary
public MQUrl(String id)
Constructs the MQUrl with the id. Id is actually the name of JmsHost element in the domain.xml.

param
id Logical name of the MQUrl


                                  
       
        this.id = id;
    
Methods Summary
public booleanequals(java.lang.Object obj)
Two MQUrls are identified by their id (name).

param
obj another MQUrl object.
returns
a boolean indicating whether MQUrls are equal.

        if (obj instanceof MQUrl) {
            return this.id.equals(((MQUrl)obj).id); 
        } else {
            return false;
        }
    
public inthashCode()
Hashcode of MQurl is the same as the Hashcode of its name.

return
hashcode of MQUrl

        return id.hashCode();
    
public voidsetHost(java.lang.String host)
Sets the host name of the Url.

param
host Host Name of the Url.

        this.host = host;
    
public voidsetPort(java.lang.String port)
Sets the port number of the Url.

param
port Port number of the Url.

        this.port = port;
    
public voidsetScheme(java.lang.String scheme)
Sets the Scheme of MQ connection for this Url. Eg> mq, mtcp, mqssl ...

param
scheme scheme of the connection.

        this.scheme = scheme;
    
public voidsetService(java.lang.String service)
Sets the type of service offered by MQ broker. Eg> jms, jmsssl etc.

param
service Name of service.

        this.service = service;
    
public java.lang.StringtoString()
String representation of the Url. i.e> scheme://host:port/service Eg> mq://javasoft12:7676/jmsssl

returns
String representation of Url.

        if ( host.equals("")) {
            return "";
        }

        if ( port.equals("") && service.equals("")) {
           return scheme + "://" + host;
        }

        if (service.equals("")) {
           return scheme + "://" + host + ":" + port + "/";
        }

        return scheme + "://" + host + ":" + port + "/" + service;