org.avis.client
Class ElvinOptions

java.lang.Object
  extended by org.avis.client.ElvinOptions
All Implemented Interfaces:
Cloneable

public final class ElvinOptions
extends Object
implements Cloneable

Options for configuring an Elvin client connection. Includes router connection parameters, security keys, SSL parameters and timeouts. The options object used to initialise the Elvin connection cannot be directly changed after the connection is created, but some settings can be changed on a live connection object using supported methods such as Elvin.setNotificationKeys(Keys), etc.

Author:
Matthew Phillips

Field Summary
 ConnectionOptions connectionOptions
          The options sent to the router to negotiate connection parameters.
 KeyStore keystore
          The keystore used for TLS/SSL secure connections (i.e.
 String keystorePassphrase
          The passphrase used to secure the keystore and its keys.
 long livenessTimeout
          The liveness timeout period (in milliseconds).
 Keys notificationKeys
          The global notification keys that apply to all notifications.
 long receiveTimeout
          The amount of time (in milliseconds) that must pass before the router is assumed to not be responding to a request.
 boolean requireAuthenticatedServer
          Used to ensure that the router the client is connected to is authentic.
 Keys subscriptionKeys
          The global subscription keys that apply to all subscriptions.
 
Constructor Summary
ElvinOptions()
           
ElvinOptions(ConnectionOptions connectionOptions, Keys notificationKeys, Keys subscriptionKeys)
           
 
Method Summary
 ElvinOptions clone()
          Create a copy of this option set.
 void setKeystore(String keystorePath, String passphrase)
          Shortcut to load a keystore from a Java keystore file.
 void setKeystore(URL keystoreUrl, String passphrase)
          Shortcut to load a keystore from a Java keystore file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionOptions

public ConnectionOptions connectionOptions
The options sent to the router to negotiate connection parameters. After connection, these will be updated to include any extra values sent by the router, including the Vendor-Identification option.


notificationKeys

public Keys notificationKeys
The global notification keys that apply to all notifications.


subscriptionKeys

public Keys subscriptionKeys
The global subscription keys that apply to all subscriptions.


keystore

public KeyStore keystore
The keystore used for TLS/SSL secure connections (i.e. connections via "elvin:/secure/..." URI's). This may be null to use the default JVM keystore. If it is set, the keystorePassphrase option must also be set.

See Also:
setKeystore(URL, String)

keystorePassphrase

public String keystorePassphrase
The passphrase used to secure the keystore and its keys.

See Also:
keystore

requireAuthenticatedServer

public boolean requireAuthenticatedServer
Used to ensure that the router the client is connected to is authentic. When true, only servers with a certificate authenticated against the trusted certificates in the supplied keystore or the JVM's CA certificates will be acceptable for secure connections. See the documentation at the Avis web site and the description of JSSE's X509TrustManager for more information.

See Also:
keystore

receiveTimeout

public long receiveTimeout
The amount of time (in milliseconds) that must pass before the router is assumed to not be responding to a request. Default is 10 seconds.

See Also:
Elvin.setReceiveTimeout(long)

livenessTimeout

public long livenessTimeout
The liveness timeout period (in milliseconds). If no messages are seen from the router in this period a connection test message is sent and if no reply is seen the connection is deemed to be defunct and automatically closed. Default is 60 seconds.

See Also:
Elvin.setLivenessTimeout(long)
Constructor Detail

ElvinOptions

public ElvinOptions()

ElvinOptions

public ElvinOptions(ConnectionOptions connectionOptions,
                    Keys notificationKeys,
                    Keys subscriptionKeys)
Method Detail

clone

public ElvinOptions clone()
Create a copy of this option set. This does not deep clone the keys and connection options, since these should be treated as immutable after first use.

Overrides:
clone in class Object

setKeystore

public void setKeystore(String keystorePath,
                        String passphrase)
                 throws IOException
Shortcut to load a keystore from a Java keystore file.

Parameters:
keystorePath - The file path for the keystore.
passphrase - The passphrase for the keystore.
Throws:
IOException - if an error occurred while loading the keystore.
See Also:
setKeystore(URL, String)

setKeystore

public void setKeystore(URL keystoreUrl,
                        String passphrase)
                 throws IOException
Shortcut to load a keystore from a Java keystore file.

Parameters:
keystoreUrl - The URL for the keystore file.
passphrase - The passphrase for the keystore.
Throws:
IOException - if an error occurred while loading the keystore.


Copyright © 2008 Matthew Phillips. All Rights Reserved.