I managed to find an alternate solution to communicate with an external service
So, a few things for those looking at this:
- Seraph requires any java jar, not specifically a atlassian-plugin
- You can use any method you wish to communicate with the outside world
Saying that, you can use the build in HttpUrlConnection
in Java
. Its super gross to use but works perfectly. I'd abandon the idea of using SAL
inside of seraph
if someone finds this thread
Here's an example to get started:
try
{
// create the HttpURLConnection
url = new URL(desiredUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// just want to do an HTTP GET here
connection.setRequestMethod("GET");
// uncomment this if you want to write output to this url
//connection.setDoOutput(true);
// give it 15 seconds to respond
connection.setReadTimeout(15*1000);
connection.connect();
// read the output from the server
reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
stringBuilder = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null)
{
stringBuilder.append(line + "\n");
}
return stringBuilder.toString();
}
catch (Exception e)
{
e.printStackTrace();
throw e;
}
Copy/pasta from
https://alvinalexander.com/blog/post/java/how-open-url-read-contents-httpurl-connection-java
But you can find many examples online on how to use this