Conversation
added 16 commits
January 29, 2017 22:44
…null pointer exception that arose when GNSHttpsServer called GNSHttpServer, but GNSHttpProxy was running before the requestHandler had been set.
… the default GNSHttpProxy port.
… remove duplicate code. Added system parameters to set the gns proxy's listening port and accepted remote hostnames.
…hostname to match the header for GNSHttpProxy.
…ording to coding standards.
…ttpProxyTest to automatically create a GNSHttpProxy when run.
…ive the proxy server a different default port from the http server, and moved HttpProxyTest to failingtests since it essentially just runs HttpClientTest, which is currently failing.
…ttpClientTest and HttpProxyTest relies on it.
…xing them both to work with changes in the master branch.
Collaborator
|
I'll take a look at this ASAP. I'm also adding @westyUMass |
Collaborator
|
Changes look good to me. Unless @westyUMass has something to say, I'll be merging this. |
Collaborator
|
I'm looking at this now. |
Collaborator
|
The one very minor quibble I see is in runServer which I know you didn't change. Arun added the suicide call which obviates the need for a loop. That could be simplified. That might lead to runServer becoming superfluous, but I'm not sure. Also, you could eliminate the single argument runServer method I think. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since I had to do some manually merging it might be difficult looking at changes in individual commits, so the following is a list of all files modified, and a summary of what was changed in the hopes that it makes things easier:
src/edu.umass.cs.gnsserver.httpserver.GNSHttpProxy: Created this class, which is used to run a GNSClient proxy that does not execute commands locally, but instead accepts requests over HTTP then uses a GNSClient to issue these commands to a GNSServer.
src/edu.umass.cs.gnsserver.httpserver.GNSHttpServer: Refactored this class to extend GNSHttpProxy to minimize code reuse.
src/edu.umass.cs.gnsserver.httpserver.GNSHttpsServer: Refactored this class to extend GNSHttpProxy to minimize code reuse.
src/edu.umass.cs.gnsclient.client.GNSClientConfig: Added variables that are used by the GNSHttpProxy
test/edu.umass.cs.gnsclient.client.singletests.HttpProxyTest: Created this test, which launches a GNSHttpProxy and a server, then runs HttpClientTest in order to test that the Proxy server correctly handles an http client.
test/edu.umass.cs.gnsclient.client.singletests.HttpClientTest: Modified a few variables in this class to be protected so that HttpProxyTest could extend this class, which minimizes code reuse.
The goal of creating GNSHttpProxy:
"The main difference between GNSHttpProxy and GNSHttpServer is that the proxy never executes and commands locally since it is intended to be used as a standalone client. An example use case would be having a GNSHttpProxy running on a Clearpass Authentication machine that is setup to only accept HTTP commands from localhost. Whenever the Clearpass server receives a user login event it sends an HTTP request to its local GNSHttpProxy to update a field in the user's GNS entry with their current location. This would solve the problem of having to spawn a new jvm every time an asynchronous event happens that requires a GNS read or write, but still gives the benefits of a distributed system since GNSHttpProxy uses a GNSClient."
In order to run the HttpProxyTest you can do: ant runtest -Dtest="HttpProxyTest"
This test is also included in "ant test" by default since it is located in the singletests folder.