use of org.wso2.ei.dashboard.core.rest.model.Ack in project carbon-mediation by wso2.
the class HL7TransportSender method sendApplicationACKResponse.
/**
* Send application ack message from the incoming response to the client
* @param messageContext
* @param outTransportInfo
* @throws AxisFault
*/
private void sendApplicationACKResponse(MessageContext messageContext, OutTransportInfo outTransportInfo) throws AxisFault {
HL7ProcessingContext processingContext = ((HL7TransportOutInfo) outTransportInfo).getProcessingContext();
try {
Message message = xmlPayloadToHL7Message(messageContext);
processingContext.offerApplicationResponses(message, messageContext);
} catch (HL7Exception e) {
handleException("Error while sending an custom ack message", e);
}
}
use of org.wso2.ei.dashboard.core.rest.model.Ack in project wso2-synapse by wso2.
the class VFSTransportSenderTest method testTransportSenderInitAndSend.
/**
* Test Transport sender initialization and sending a file
* @throws AxisFault
*/
public void testTransportSenderInitAndSend() throws AxisFault, XMLStreamException {
// Clear file holder
MockFileHolder.getInstance().clear();
VFSTransportSender vfsTransportSender = new VFSTransportSender();
ConfigurationContext configurationContext = new ConfigurationContext(new AxisConfiguration());
TransportOutDescription transportOutDescription = new TransportOutDescription("Test");
// Enable Autolock release
transportOutDescription.addParameter(new Parameter(VFSConstants.TRANSPORT_AUTO_LOCK_RELEASE, true));
// Set Autolock release interval with default value
transportOutDescription.addParameter(new Parameter(VFSConstants.TRANSPORT_AUTO_LOCK_RELEASE_INTERVAL, 20000));
transportOutDescription.addParameter(new Parameter(VFSConstants.TRANSPORT_AUTO_LOCK_RELEASE_SAME_NODE, true));
vfsTransportSender.init(configurationContext, transportOutDescription);
// Create message context
org.apache.axis2.context.MessageContext mc = new org.apache.axis2.context.MessageContext();
populateMessageContext(mc);
String filePath = "test1:///foo/bar/test-" + System.currentTimeMillis() + ".ack";
String parameters = "?transport.vfs.MaxRetryCount=0&transport.vfs.ReconnectTimeout=1&" + "transport.vfs.SendFileSynchronously=true&transport.vfs.CreateFolder=true";
String fURI = filePath + parameters;
OutTransportInfo outTransportInfo = new VFSOutTransportInfo(fURI, true);
vfsTransportSender.sendMessage(mc, fURI, outTransportInfo);
MockFileHolder fileHolder = MockFileHolder.getInstance();
Assert.assertNotNull("File creation failed", fileHolder.getFile(filePath));
}
use of org.wso2.ei.dashboard.core.rest.model.Ack in project product-mi-tooling by wso2.
the class GroupsApi method addUser.
@POST
@Path("/{group-id}/users")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@Operation(summary = "Add user", description = "", tags = { "Users" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "User insert status", content = @Content(schema = @Schema(implementation = SuccessStatus.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response addUser(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @Valid AddUserRequest request) throws ManagementApiException {
UsersDelegate usersDelegate = new UsersDelegate();
Ack ack = usersDelegate.addUser(groupId, request);
Response.ResponseBuilder responseBuilder = Response.ok().entity(ack);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
use of org.wso2.ei.dashboard.core.rest.model.Ack in project product-mi-tooling by wso2.
the class ProxyServiceDelegate method updateArtifact.
@Override
public Ack updateArtifact(String groupId, ArtifactUpdateRequest request) throws ManagementApiException {
logger.debug("Updating proxy service " + request.getArtifactName() + " in node " + request.getNodeId() + " in group " + groupId);
Ack ack = new Ack(Constants.FAIL_STATUS);
boolean isSuccess = updateProxyService(groupId, request);
if (isSuccess) {
ack.setStatus(Constants.SUCCESS_STATUS);
}
return ack;
}
use of org.wso2.ei.dashboard.core.rest.model.Ack in project product-mi-tooling by wso2.
the class SequencesDelegate method updateArtifact.
@Override
public Ack updateArtifact(String groupId, ArtifactUpdateRequest request) throws ManagementApiException {
logger.debug("Updating sequence " + request.getArtifactName() + " in node " + request.getNodeId() + " in group " + groupId);
Ack ack = new Ack(Constants.FAIL_STATUS);
boolean isSuccess = updateSequence(groupId, request);
if (isSuccess) {
ack.setStatus(Constants.SUCCESS_STATUS);
}
return ack;
}
Aggregations