|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.dyade.aaa.agent.Network
fr.dyade.aaa.agent.StreamNetwork
fr.dyade.aaa.agent.HttpNetwork
public class HttpNetwork
HttpNetwork is a simple implementation of StreamNetwork based on HTTP 1.1 protocol.
Nested Class Summary | |
---|---|
(package private) class |
HttpNetwork.NetServerIn
|
(package private) class |
HttpNetwork.NetServerOut
|
(package private) class |
HttpNetwork.NetworkInputStream
Class used to read messages through a stream. |
(package private) class |
HttpNetwork.NetworkOutputStream
Class used to send messages through a stream. |
Nested classes/interfaces inherited from class fr.dyade.aaa.agent.Network |
---|
Network.NetworkAverageLoadTask |
Field Summary | |
---|---|
protected long |
activationPeriod
Period of time between two activation of NetServerOut, it matches to the time between two requests from the client to the server when there is no message to transmit from client to server. |
(package private) Daemon[] |
dmon
Daemon component |
(package private) int |
NbDaemon
Number of listening daemon, this value is only valid for the server part of the HttpNetwork. |
private java.net.InetAddress |
proxy
Network address of proxy server. |
(package private) java.lang.String |
proxyhost
Hostname (or IP dotted address) of proxy host, if not defined there is a direct connection between the client and the server. |
(package private) int |
proxyport
Port number of proxy if any. |
(package private) ServerDesc |
server
Descriptor of the listen server, it is used only on the client side (NetServerOut component). |
Fields inherited from class fr.dyade.aaa.agent.StreamNetwork |
---|
backlog, CnxRetry, ConnectTimeout, inLocalAddr, outLocalAddr, outLocalPort, serverSocketFactory, socketFactory, SoLinger, SoTimeout, TcpNoDelay |
Fields inherited from class fr.dyade.aaa.agent.Network |
---|
ALREADY_DELIVERED, averageLoadTask, bootTSFN, DELIVER, domain, idxLS, logmon, name, nbMessageIn, nbMessageOut, port, qout, servers, serversFN, sid, WDActivationPeriod, WDNbRetryLevel1, WDNbRetryLevel2, WDRetryPeriod1, WDRetryPeriod2, WDRetryPeriod3 |
Constructor Summary | |
---|---|
HttpNetwork()
Creates a new network component. |
Method Summary | |
---|---|
long |
getActivationPeriod()
Gets the activationPeriod value. |
long |
getNbDaemon()
Gets the NbDaemon value. |
java.lang.String |
getProxyhost()
Gets the proxyhost value. |
long |
getProxyport()
Gets the proxyport value. |
protected void |
getReply(java.io.InputStream is,
HttpNetwork.NetworkInputStream nis,
byte[] buf)
|
protected short |
getRequest(java.io.InputStream is,
HttpNetwork.NetworkInputStream nis,
byte[] buf)
|
protected int |
handle(Message msgout,
HttpNetwork.NetworkInputStream nis)
|
void |
init(java.lang.String name,
int port,
short[] servers)
Initializes a new network component. |
boolean |
isRunning()
Tests if the network component is alive. |
(package private) java.lang.String |
readLine(java.io.InputStream is,
byte[] buf)
|
protected void |
sendReply(Message msg,
java.io.OutputStream os,
HttpNetwork.NetworkOutputStream nos,
int ack,
long currentTimeMillis)
|
protected void |
sendRequest(Message msg,
java.io.OutputStream os,
HttpNetwork.NetworkOutputStream nos,
int ack,
long currentTimeMillis)
|
void |
setActivationPeriod(long activationPeriod)
Sets the activationPeriod value. |
void |
start()
Causes this network component to begin execution. |
void |
stop()
Forces the network component to stop executing. |
java.lang.String |
toString()
Returns a string representation of this consumer, including the daemon's name and status. |
void |
wakeup()
Wakes up the watch-dog thread. |
Methods inherited from class fr.dyade.aaa.agent.StreamNetwork |
---|
createServerSocket, createServerSocket, createSocket, createSocket, createSocket, setProperties, setSocketOption |
Methods inherited from class fr.dyade.aaa.agent.Network |
---|
addServer, delete, deliver, delServer, getAverageLoad1, getAverageLoad15, getAverageLoad5, getBootTS, getDomainName, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getPort, getQueue, getStamp, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, index, insert, post, resetServer, restore, save, setPort, setStamp, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3, testBootTS, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface fr.dyade.aaa.agent.NetworkMBean |
---|
getAverageLoad1, getAverageLoad15, getAverageLoad5, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3 |
Field Detail |
---|
private java.net.InetAddress proxy
proxyhost
,
proxyport
java.lang.String proxyhost
proxyhost
global property or for a particular
network by setting \.proxyhost
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file.
int proxyport
proxyport
global property or for a particular
network by setting \.proxyport
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file.
protected long activationPeriod
ActivationPeriod
global property or for a particular network by setting
\.ActivationPeriod
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file. By default,
its value is 10000 (10s).
int NbDaemon
NbDaemon
global property or for a particular network by
setting \.NbDaemon
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file.
ServerDesc server
Daemon[] dmon
Constructor Detail |
---|
public HttpNetwork()
Method Detail |
---|
public java.lang.String getProxyhost()
getProxyhost
in interface HttpNetworkMBean
public long getProxyport()
getProxyport
in interface HttpNetworkMBean
public long getActivationPeriod()
getActivationPeriod
in interface HttpNetworkMBean
public void setActivationPeriod(long activationPeriod)
setActivationPeriod
in interface HttpNetworkMBean
activationPeriod
- the activationPeriod valuepublic long getNbDaemon()
getNbDaemon
in interface HttpNetworkMBean
public void init(java.lang.String name, int port, short[] servers) throws java.lang.Exception
Class.newInstance()
method for create
(whitout any parameter) the component, then we can initialize it with
this method.
init
in class StreamNetwork
name
- The domain name.port
- The listen port.servers
- The list of servers directly accessible from this
network interface.
java.lang.Exception
Network
public void start() throws java.lang.Exception
start
in interface MessageConsumer
start
in interface NetworkMBean
java.lang.Exception
stop
public void wakeup()
public void stop()
stop
in interface MessageConsumer
stop
in interface NetworkMBean
start
public boolean isRunning()
isRunning
in interface MessageConsumer
isRunning
in interface NetworkMBean
MessageConsumer
is alive; false
otherwise.public java.lang.String toString()
toString
in interface NetworkMBean
toString
in class Network
java.lang.String readLine(java.io.InputStream is, byte[] buf) throws java.io.IOException
java.io.IOException
protected void sendRequest(Message msg, java.io.OutputStream os, HttpNetwork.NetworkOutputStream nos, int ack, long currentTimeMillis) throws java.lang.Exception
java.lang.Exception
protected final short getRequest(java.io.InputStream is, HttpNetwork.NetworkInputStream nis, byte[] buf) throws java.lang.Exception
java.lang.Exception
protected final void sendReply(Message msg, java.io.OutputStream os, HttpNetwork.NetworkOutputStream nos, int ack, long currentTimeMillis) throws java.lang.Exception
java.lang.Exception
protected void getReply(java.io.InputStream is, HttpNetwork.NetworkInputStream nis, byte[] buf) throws java.lang.Exception
java.lang.Exception
protected int handle(Message msgout, HttpNetwork.NetworkInputStream nis) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |