diff --git a/src/main/java/emissary/client/EmissaryClient.java b/src/main/java/emissary/client/EmissaryClient.java index 160e3b16e6..4b53e73ae4 100644 --- a/src/main/java/emissary/client/EmissaryClient.java +++ b/src/main/java/emissary/client/EmissaryClient.java @@ -70,7 +70,7 @@ public class EmissaryClient { private static ConnectionConfig staticConnectionConfig = null; // static config variables - public static String CONTEXT = DEFAULT_CONTEXT; + public static String context = DEFAULT_CONTEXT; protected static int retries = DEFAULT_RETRIES; protected static String username = DEFAULT_USERNAME; // How long to wait while establishing a connection (ms) @@ -102,7 +102,7 @@ protected static void configure() { connectionTimeout = c.findIntEntry("connectionTimeout", DEFAULT_CONNECTION_TIMEOUT); connectionManagerTimeout = c.findIntEntry("connectionManagerTimeout", DEFAULT_CONNECTION_MANAGER_TIMEOUT); socketTimeout = c.findIntEntry("socketTimeout", DEFAULT_SOCKET_TIMEOUT); - CONTEXT = c.findStringEntry("context", DEFAULT_CONTEXT); + context = c.findStringEntry("context", DEFAULT_CONTEXT); } catch (IOException iox) { LOGGER.warn("Cannot read EmissaryClient properties, configuring defaults: {}", iox.getMessage()); retries = DEFAULT_RETRIES; @@ -110,7 +110,7 @@ protected static void configure() { connectionTimeout = DEFAULT_CONNECTION_TIMEOUT; connectionManagerTimeout = DEFAULT_CONNECTION_MANAGER_TIMEOUT; socketTimeout = DEFAULT_SOCKET_TIMEOUT; - CONTEXT = DEFAULT_CONTEXT; + context = DEFAULT_CONTEXT; } // Read the jetty user realm formatted property file for the password diff --git a/src/main/java/emissary/directory/HeartbeatManager.java b/src/main/java/emissary/directory/HeartbeatManager.java index 2c94f93dee..5fa712a73a 100755 --- a/src/main/java/emissary/directory/HeartbeatManager.java +++ b/src/main/java/emissary/directory/HeartbeatManager.java @@ -352,7 +352,7 @@ public static EmissaryResponse getHeartbeat(String fromPlace, String toPlace) { public static EmissaryResponse getHeartbeat(String fromPlace, String toPlace, EmissaryClient client) { final String directoryUrl = KeyManipulator.getServiceHostUrl(toPlace); - final HttpPost method = client.createHttpPost(directoryUrl, EmissaryClient.CONTEXT, "/Heartbeat.action"); + final HttpPost method = client.createHttpPost(directoryUrl, EmissaryClient.context, "/Heartbeat.action"); final String loc = KeyManipulator.getServiceLocation(toPlace); final List nvps = new ArrayList<>(); diff --git a/src/main/java/emissary/server/mvc/adapters/DirectoryAdapter.java b/src/main/java/emissary/server/mvc/adapters/DirectoryAdapter.java index 6f0bcbea0c..84ae6d6572 100755 --- a/src/main/java/emissary/server/mvc/adapters/DirectoryAdapter.java +++ b/src/main/java/emissary/server/mvc/adapters/DirectoryAdapter.java @@ -89,7 +89,7 @@ public EmissaryResponse outboundAddPlaces(final String parentDirectory, final Li return new EmissaryResponse(response); } else { final String parentDirectoryUrl = KeyManipulator.getServiceHostUrl(parentDirectory); - final HttpPost method = createHttpPost(parentDirectoryUrl, CONTEXT, "/RegisterPlace.action"); + final HttpPost method = createHttpPost(parentDirectoryUrl, context, "/RegisterPlace.action"); final String parentLoc = KeyManipulator.getServiceLocation(parentDirectory); // Separate it out into lists @@ -140,7 +140,7 @@ public EmissaryResponse outboundAddPlaces(final String parentDirectory, final Li */ public EmissaryResponse outboundRemovePlaces(final String directory, final List key, final boolean propagating) { final String directoryUrl = KeyManipulator.getServiceHostUrl(directory); - final HttpPost method = createHttpPost(directoryUrl, CONTEXT, "/DeregisterPlace.action"); + final HttpPost method = createHttpPost(directoryUrl, context, "/DeregisterPlace.action"); final String parentLoc = KeyManipulator.getServiceLocation(directory); @@ -166,7 +166,7 @@ public EmissaryResponse outboundRemovePlaces(final String directory, final List< */ public EmissaryResponse outboundFailDirectory(final String directory, final String failKey, final boolean permanent) { final String directoryUrl = KeyManipulator.getServiceHostUrl(directory); - final HttpPost method = createHttpPost(directoryUrl, CONTEXT, "/FailDirectory.action"); + final HttpPost method = createHttpPost(directoryUrl, context, "/FailDirectory.action"); final String parentLoc = KeyManipulator.getServiceLocation(directory); final List nvps = new ArrayList<>(); @@ -243,7 +243,7 @@ public DirectoryEntryMap outboundRegisterPeer(final String key, final String pee * @throws EmissaryException if remote returns an error */ private DirectoryEntryMap zoneTransfer(final String key, @Nullable final String myKey, final String action) throws EmissaryException { - final HttpPost method = createHttpPost(KeyManipulator.getServiceHostUrl(key), CONTEXT, action); + final HttpPost method = createHttpPost(KeyManipulator.getServiceHostUrl(key), context, action); final String parentLoc = KeyManipulator.getServiceLocation(key); final List nvps = new ArrayList<>(); diff --git a/src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java b/src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java index eb20d16b7c..b453228a82 100755 --- a/src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java +++ b/src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java @@ -38,7 +38,7 @@ public class WorkSpaceAdapter extends EmissaryClient { public EmissaryResponse outboundOpenWorkSpace(final String place, final String space) { final String placeUrl = KeyManipulator.getServiceHostUrl(place); - final HttpPost method = createHttpPost(placeUrl, CONTEXT, "/WorkSpaceClientOpenWorkSpace.action"); + final HttpPost method = createHttpPost(placeUrl, context, "/WorkSpaceClientOpenWorkSpace.action"); final List nvps = new ArrayList<>(); nvps.add(new BasicNameValuePair(CLIENT_NAME, place)); @@ -59,7 +59,7 @@ public EmissaryResponse outboundOpenWorkSpace(final String place, final String s public WorkBundle outboundWorkSpaceTake(final String space, final String place) { final String placeUrl = KeyManipulator.getServiceHostUrl(space); - final HttpPost method = createHttpPost(placeUrl, CONTEXT, "/WorkSpaceClientSpaceTake.action"); + final HttpPost method = createHttpPost(placeUrl, context, "/WorkSpaceClientSpaceTake.action"); final List nvps = new ArrayList<>(); nvps.add(new BasicNameValuePair(CLIENT_NAME, place)); @@ -89,7 +89,7 @@ public WorkBundle outboundWorkSpaceTake(final String space, final String place) */ public boolean outboundBundleCompletion(final String space, final String place, final String bundleId, final boolean itWorked) { final String placeUrl = KeyManipulator.getServiceHostUrl(space); - final HttpPost method = createHttpPost(placeUrl, CONTEXT, "/WorkBundleCompleted.action"); + final HttpPost method = createHttpPost(placeUrl, context, "/WorkBundleCompleted.action"); final List nvps = new ArrayList<>(); nvps.add(new BasicNameValuePair(CLIENT_NAME, place)); diff --git a/src/test/java/emissary/core/FTestMovingAgent.java b/src/test/java/emissary/core/FTestMovingAgent.java index 570a4d0241..d84fe47d0e 100644 --- a/src/test/java/emissary/core/FTestMovingAgent.java +++ b/src/test/java/emissary/core/FTestMovingAgent.java @@ -157,7 +157,7 @@ private void runTest(@Nullable final String agentClass) { private void runHttpTest() { final Version version = new Version(); final EmissaryClient h = new EmissaryClient(); - final String urlBase = KeyManipulator.getServiceHostUrl(this.dir1.getKey()) + EmissaryClient.CONTEXT + "/"; + final String urlBase = KeyManipulator.getServiceHostUrl(this.dir1.getKey()) + EmissaryClient.context + "/"; HttpGet get = new HttpGet(urlBase + "welcome.jsp"); EmissaryResponse ws = h.send(get); String msg = ws.getContentString();