|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--edu.virginia.cs.mng.hypercast.UDP_UnicastAdapter
|
+--edu.virginia.cs.mng.hypercast.UDP_HTTP_ServerAdapter
This class extends UDP_HTTP_ServerAdapter. It uses a webserver as a protocol server to process request messages. The messages are translated into hex and sent to the webserver as a parameter in a CGI request. The response from the server gets translated back into a byte[] and placed in the receive queue.
The implemenation uses two threads for each message sent. One thread performs the URL request, the other waits to interrupt the thread if the transaction takes more than MAX_TRANSMISSION_TIME milliseconds.
| Field Summary | |
(package private) OverlaySocketConfig |
config
Config object for overlay. |
private long |
MAX_TRANSMISSION_TIME
In milliseconds, the maximum time allowed to receive a response from the server. |
private static long |
MAX_TRANSMISSION_TIME_DEFAULT
Default for the maximum time allowed to receive a response from the server. |
private static java.lang.String |
MAX_TRANSMISSION_TIME_PROPERTY_NAME
Name of property containing the maximum time allowed to receive a response from the server. |
(package private) java.lang.String |
overlayID
The overlayID (duh). |
static java.lang.String |
OVERLAYID_PROPERTY_NAME
Name of the property holding the overlayID. |
static java.lang.String |
SERVER_PREFIX
Prefix for the name of the properties holding the URLs of the servers. |
(package private) java.util.Vector |
serverQueryPrefixes
Vector containing the URLs of the protocol's CGI script at the servers. |
(package private) java.util.Vector |
serverReceivers
Currently active ServerReceiver objects |
(package private) long |
SReceivedBytes
Total number of bytes received from the server |
(package private) long |
SReceivedPackets
Total number of packets received from the server |
(package private) long |
SSentBytes
Total number of bytes sent to the server |
(package private) long |
SSentPackets
Total number of packets sent to the server |
| Fields inherited from class edu.virginia.cs.mng.hypercast.UDP_UnicastAdapter |
deathGuard,
InputChannel,
MaximumPacketLength,
MsgProc,
MsgProcDebug,
MyIPAddress,
Node,
property,
PROPERTY_NAME_PREFIX,
STARTED,
STARTING,
state,
stateGuard,
STOPPED,
STOPPING,
TimerProc,
TimerProcDebug,
UDP_Timer,
UReceivedBytes,
UReceivedPackets,
URecv,
URecvDebug,
USentBytes,
USentPackets,
USock,
USockLocker |
| Constructor Summary | |
UDP_HTTP_ServerAdapter(OverlaySocketConfig c,
java.net.DatagramSocket usocket,
java.lang.String prefix)
Construct a new adapter. |
|
| Method Summary | |
java.lang.String[] |
getSchema()
Gets the Statistics information description of this Adapter. |
java.lang.String |
getStats(java.lang.String name)
Gets the Statistics information of this Adapter. |
protected void |
myStop()
make sure threads no longer perform callbacks. |
int |
numOfServers()
Returns the number of servers available. |
void |
sendToServer(int serverIndex,
I_Message mp)
Sends a message to the server. |
void |
setStats(java.lang.String name,
java.lang.String value)
Sets the Statistic information in this Adapter. |
| Methods inherited from class edu.virginia.cs.mng.hypercast.UDP_UnicastAdapter |
clearTimer,
createPhysicalAddress,
getCurrentTime,
getNumInQueue,
getPhysicalAddress,
getTimer,
getUReceivedBytes,
getUReceivedPackets,
getUSentBytes,
getUSentPackets,
sendUnicastMessage,
setCallBack,
setTimer,
Start,
Stop |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final java.lang.String OVERLAYID_PROPERTY_NAME
public static final java.lang.String SERVER_PREFIX
private static final java.lang.String MAX_TRANSMISSION_TIME_PROPERTY_NAME
private static final long MAX_TRANSMISSION_TIME_DEFAULT
private long MAX_TRANSMISSION_TIME
long SReceivedPackets
long SSentPackets
long SReceivedBytes
long SSentBytes
java.lang.String overlayID
java.util.Vector serverQueryPrefixes
java.util.Vector serverReceivers
OverlaySocketConfig config
| Constructor Detail |
public UDP_HTTP_ServerAdapter(OverlaySocketConfig c,
java.net.DatagramSocket usocket,
java.lang.String prefix)
config - a OverlaySocketConfig object.usocket - a DatagramSocket object.| Method Detail |
public void sendToServer(int serverIndex,
I_Message mp)
serverIndex is used to select
backup servers incase of a problem. serverIndex = 0 is the primary
server, 1 = back-up, 2 = secondary back-up, 3 = third back-up, etc.public int numOfServers()
protected void myStop()
public java.lang.String getStats(java.lang.String name)
throws StatsException
name - the String representation of a Statistic name
public void setStats(java.lang.String name,
java.lang.String value)
throws StatsException
name - the String representation of a Statistic namevalue - the String representation of the Statistic value
public java.lang.String[] getSchema()
throws StatsException
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||