|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infoservice.dynamic.DynamicCommandsExtension
public class DynamicCommandsExtension
This class provides the functionality needed by the "dynamic cascade
extension". It is essentially an extension to
InfoServiceCommands
Constructor Summary | |
---|---|
DynamicCommandsExtension()
|
Method Summary | |
---|---|
HttpResponseStructure |
cascadePostHelo(byte[] a_postData,
int a_encoding)
This method is called, when we receive data from a mixcascade (first mix) or when we receive data from a remote infoservice, which posts data about a mixcascade. |
private org.w3c.dom.Document |
constructAnswer(java.lang.String response)
Constructs the answer for a connectivity request. |
private java.lang.String |
doPing(java.net.InetAddress a_Address,
int port,
long echoRequest)
Actually executes the ping-like connectivity-test. |
private int |
extractPort(byte[] a_postData)
Extracts the port from the POST data. |
private java.lang.String |
getCascadeHtmlTable(java.lang.Class a_clazz)
|
private MixCascade |
getCurrentCascade(java.lang.String a_mixId)
Returns the current cascade for the mix with the given ID. |
private MixCascade |
getTemporaryCascade(java.lang.String a_mixId)
Returns a temporary cascade for the mix with the given ID. |
private java.util.Vector |
getUnusedMixex()
Returns a vector containing all unused dynamic mixes. |
private boolean |
haveNewCascadeInformation(java.lang.String a_strMixId)
Tests if there exists new cascade information for the mix with the given ID. |
HttpResponseStructure |
isNewCascadeAvailable(java.lang.String a_strMixId)
Checks if there exists new cascade information for the mix with the given ID. |
private boolean |
isReachable(java.net.InetAddress a_Address,
int port)
Checks if the given address is reachable on the given port |
HttpResponseStructure |
lastMixPostDynaCascade(byte[] a_postData)
This method gets called when a last mix posts its cascade information to the InfoService Such a cascade is not yet established, so it is a temporary cascade an will be treated as such |
HttpResponseStructure |
mixPostConnectivityTest(java.net.InetAddress a_sourceAddress,
byte[] a_postData)
This method gets called when a mix asks the InfoService to verify its connectivity. |
HttpResponseStructure |
reconfigureMix(java.lang.String a_strMixId)
|
HttpResponseStructure |
virtualCascadeStatus()
Sends a generated HTML file with all status entrys to the client. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DynamicCommandsExtension()
Method Detail |
---|
public HttpResponseStructure cascadePostHelo(byte[] a_postData, int a_encoding)
a_postData
- The data we have received.
public HttpResponseStructure isNewCascadeAvailable(java.lang.String a_strMixId)
a_strMixId
-
HttpResponseStructure.HTTP_RETURN_INTERNAL_SERVER_ERROR
if no new information is available,
HttpResponseStructure.HTTP_RETURN_OK
otherwisepublic HttpResponseStructure reconfigureMix(java.lang.String a_strMixId)
private boolean haveNewCascadeInformation(java.lang.String a_strMixId)
a_strMixId
- The ID of the mix in question
true
if a new cascade is available,
false
otherwiseprivate MixCascade getTemporaryCascade(java.lang.String a_mixId)
a_mixId
- The ID of the mix in question
MixCascade
for the mix or
null
private MixCascade getCurrentCascade(java.lang.String a_mixId)
a_mixId
- The ID of the mix in question
MixCascade
for the mix or
null
public HttpResponseStructure lastMixPostDynaCascade(byte[] a_postData)
a_postData
- The data of the POST request
HttpResponseStructure
HTTP_RETURN_OK (no payload)
or HTTP_RETURN_INTERNAL_SERVER_ERRORpublic HttpResponseStructure mixPostConnectivityTest(java.net.InetAddress a_sourceAddress, byte[] a_postData)
a_sourceAddress
- The source address of the requesta_postData
- The POST data containing a XML structure with the port
HttpResponseStructure
HTTP_RETURN_OK (containing
the answer XML structure) or HTTP_RETURN_INTERNAL_SERVER_ERRORprivate org.w3c.dom.Document constructAnswer(java.lang.String response)
response
- Either "True" or "False"
private boolean isReachable(java.net.InetAddress a_Address, int port)
a_Address
- The address to be testedport
- The port to be tested
true
if the address is reachable on the given
port, false
otherwiseprivate java.lang.String doPing(java.net.InetAddress a_Address, int port, long echoRequest)
a_Address
- The target addressport
- The target portechoRequest
- The echoRequest to send
private int extractPort(byte[] a_postData)
Port
element.
a_postData
- The POST data to parse
public HttpResponseStructure virtualCascadeStatus()
private java.util.Vector getUnusedMixex()
private java.lang.String getCascadeHtmlTable(java.lang.Class a_clazz) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |