Skip to content

3.4.0 Upgrade Guide

Chris Turczynskyj edited this page Nov 3, 2021 · 2 revisions

Mirth Connect plugins that implement custom client <-> server communication will need to be updated to use the new HTTP servlet architecture introduced in version 3.4.0.

Specifically, the invoke() method has been removed from the ServicePlugin interface as well as the ClientPlugin abstract class. Prior to 3.4.0, calls to ClientPlugin.invoke() on the client were routed to ServicePlugin.invoke() on the server.

Plugins that previously used these methods must now provide a separate servlet interface on the server side using JAX-RS and Swagger annotations:

ServerLogInterface.java:

@Path("/extensions/serverlog")
@Api("Extension Services")
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public interface ServerLogServletInterface extends BaseServletInterface {
    public static final String PLUGIN_POINT = "Server Log";
    public static final String PERMISSION_VIEW = "View Server Log";
 
    @GET
    @Path("/")
    @ApiOperation("Retrieves all server log entries.")
    @MirthOperation(name = "getMirthServerLogs", display = "View Server Log", permission = PERMISSION_VIEW, type = ExecuteType.ASYNC, auditable = false)
    public LinkedList<String[]> getServerLogs() throws ClientException;

To invoke servlet methods from the client side, use the getServlet() method instead of the previous invokePluginMethod* methods.

ServerLogClient.java - 3.3.x and earlier:

try {
    serverLogReceived = (LinkedList<String[]>) PlatformUI.MIRTH_FRAME.mirthClient.invokePluginMethodAsync(SERVER_LOG_SERVICE_PLUGINPOINT, GET_SERVER_LOGS, null);
} catch (ClientException e) {

ServerLogClient.java - 3.4.0 and later:

try {
    serverLogReceived = PlatformUI.MIRTH_FRAME.mirthClient.getServlet(ServerLogServletInterface.class).getServerLogs();
} catch (ClientException e) {

The servlet interface must also be specified in the plugin's plugin.xml file:

<pluginMetaData path="serverlog">
    ...
    <apiProvider type="SERVLET_INTERFACE" name="com.mirth.connect.plugins.serverlog.ServerLogServletInterface"/>
    ...
</pluginMetaData>
Clone this wiki locally