com.edustructures.sifworks
Class HttpProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by com.edustructures.sifworks.ADKProperties
                  extended by com.edustructures.sifworks.TransportProperties
                      extended by com.edustructures.sifworks.HttpProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>
Direct Known Subclasses:
HttpsProperties

public class HttpProperties
extends TransportProperties

Properties for the HTTP transport protocol.

To set default HTTPS properties, call the Agent.getDefaultHttpsProperties method to obtain the agent's default properties for this transport protocol. The defaults are used by all zones that do not explicitly set their own transport properties. Alternatively, you may set the default value of a property by calling the System.setProperty method, or by using the -D option on the Java command-line. Property names follow the naming convention adk.transport.http.property (e.g. adk.transport.http.port). No default HTTP or HTTPS port is assigned to push mode agents by the class framework. It is the developer's responsibility to assign a default port. To do so, use one of the following methods:

Version:
1.0
See Also:
Serialized Form

Constructor Summary
HttpProperties()
          Constructor
HttpProperties(HttpProperties parent)
          Constructs an HttpProperties object that inherits values from a parent
 
Method Summary
 java.lang.String getHost()
          Gets the local hostname this transport protocol will use when listening for incoming traffic from the ZIS.
 int getPort()
          Gets the port that push-mode agents will use when establishing a local socket.
 java.lang.String getProtocol()
          Gets the name of the transport protocol associated with these properties
 java.lang.String getPushHost()
          Gets the hostname that push-mode agents will use when sending a SIF_Register message to the zone integration server, if different than the hostname the agent binds on when establishing the local socket.
 int getPushPort()
          Gets the port that push-mode agents will use when sending a SIF_Register message to the zone integration server, if different than the port the agent binds on when establishing the local socket.
 void setHost(java.lang.String host)
          Sets the local host name or IP address this transport protocol will use when establishing a local socket.
 void setPort(int port)
          Sets the port that push-mode agents will use when establishing a local socket.
 void setPushHost(java.lang.String host)
          Sets the hostname that push-mode agents will use when sending a SIF_Register message to the zone integration server, if different than the hostname the agent binds on when establishing the local socket.
 void setPushPort(int port)
          Sets the port that push-mode agents will use when sending a SIF_Register message to the zone integration server, if different than the port the agent binds on when establishing the local socket.
 
Methods inherited from class com.edustructures.sifworks.TransportProperties
defaults
 
Methods inherited from class com.edustructures.sifworks.ADKProperties
getParent, getProperty, getProperty, getProperty, getProperty, setProperty, setProperty, setProperty
 
Methods inherited from class java.util.Properties
list, list, load, loadFromXML, propertyNames, save, store, storeToXML, storeToXML
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpProperties

public HttpProperties()
Constructor


HttpProperties

public HttpProperties(HttpProperties parent)
Constructs an HttpProperties object that inherits values from a parent

Parameters:
parent - The HttpProperties object from which properties will be inherited if not explicitly defined by this object
Method Detail

getProtocol

public java.lang.String getProtocol()
Gets the name of the transport protocol associated with these properties

Specified by:
getProtocol in class TransportProperties
Returns:
The string "http"

setPort

public void setPort(int port)
Sets the port that push-mode agents will use when establishing a local socket.

Parameters:
port - A valid port number (some platforms restrict port numbers in the range 0-1024)

getPort

public int getPort()
Gets the port that push-mode agents will use when establishing a local socket.

Returns:
The port number or -1 if uninitialized

setPushPort

public void setPushPort(int port)
Sets the port that push-mode agents will use when sending a SIF_Register message to the zone integration server, if different than the port the agent binds on when establishing the local socket. If set this value will be used in preparing the SIF_Register/SIF_Protocol/SIF_URL. If not set, the ADK will use the Port property to prepare this element.

Most agents do not call this method. It is only needed when the network configuration demands the hostname and port the ZIS uses to contact the agent is different than the local socket the agent binds on.

Parameters:
port - The port to be used in the SIF_Register/SIF_Protocol/SIF_URL element
Since:
ADK 1.5

getPushPort

public int getPushPort()
Gets the port that push-mode agents will use when sending a SIF_Register message to the zone integration server, if different than the port the agent binds on when establishing the local socket. If set this value will be used in preparing the SIF_Register/SIF_Protocol/SIF_URL. If not set, the ADK will use the Port property to prepare this element.

Returns:
The port to be used in the SIF_Register/SIF_Protocol/SIF_URL element or -1 if not initialized
Since:
ADK 1.5

setHost

public void setHost(java.lang.String host)
Sets the local host name or IP address this transport protocol will use when establishing a local socket. By default, localhost is assumed. This property is useful when more than one network interface is available on the machine, or when the agent wishes to exercise more control over the exact hostname or IP address that is registered with the ZIS (e.g. "localhost" versus "127.0.0.1" versus the IP address or DNS host name of the local machine.)

Parameters:
host - The IP address of a network interface on the local machine, or a domain name that resolves to a local IP address. (No attempt is made to check that the address is valid.)

getHost

public java.lang.String getHost()
                         throws ADKTransportException
Gets the local hostname this transport protocol will use when listening for incoming traffic from the ZIS.

Returns:
The host name or IP address passed to the setHost method. Defaults to "localhost"
Throws:
ADKTransportException

setPushHost

public void setPushHost(java.lang.String host)
Sets the hostname that push-mode agents will use when sending a SIF_Register message to the zone integration server, if different than the hostname the agent binds on when establishing the local socket. If set this value will be used in preparing the SIF_Register/SIF_Protocol/SIF_URL. If not set, the ADK will use the Host property to prepare this element.

Most agents do not call this method. It is only needed when the network configuration demands the hostname and port the ZIS uses to contact the agent is different than the local socket the agent binds on.

Parameters:
host - The hostname to be used in the SIF_Register/SIF_Protocol/SIF_URL element
Since:
ADK 1.5

getPushHost

public java.lang.String getPushHost()
                             throws ADKTransportException
Gets the hostname that push-mode agents will use when sending a SIF_Register message to the zone integration server, if different than the hostname the agent binds on when establishing the local socket. If set this value will be used in preparing the SIF_Register/SIF_Protocol/SIF_URL. If not set, the ADK will use the Host property to prepare this element.

Most agents do not call this method. It is only needed when the network configuration demands the hostname and port the ZIS uses to contact the agent is different than the local socket the agent binds on.

Parameters:
host - The hostname to be used in the SIF_Register/SIF_Protocol/SIF_URL element or null if not initialized
Throws:
ADKTransportException
Since:
ADK 1.5


Copyright © 2001-2007 Edustructures LLC. All Rights Reserved. SIFWorks® and ADK® are registered trademarks of Edustructures LLC. SIF™ and Schools Interoperability Framework are trademarks of the Schools Interoperability Framework Association.