xmlBlaster 2.2.0 API

org.xmlBlaster.protocol.xmlrpc
Class XmlRpcUrl

java.lang.Object
  extended by org.xmlBlaster.protocol.xmlrpc.XmlRpcUrl

public class XmlRpcUrl
extends java.lang.Object

This knows how to parse the URL notation of our XMLRPC protocol. It holds the hostname and the port in the form "http://myServer.com:8080/".

See Also:
The protocol.xmlrpc requirement, org.xmlBlaster.test.classtest.XmlRpcUrlTest

Field Summary
private  Global glob
           
private  java.lang.String hostname
          The string representation like "192.168.1.1", useful if multihomed computer
private  java.net.InetAddress inetAddress
          xmlBlaster server host
private  boolean isLocal
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  java.lang.String path
           
private  int port
          The port
private  java.lang.String protocol
           
 
Constructor Summary
XmlRpcUrl(Global glob, AddressBase address)
          Extract "hostname" and "port" from environment, if not found use the local host for hostname and the default port 8080.
XmlRpcUrl(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 XmlRpcDriver.DEFAULT_HTTP_PORT=8080).
XmlRpcUrl(Global glob, java.lang.String url)
          Parse the given url.
XmlRpcUrl(Global glob, java.lang.String hostname, int port, java.lang.String path)
           
 
Method Summary
private  void createInetAddress()
           
 boolean equals(XmlRpcUrl other)
           
 java.lang.String getHostname()
           
 java.net.InetAddress getInetAddress()
           
 int getPort()
           
 java.lang.String getProtocol()
           
 java.lang.String getUrl()
           
static void main(java.lang.String[] args)
          java org.xmlBlaster.protocol.xmlrpc.XmlRpcUrl http://localhost:8080
private  void parse(java.lang.String url)
           
 void setPort(int port)
          Change the port
 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


inetAddress

private java.net.InetAddress inetAddress
xmlBlaster server host


port

private int port
The port


isLocal

private boolean isLocal

path

private java.lang.String path

protocol

private java.lang.String protocol
Constructor Detail

XmlRpcUrl

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

XmlRpcUrl

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

Parameters:
url - e.g. "http://127.168.1.1:8080"
Throws:
XmlBlasterException - if url is null or invalid

XmlRpcUrl

public XmlRpcUrl(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 8080.
NOTE: If address.getRawAddress() is filled this has precedence.
Updates the raw address from AddressBase

Throws:
XmlBlasterException

XmlRpcUrl

public XmlRpcUrl(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 XmlRpcDriver.DEFAULT_HTTP_PORT=8080).
Updates the raw address from AddressBase if isLocal==false
NOTE: If address.getRawAddress() is filled this has precedence.

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

getHostname

public java.lang.String getHostname()

getPort

public int getPort()

setPort

public void setPort(int port)
Change the port


getUrl

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

toString

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

getProtocol

public java.lang.String getProtocol()

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(XmlRpcUrl other)

main

public static void main(java.lang.String[] args)
java org.xmlBlaster.protocol.xmlrpc.XmlRpcUrl http://localhost:8080


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.