Search in sources :

Example 1 with GetCurrentMessageResponse

use of org.oasis_open.docs.wsn.b_2.GetCurrentMessageResponse in project cxf by apache.

the class NotificationBroker method getCurrentMessage.

public List<Object> getCurrentMessage(String topic) throws // CHECKSTYLE:OFF - WS-Notification spec throws a lot of faults
TopicNotSupportedFault, TopicExpressionDialectUnknownFault, MultipleTopicsSpecifiedFault, InvalidTopicExpressionFault, ResourceUnknownFault, NoCurrentMessageOnTopicFault {
    // CHECKSTYLE:ON
    GetCurrentMessage getCurrentMessageRequest = new GetCurrentMessage();
    if (topic != null) {
        TopicExpressionType topicExp = new TopicExpressionType();
        topicExp.getContent().add(topic);
        getCurrentMessageRequest.setTopic(topicExp);
    }
    GetCurrentMessageResponse response = getBroker().getCurrentMessage(getCurrentMessageRequest);
    return response.getAny();
}
Also used : GetCurrentMessageResponse(org.oasis_open.docs.wsn.b_2.GetCurrentMessageResponse) TopicExpressionType(org.oasis_open.docs.wsn.b_2.TopicExpressionType) GetCurrentMessage(org.oasis_open.docs.wsn.b_2.GetCurrentMessage)

Example 2 with GetCurrentMessageResponse

use of org.oasis_open.docs.wsn.b_2.GetCurrentMessageResponse in project cxf by apache.

the class AbstractNotificationBroker method getCurrentMessage.

/**
 * @param getCurrentMessageRequest
 * @return returns org.oasis_open.docs.wsn.b_1.GetCurrentMessageResponse
 * @throws MultipleTopicsSpecifiedFault
 * @throws TopicNotSupportedFault
 * @throws InvalidTopicExpressionFault
 * @throws ResourceUnknownFault
 * @throws TopicExpressionDialectUnknownFault
 * @throws NoCurrentMessageOnTopicFault
 */
@WebMethod(operationName = "GetCurrentMessage")
@WebResult(name = "GetCurrentMessageResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetCurrentMessageResponse")
public GetCurrentMessageResponse getCurrentMessage(@WebParam(name = "GetCurrentMessage", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetCurrentMessageRequest") GetCurrentMessage getCurrentMessageRequest) throws // CHECKSTYLE:OFF - WS-Notification spec throws a lot of faults
InvalidTopicExpressionFault, MultipleTopicsSpecifiedFault, NoCurrentMessageOnTopicFault, ResourceUnknownFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault {
    // CHECKSTYLE:ON
    LOGGER.finest("GetCurrentMessage");
    NoCurrentMessageOnTopicFaultType fault = new NoCurrentMessageOnTopicFaultType();
    throw new NoCurrentMessageOnTopicFault("There is no current message on this topic.", fault);
}
Also used : NoCurrentMessageOnTopicFaultType(org.oasis_open.docs.wsn.b_2.NoCurrentMessageOnTopicFaultType) NoCurrentMessageOnTopicFault(org.oasis_open.docs.wsn.bw_2.NoCurrentMessageOnTopicFault) WebMethod(javax.jws.WebMethod) WebResult(javax.jws.WebResult)

Aggregations

WebMethod (javax.jws.WebMethod)1 WebResult (javax.jws.WebResult)1 GetCurrentMessage (org.oasis_open.docs.wsn.b_2.GetCurrentMessage)1 GetCurrentMessageResponse (org.oasis_open.docs.wsn.b_2.GetCurrentMessageResponse)1 NoCurrentMessageOnTopicFaultType (org.oasis_open.docs.wsn.b_2.NoCurrentMessageOnTopicFaultType)1 TopicExpressionType (org.oasis_open.docs.wsn.b_2.TopicExpressionType)1 NoCurrentMessageOnTopicFault (org.oasis_open.docs.wsn.bw_2.NoCurrentMessageOnTopicFault)1