|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.protocol.socket.SocketUrl
public class SocketUrl
This knows how to parse the URL notation of our SOCKET protocol. It holds the hostname and the port.
SocketUrlTest
Field Summary | |
---|---|
static int |
DEFAULT_SERVER_PORT
Default port of xmlBlaster socket server is 7607 |
private static boolean |
firstKey
|
private static boolean |
firstTrust
|
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
|
static boolean |
SOCKET_TCP
Flag to use TCP/IP |
static boolean |
SOCKET_UDP
Flag to use UDP |
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 7607. |
|
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=7607). |
|
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()
|
java.net.ServerSocket |
createServerSocketSSL(int backlog,
AddressBase address)
Helper to create a server side SSL socket, uses reflection to compile with JDK 1.3 SSL support can't be used with a standard JDK 1.3 Setup: |
javax.net.ssl.SSLSocketFactory |
createSocketFactorySSL(AddressBase address)
|
private javax.net.ssl.SSLSocketFactory |
createSocketFactorySSLInternal(AddressBase address)
|
java.net.Socket |
createSocketSSL_OLD(SocketUrl localSocketUrl,
AddressBase address)
Helper to create a SSL socket, uses reflection to compile with JDK 1.3 SSL support can't be used with a standard JDK 1.3 |
java.net.Socket |
createSocketSSL(SocketUrl localSocketUrl,
AddressBase address)
Helper to create a SSL socket, uses reflection to compile with JDK 1.3 SSL support can't be used with a standard JDK 1.3 |
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.socket.SocketUrl socket://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 |
---|
private java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private java.lang.String hostname
private PropString hostnameProp
private java.net.InetAddress inetAddress
private int port
private PropInt portProp
private boolean isLocal
public static final boolean SOCKET_TCP
public static final boolean SOCKET_UDP
public static final int DEFAULT_SERVER_PORT
private static boolean firstKey
private static boolean firstTrust
private boolean isEnforced
Constructor Detail |
---|
public SocketUrl(Global glob, java.lang.String hostname, int port) throws XmlBlasterException
hostname
- if null or empty the local IP will be usedport
- any port, not checked
XmlBlasterException
public SocketUrl(Global glob, java.lang.String url) throws XmlBlasterException
url
- e.g. "socket://127.168.1.1:7607" or only "127.168.1.1:7607" or "" (choose default settings)
XmlBlasterException
- if url is null or invalidpublic SocketUrl(Global glob, AddressBase address) throws XmlBlasterException
XmlBlasterException
public SocketUrl(Global glob, AddressBase address, boolean isLocal, int defaultServerPort) throws XmlBlasterException
isLocal
- If local is set to true "localHostname" and "localPort" will be extracted
XmlBlasterException
Method Detail |
---|
public boolean isEnforced()
public java.lang.String getHostname()
public int getPort()
public java.lang.String getUrl()
public java.lang.String toString()
toString
in class java.lang.Object
private void parse(java.lang.String url) throws XmlBlasterException
XmlBlasterException
public java.net.InetAddress getInetAddress()
private void createInetAddress() throws XmlBlasterException
XmlBlasterException
public boolean equals(SocketUrl other)
public java.net.ServerSocket createServerSocketSSL(int backlog, AddressBase address) throws XmlBlasterException
keytool -genkey -keystore testStore -keyalg RSA (using password 'testtest') java org.xmlBlaster.Main -plugin/socket/SSL true -plugin/socket/keyStore testStore -plugin/socket/keyStorePassword testtest java javaclients.HelloWorldPublish -plugin/socket/SSL true -plugin/socket/keyStore testStore -plugin/socket/keyStorePassword testtest
backlog
- Socket parameteraddress
- The configuration environment
XmlBlasterException
public java.net.Socket createSocketSSL_OLD(SocketUrl localSocketUrl, AddressBase address) throws XmlBlasterException
localSocketUrl
- null or a configured local socket settingaddress
- The configuration environment
XmlBlasterException
public static void main(java.lang.String[] args)
public javax.net.ssl.SSLSocketFactory createSocketFactorySSL(AddressBase address) throws XmlBlasterException
XmlBlasterException
private javax.net.ssl.SSLSocketFactory createSocketFactorySSLInternal(AddressBase address) throws XmlBlasterException
XmlBlasterException
public java.net.Socket createSocketSSL(SocketUrl localSocketUrl, AddressBase address) throws XmlBlasterException
localSocketUrl
- null or a configured local socket settingaddress
- The configuration environment
XmlBlasterException
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |