Commits

Tim Pettersen committed bf8382a

Support specifying HipChat API baseUrl via hipchat.api.url system property.

Comments (0)

Files changed (2)

 
 ![HipChat status in Confluence](https://img.skitch.com/20120216-mqnufnfcd7qh6hxkmh6tuyrdgr.png)
 ![Blog notifications inside a HipChat room](https://img.skitch.com/20120216-bcejc77nua6pfecfj1wk29xdmm.png)
+
+# HipChat Server Beta
+
+Participating in the [HipChat Server Beta](https://www.hipchat.com/server)? Start Confluence with the following system property to target your local HipChat server:
+
+    -Dhipchat.api.url=https://hipchat.yourcompany.com/
+

src/main/java/com/atlassian/labs/hipchat/components/HipChatProxyClient.java

     private static final int CONNECTION_TIMEOUT_MILLIS = 5000;
 
     private static final Logger log = LoggerFactory.getLogger("atlassian.plugin");
-    private static final String API_BASE_URI = "https://api.hipchat.com";
+    private static final String API_BASE_URI = determineApiBaseUri();
 
     private final ConfigurationManager configurationManager;
     private final RequestFactory<Request<?, Response>> requestFactory;
         this.executorService = executorFactory.createExecutorService(Executors.newFixedThreadPool(1));
     }
 
+    private static String determineApiBaseUri()
+    {
+        String apiBase = System.getProperty("hipchat.api.url", "https://api.hipchat.com");
+        // strip trailing slashes
+        while (apiBase.endsWith("/"))
+        {
+            apiBase = apiBase.substring(0, apiBase.length() - 1);
+        }
+        log.info(apiBase + " will be used for HipChat integration (if enabled).");
+        return apiBase;
+    }
+
     /**
      * Returns the JSON representation of a user in HipChat.
      * <pre>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.