xmlBlaster 2.2.0 API

org.xmlBlaster.protocol.stomp
Class SocketUrl

java.lang.Object
  extended by org.xmlBlaster.protocol.stomp.SocketUrl

public class SocketUrl
extends java.lang.Object

This knows how to parse the URL notation of the STOMP protocol. It holds the hostname and the port.

See Also:
The protocol.stomp requirement

Field Summary
static int DEFAULT_SERVER_PORT
          Default port of xmlBlaster stomp server is 61613
private  Global glob
           
private  java.lang.String hostname
          The string representation like "192.168.1.1", useful if multihomed computer
private  PropString hostnameProp
           
private  java.net.InetAddress inetAddress
          xmlBlaster server host
private  boolean isEnforced
           
private  boolean isLocal
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  int port
          The port
private  PropInt portProp
           
 
Constructor Summary
SocketUrl(Global glob, AddressBase address)
          Extract "hostname" and "port" from environment, if not found use the local host for hostname and the default port 61613.
SocketUrl(Global glob, AddressBase address, boolean isLocal, int defaultServerPort)
          Extract hostname and port from environment, if not found use the local host for hostname and the given default port (usually ExecutorBase.DEFAULT_SERVER_PORT=61613).
SocketUrl(Global glob, java.lang.String url)
          Parse the given url.
SocketUrl(Global glob, java.lang.String hostname, int port)
           
 
Method Summary
private  void createInetAddress()
           
 boolean equals(SocketUrl other)
           
 java.lang.String getHostname()
           
 java.net.InetAddress getInetAddress()
           
 int getPort()
           
 java.lang.String getUrl()
           
 boolean isEnforced()
           
static void main(java.lang.String[] args)
          java org.xmlBlaster.protocol.stomp.SocketUrl stomp://localhost:7609
private  void parse(java.lang.String url)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private Global glob

log

private static java.util.logging.Logger log

hostname

private java.lang.String hostname
The string representation like "192.168.1.1", useful if multihomed computer


hostnameProp

private PropString hostnameProp

inetAddress

private java.net.InetAddress inetAddress
xmlBlaster server host


port

private int port
The port


portProp

private PropInt portProp

isLocal

private boolean isLocal

DEFAULT_SERVER_PORT

public static final int DEFAULT_SERVER_PORT
Default port of xmlBlaster stomp server is 61613

See Also:
Constant Field Values

isEnforced

private boolean isEnforced
Constructor Detail

SocketUrl

public SocketUrl(Global glob,
                 java.lang.String hostname,
                 int port)
          throws XmlBlasterException
Parameters:
hostname - if null or empty the local IP will be used
port - any port, not checked
Throws:
XmlBlasterException

SocketUrl

public SocketUrl(Global glob,
                 java.lang.String url)
          throws XmlBlasterException
Parse the given url.

Parameters:
url - e.g. "stomp://127.168.1.1:61613" or only "127.168.1.1:61613" or "" (choose default settings)
Throws:
XmlBlasterException - if url is null or invalid

SocketUrl

public SocketUrl(Global glob,
                 AddressBase address)
          throws XmlBlasterException
Extract "hostname" and "port" from environment, if not found use the local host for hostname and the default port 61613.
Updates the raw address from AddressBase

Throws:
XmlBlasterException

SocketUrl

public SocketUrl(Global glob,
                 AddressBase address,
                 boolean isLocal,
                 int defaultServerPort)
          throws XmlBlasterException
Extract hostname and port from environment, if not found use the local host for hostname and the given default port (usually ExecutorBase.DEFAULT_SERVER_PORT=61613).
Updates the raw address from AddressBase if isLocal==false

Parameters:
isLocal - If local is set to true "localHostname" and "localPort" will be extracted
Throws:
XmlBlasterException
Method Detail

isEnforced

public boolean isEnforced()
Returns:
true if host or port was given by user configuration, false if default is chosen

getHostname

public java.lang.String getHostname()

getPort

public int getPort()

getUrl

public java.lang.String getUrl()
Returns:
for example "stomp://myServer.com:61613"

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

parse

private void parse(java.lang.String url)
            throws XmlBlasterException
Throws:
XmlBlasterException

getInetAddress

public java.net.InetAddress getInetAddress()

createInetAddress

private void createInetAddress()
                        throws XmlBlasterException
Throws:
XmlBlasterException

equals

public boolean equals(SocketUrl other)

main

public static void main(java.lang.String[] args)
java org.xmlBlaster.protocol.stomp.SocketUrl stomp://localhost:7609


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.