public String checkStatus(@PathVariable("asyncId") String asyncId) throws Exception
{
// Connect to Metadata API, check async status and return to client
ForceServiceConnector connector = new ForceServiceConnector(ForceServiceConnector.getThreadLocalConnectorConfig());
MetadataConnection metadataConnection = connector.getMetadataConnection();
AsyncResult asyncResult = metadataConnection.checkStatus(new String[] { asyncId })[0];
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.getSerializationConfig().addMixInAnnotations(AsyncResult.class, AsyncResultMixIn.class);
return objectMapper.writeValueAsString(asyncResult);
}