Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv21550/src/hk/hku/cecid/phoenix/message/handler
Modified Files:
Constants.java MessageProcessor.java
MessageServiceHandler.java
Added Files:
SignalMessageGenerator.java
Log Message:
Move the logic of making StatusResponse Message, Acknowledgment Message
Pong Message and Error Message from MessageServiceHandler to a new class
called SignalMessageGenerator
Move some constants from MessageServiceHandler to Constants.java
--- NEW FILE: SignalMessageGenerator.java ---
/*
* Copyright(c) 2002 Center for E-Commerce Infrastructure Development, The
* University of Hong Kong (HKU). All Rights Reserved.
*
* This software is licensed under the Academic Free License Version 1.0
*
* Academic Free License
* Version 1.0
*
* This Academic Free License applies to any software and associated
* documentation (the "Software") whose owner (the "Licensor") has placed the
* statement "Licensed under the Academic Free License Version 1.0" immediately
* after the copyright notice that applies to the Software.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of the Software (1) to use, copy, modify, merge, publish, perform,
* distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, and (2) under patent
* claims owned or controlled by the Licensor that are embodied in the Software
* as furnished by the Licensor, to make, use, sell and offer for sale the
* Software and derivative works thereof, subject to the following conditions:
*
* - Redistributions of the Software in source code form must retain all
* copyright notices in the Software as furnished by the Licensor, this list
* of conditions, and the following disclaimers.
* - Redistributions of the Software in executable form must reproduce all
* copyright notices in the Software as furnished by the Licensor, this list
* of conditions, and the following disclaimers in the documentation and/or
* other materials provided with the distribution.
* - Neither the names of Licensor, nor the names of any contributors to the
* Software, nor any of their trademarks or service marks, may be used to
* endorse or promote products derived from this Software without express
* prior written permission of the Licensor.
*
* DISCLAIMERS: LICENSOR WARRANTS THAT THE COPYRIGHT IN AND TO THE SOFTWARE IS
* OWNED BY THE LICENSOR OR THAT THE SOFTWARE IS DISTRIBUTED BY LICENSOR UNDER
* A VALID CURRENT LICENSE. EXCEPT AS EXPRESSLY STATED IN THE IMMEDIATELY
* PRECEDING SENTENCE, THE SOFTWARE IS PROVIDED BY THE LICENSOR, CONTRIBUTORS
* AND COPYRIGHT OWNERS "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* LICENSOR, CONTRIBUTORS OR COPYRIGHT OWNERS BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE.
*
* This license is Copyright (C) 2002 Lawrence E. Rosen. All rights reserved.
* Permission is hereby granted to copy and distribute this license without
* modification. This license may not be modified without the express written
* permission of its copyright owner.
*/
/* =====
*
* $Header: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/SignalMessageGenerator.java,v 1.1 2003/11/21 02:00:05 bobpykoon Exp $
*
* Code authored by:
*
* pykoon [2002-11-21]
*
* Code reviewed by:
*
* username [YYYY-MM-DD]
*
* Remarks:
*
* =====
*/
package hk.hku.cecid.phoenix.message.handler;
import hk.hku.cecid.phoenix.message.packaging.EbxmlMessage;
import hk.hku.cecid.phoenix.message.packaging.Acknowledgment;
import hk.hku.cecid.phoenix.message.packaging.ErrorList;
import hk.hku.cecid.phoenix.message.packaging.MessageHeader;
import hk.hku.cecid.phoenix.message.packaging.Signature;
import hk.hku.cecid.phoenix.message.packaging.SignatureReference;
import javax.xml.soap.SOAPException;
import java.util.Date;
import java.util.Iterator;
/**
* <code>SignalMessageGenerator</code> is an utility api for the user to
* generate some signal message
* @author pykoon
* @version $Revision: 1.1 $
*/
public class SignalMessageGenerator {
/**
* Generate a simple response message containing required elements in
* message header. They include:
* <ul>
* <li>From/PartyId [ebMSS 3.1.1]</li>
* <li>To/PartyId [ebMSS 3.1.1]</li>
* <li>CPAId [ebMSS 3.1.2].</li>
* <li>ConversationId [ebMSS 3.1.3].</li>
* <li>Service [ebMSS 3.1.4].</li>
* <li>Action [ebMSS 3.1.5].</li>
* <li>MessageId [ebMSS 3.1.6.1].</li>
* <li>Timestamp [ebMSS 3.1.6.2].</li>
* </ul>
*
* @param requestMessage Request message for which a response message
* shall be generated.
* @param action Name of the action.
*
* @return An {@link EbxmlMessage} that contains the fields mentioned
* above.
*
* @exception SOAPException
*/
private static EbxmlMessage generateResponseMessage(
EbxmlMessage requestMessage, String action) throws SOAPException {
final EbxmlMessage responseMessage;
responseMessage = new EbxmlMessage();
final MessageHeader.PartyId fromParty = (MessageHeader.PartyId)
requestMessage.getToPartyIds().next();
final String fromPartyId = fromParty.getId();
final String fromPartyIdType = fromParty.getType();
final MessageHeader.PartyId toParty = (MessageHeader.PartyId)
requestMessage.getFromPartyIds().next();
final String toPartyId = toParty.getId();
final String toPartyIdType = toParty.getType();
final Date date = new Date();
final String timeStamp = Utility.toUTCString(date);
final String messageId = Utility.generateMessageId(date, toPartyId,
requestMessage.getCpaId(), Constants.SERVICE, action);
responseMessage.addMessageHeader(fromPartyId, fromPartyIdType,
toPartyId, toPartyIdType, requestMessage.getCpaId(),
requestMessage.getConversationId(), Constants.SERVICE, action, messageId,
timeStamp);
return responseMessage;
}
/**
* Generates acknowledgement message from the given acknowledgement
* request message and the refToMessageId.
* Note that the acknowledgment message is not signed.
*
* @param ackRequestedMessage Acknowledgement request message.
* @param refToMessageId MessageId of the message to which the
* acknowledgement response should be referred.
*
* @return Acknowledgement message.
*
* @exception SOAPException
*/
public static EbxmlMessage generateAcknowledgment(
EbxmlMessage ackRequestedMessage, String refToMessageId)
throws SOAPException {
final EbxmlMessage ackMessage = generateResponseMessage(
ackRequestedMessage, Constants.ACTION_ACKNOWLEDGMENT);
final MessageHeader messageHeader = ackMessage.getMessageHeader();
messageHeader.setRefToMessageId(refToMessageId);
if (ackRequestedMessage.getDuplicateElimination()) {
messageHeader.setDuplicateElimination();
}
Iterator toParties = ackRequestedMessage.getToPartyIds();
if (toParties.hasNext()) {
MessageHeader.PartyId party =
(MessageHeader.PartyId) toParties.next();
ackMessage.addAcknowledgment(messageHeader.getTimestamp(),
ackRequestedMessage, party.getId(), party.getType());
} else {
/*
ackMessage.addAcknowledgment(messageHeader.getTimestamp(),
ackRequestedMessage, mshUrl);
*/
throw new SOAPException(
"Missing To party Id on ack request message");
}
Iterator signatures = ackRequestedMessage.getSignatures();
if (signatures.hasNext()) {
Acknowledgment ack = ackMessage.getAcknowledgment();
for (Iterator i=((Signature) signatures.next()).
getReferences() ; i.hasNext() ; ) {
ack.addSignatureReference((SignatureReference) i.next());
}
ackMessage.getSOAPMessage().getSOAPPart().getEnvelope().
addNamespaceDeclaration(Signature.NAMESPACE_PREFIX_DS,
Signature.NAMESPACE_URI_DS);
ackMessage.saveChanges();
}
return ackMessage;
}
/**
* Generates acknowledgement message from the given acknowledgement
* request message and the refToMessageId.
* Note that the acknowledgment message is not signed.
*
* @param ackRequestedMessage Acknowledgement request message.
* @param refToMessageId MessageId of the message to which the
* acknowledgement response should be referred.
*
* @return Acknowledgement message.
*
* @exception SOAPException
*/
public static EbxmlMessage generateAcknowledgment(
EbxmlMessage ackRequestedMessage) throws SOAPException {
return generateAcknowledgment(ackRequestedMessage,
ackRequestedMessage.getMessageId());
}
/**
* Generates response message from the given status request message and
* the status string [ebMSS 7.1.2].
*
* @param statusRequestMessage Status request message.
* @param status Current status of the message service
* handler.
*
* @return Status response message.
*
* @exception SOAPException
*/
public static EbxmlMessage generateStatusResponseMessage(
EbxmlMessage statusRequestMessage, String status, String timestamp)
throws SOAPException {
final EbxmlMessage statusResponseMessage = generateResponseMessage(
statusRequestMessage, Constants.ACTION_STATUS_RESPONSE);
statusResponseMessage.getMessageHeader().setRefToMessageId(
statusRequestMessage.getMessageId());
final String refToMessageId
= statusRequestMessage.getStatusRequest().getRefToMessageId();
if (status.equals(Constants.STATUS_UN_AUTHORIZED) ||
status.equals(Constants.STATUS_NOT_RECOGNIZED)) {
statusResponseMessage.addStatusResponse(refToMessageId, status);
}
else {
long time = Long.parseLong(timestamp);
Date date = new Date(time);
String utcTime = Utility.toUTCString(date);
statusResponseMessage.addStatusResponse(
refToMessageId, status, utcTime);
}
return statusResponseMessage;
}
/**
* Generates an error message containing the specfied error code
* [ebMSS 4.2.3.4.1].
*
* @param ebxmlMessage ebXML message to which error list should be
* attached.
* @param errorCode Error code of the message.
* @param severity Error severity, either ERROR or WARNING.
* @param description Human-readable description of the error message.
* @param location Source of the error.
*
* @return ebXML message containing error code.
*
* @exception SOAPException
*/
public static EbxmlMessage generateErrorMessage(EbxmlMessage ebxmlMessage,
String errorCode, String severity, String description,
String location) throws SOAPException {
final EbxmlMessage errorMessage = generateResponseMessage(
ebxmlMessage, Constants.ACTION_MESSAGE_ERROR);
errorMessage.getMessageHeader().
setRefToMessageId(ebxmlMessage.getMessageId());
errorMessage.addErrorList(errorCode, severity, description,
location);
errorMessage.saveChanges();
return errorMessage;
}
/**
* Generates pong message from the given ping message [ebMSS 8.2].
*
* @param pingMessage Incoming ping message.
*
* @return Pong message in response of the incoming ping message.
*
* @exception SOAPException
*/
public static EbxmlMessage generatePongMessage(EbxmlMessage pingMessage)
throws SOAPException {
final EbxmlMessage pongMessage = generateResponseMessage(
pingMessage, Constants.ACTION_PONG);
pongMessage.getMessageHeader().setRefToMessageId(
pingMessage.getMessageId());
pongMessage.saveChanges();
return pongMessage;
}
}
Index: Constants.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/Constants.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** Constants.java 11 Sep 2003 08:58:08 -0000 1.32
--- Constants.java 21 Nov 2003 02:00:04 -0000 1.33
***************
*** 294,297 ****
--- 294,335 ----
/**
+ * Service name reserved for services described in ebXML Message Service
+ * Specification [ebMSS 3.1.4].
+ */
+ public static final String SERVICE =
+ "urn:oasis:names:tc:ebxml-msg:service";
+
+ /**
+ * Acknowledgement action [ebMSS 6.3.2.7]
+ */
+ public static final String ACTION_ACKNOWLEDGMENT = "Acknowledgment";
+
+ /**
+ * Action for an ErrorList element to be included in an independent
+ * message [ebMSS 4.2.4.3]
+ */
+ public static final String ACTION_MESSAGE_ERROR = "MessageError";
+
+ /**
+ * Action for ping message [ebMSS 8.1]
+ */
+ public static final String ACTION_PING = "Ping";
+
+ /**
+ * Action for pong message [ebMSS 8.2]
+ */
+ public static final String ACTION_PONG = "Pong";
+
+ /**
+ * Action for status request message [ebMSS 7.1.1]
+ */
+ public static final String ACTION_STATUS_REQUEST = "StatusRequest";
+
+ /**
+ * Action for status response message [ebMSS 7.1.2]
+ */
+ public static final String ACTION_STATUS_RESPONSE = "StatusResponse";
+
+ /**
Path to access the classname of customized Hostname verifier for
the SSL connection
Index: MessageProcessor.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageProcessor.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** MessageProcessor.java 2 Jul 2003 07:02:51 -0000 1.51
--- MessageProcessor.java 21 Nov 2003 02:00:05 -0000 1.52
***************
*** 235,240 ****
ebxmlMessage.getErrorList() == null &&
ebxmlMessage.getStatusResponse() == null &&
! !(ebxmlMessage.getService().equals(MessageServiceHandler.SERVICE) &&
! ebxmlMessage.getAction().equals(MessageServiceHandler.ACTION_PONG));
messageSender = null;
boolean commError = false;
--- 235,240 ----
ebxmlMessage.getErrorList() == null &&
ebxmlMessage.getStatusResponse() == null &&
! !(ebxmlMessage.getService().equals(Constants.SERVICE) &&
! ebxmlMessage.getAction().equals(Constants.ACTION_PONG));
messageSender = null;
boolean commError = false;
***************
*** 608,618 ****
final String messageId = Utility.generateMessageId
(date, toPartyId, ebxmlMessage.getCpaId(),
! MessageServiceHandler.SERVICE,
! MessageServiceHandler.ACTION_STATUS_RESPONSE);
logger.debug("new message id: <" + messageId + ">");
positiveAckMessage.addMessageHeader(fromPartyId, toPartyId,
ebxmlMessage.getCpaId(), ebxmlMessage.getConversationId(),
! MessageServiceHandler.SERVICE, MessageServiceHandler.
! ACTION_STATUS_RESPONSE, messageId, timeStamp);
positiveAckMessage.getMessageHeader().
setRefToMessageId(ebxmlMessage.getMessageId());
--- 608,617 ----
final String messageId = Utility.generateMessageId
(date, toPartyId, ebxmlMessage.getCpaId(),
! Constants.SERVICE, Constants.ACTION_STATUS_RESPONSE);
logger.debug("new message id: <" + messageId + ">");
positiveAckMessage.addMessageHeader(fromPartyId, toPartyId,
ebxmlMessage.getCpaId(), ebxmlMessage.getConversationId(),
! Constants.SERVICE, Constants.ACTION_STATUS_RESPONSE,
! messageId, timeStamp);
positiveAckMessage.getMessageHeader().
setRefToMessageId(ebxmlMessage.getMessageId());
***************
*** 678,683 ****
errorMessage.addMessageHeader(toPartyId, toPartyType,
fromPartyId, fromPartyType, ebxmlMessage.getCpaId(),
! ebxmlMessage.getConversationId(), MessageServiceHandler.SERVICE,
! MessageServiceHandler.ACTION_MESSAGE_ERROR, messageId,
timeStamp).setRefToMessageId(ebxmlMessage.getMessageId());
errorMessage.addErrorList(errorCode, severity, description);
--- 677,682 ----
errorMessage.addMessageHeader(toPartyId, toPartyType,
fromPartyId, fromPartyType, ebxmlMessage.getCpaId(),
! ebxmlMessage.getConversationId(), Constants.SERVICE,
! Constants.ACTION_MESSAGE_ERROR, messageId,
timeStamp).setRefToMessageId(ebxmlMessage.getMessageId());
errorMessage.addErrorList(errorCode, severity, description);
Index: MessageServiceHandler.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageServiceHandler.java,v
retrieving revision 1.177
retrieving revision 1.178
diff -C2 -d -r1.177 -r1.178
*** MessageServiceHandler.java 17 Nov 2003 02:09:29 -0000 1.177
--- MessageServiceHandler.java 21 Nov 2003 02:00:05 -0000 1.178
***************
*** 140,143 ****
--- 140,144 ----
* Service name reserved for services described in ebXML Message Service
* Specification [ebMSS 3.1.4].
+ @deprecated please use Constants.SERVICE
*/
public static final String SERVICE =
***************
*** 146,149 ****
--- 147,151 ----
/**
* Acknowledgement action [ebMSS 6.3.2.7]
+ * @deprecated please use Constants.ACTION_ACKNOWLEDGMENT
*/
public static final String ACTION_ACKNOWLEDGMENT = "Acknowledgment";
***************
*** 152,155 ****
--- 154,158 ----
* Action for an ErrorList element to be included in an independent
* message [ebMSS 4.2.4.3]
+ * @deprecated please use Constants.ACTION_MESSAGE_ERROR
*/
public static final String ACTION_MESSAGE_ERROR = "MessageError";
***************
*** 157,160 ****
--- 160,164 ----
/**
* Action for ping message [ebMSS 8.1]
+ * @deprecated please use Constants.ACTION_PING
*/
public static final String ACTION_PING = "Ping";
***************
*** 162,165 ****
--- 166,170 ----
/**
* Action for pong message [ebMSS 8.2]
+ * @deprecated please use Constants.ACTION_PONG
*/
public static final String ACTION_PONG = "Pong";
***************
*** 167,170 ****
--- 172,176 ----
/**
* Action for status request message [ebMSS 7.1.1]
+ * @deprecated please use Constants.ACTION_STATUS_REQUEST
*/
public static final String ACTION_STATUS_REQUEST = "StatusRequest";
***************
*** 172,175 ****
--- 178,182 ----
/**
* Action for status response message [ebMSS 7.1.2]
+ * @deprecated please use Constants.ACTION_STATUS_RESPONSE
*/
public static final String ACTION_STATUS_RESPONSE = "StatusResponse";
***************
*** 2356,2426 ****
}
- /**
- * Generate a simple response message containing required elements in
- * message header. They include:
- * <ul>
- * <li>From/PartyId [ebMSS 3.1.1]</li>
- * <li>To/PartyId [ebMSS 3.1.1]</li>
- * <li>CPAId [ebMSS 3.1.2].</li>
- * <li>ConversationId [ebMSS 3.1.3].</li>
- * <li>Service [ebMSS 3.1.4].</li>
- * <li>Action [ebMSS 3.1.5].</li>
- * <li>MessageId [ebMSS 3.1.6.1].</li>
- * <li>Timestamp [ebMSS 3.1.6.2].</li>
- * </ul>
- *
- * @param requestMessage Request message for which a response message
- * shall be generated.
- * @param action Name of the action.
- *
- * @return An {@link EbxmlMessage} that contains the fields mentioned
- * above.
- *
- * @exception MessageServiceHandlerException
- */
- private EbxmlMessage generateResponseMessage(EbxmlMessage requestMessage,
- String action)
- throws MessageServiceHandlerException {
-
- logger.debug("=> MessageServiceHandler.generateResponseMessage");
-
- final EbxmlMessage responseMessage;
- try {
- responseMessage = new EbxmlMessage();
- final MessageHeader.PartyId fromParty = (MessageHeader.PartyId)
- requestMessage.getToPartyIds().next();
- final String fromPartyId = fromParty.getId();
- final String fromPartyIdType = fromParty.getType();
- final MessageHeader.PartyId toParty = (MessageHeader.PartyId)
- requestMessage.getFromPartyIds().next();
- final String toPartyId = toParty.getId();
- final String toPartyIdType = toParty.getType();
- final Date date = new Date();
- final String timeStamp = Utility.toUTCString(date);
- final String messageId = Utility.generateMessageId(date, toPartyId,
- requestMessage.getCpaId(), SERVICE, action);
-
- logger.debug("new message id: <" + messageId + ">");
- responseMessage.addMessageHeader(fromPartyId, fromPartyIdType,
- toPartyId, toPartyIdType, requestMessage.getCpaId(),
- requestMessage.getConversationId(), SERVICE, action, messageId,
- timeStamp);
- }
- catch (SOAPException e) {
- String err = ErrorMessages.getMessage(
- ErrorMessages.ERR_SOAP_GENERAL_ERROR, e);
- logger.warn(err);
- throw new MessageServiceHandlerException(err);
- }
- catch (Exception e) {
- String err = ErrorMessages.getMessage(
- ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
- logger.error(err);
- throw new MessageServiceHandlerException(err);
- }
-
- logger.debug("<= MessageServiceHandler.generateResponseMessage");
- return responseMessage;
- }
/**
--- 2363,2366 ----
***************
*** 2541,2581 ****
try {
! final EbxmlMessage ackMessage = generateResponseMessage
! (ackRequestedMessage, ACTION_ACKNOWLEDGMENT);
!
! final MessageHeader messageHeader = ackMessage.getMessageHeader();
! messageHeader.setRefToMessageId(refToMessageId);
! logger.debug("refTo message id: <" + refToMessageId + ">");
! if (ackRequestedMessage.getDuplicateElimination()) {
! messageHeader.setDuplicateElimination();
! }
! // ackMessage.addAcknowledgment(messageHeader.getTimestamp(),
! // ackRequestedMessage, mshUrl);
! Iterator toParties = ackRequestedMessage.getToPartyIds();
! String actor = ackRequestedMessage.getAckRequested().getActor();
! if (toParties.hasNext()) {
! MessageHeader.PartyId party =
! (MessageHeader.PartyId) toParties.next();
! ackMessage.addAcknowledgment(messageHeader.getTimestamp(),
! ackRequestedMessage, party.getId(), party.getType());
! }
! else {
! ackMessage.addAcknowledgment(messageHeader.getTimestamp(),
! ackRequestedMessage, mshUrl);
! }
!
! Iterator signatures = ackRequestedMessage.getSignatures();
! if (signatures.hasNext()) {
! Acknowledgment ack = ackMessage.getAcknowledgment();
! for (Iterator i=((Signature) signatures.next()).
! getReferences() ; i.hasNext() ; ) {
! ack.addSignatureReference((SignatureReference) i.next());
! }
! ackMessage.getSOAPMessage().getSOAPPart().getEnvelope().
! addNamespaceDeclaration(Signature.NAMESPACE_PREFIX_DS,
! Signature.NAMESPACE_URI_DS);
! ackMessage.saveChanges();
! }
!
if (ackRequestedMessage.getAckRequested().getSigned()) {
logger.debug("sign the Ack");
--- 2481,2487 ----
try {
! EbxmlMessage ackMessage
! = SignalMessageGenerator.generateAcknowledgment(
! ackRequestedMessage, refToMessageId);
if (ackRequestedMessage.getAckRequested().getSigned()) {
logger.debug("sign the Ack");
***************
*** 2606,2612 ****
throw new MessageServiceHandlerException(e.getMessage());
}
- catch (MessageServiceHandlerException e) {
- throw e;
- }
catch (Exception e) {
String err = ErrorMessages.getMessage(
--- 2512,2515 ----
***************
*** 2634,2656 ****
logger.debug("=> MessageServiceHandler.generateStatusResponseMessage");
!
! final EbxmlMessage statusResponseMessage = generateResponseMessage
! (statusRequestMessage, ACTION_STATUS_RESPONSE);
try {
! statusResponseMessage.getMessageHeader().
! setRefToMessageId(statusRequestMessage.getMessageId());
! final String refToMessageId = statusRequestMessage.
! getStatusRequest().getRefToMessageId();
! if (status.equals(Constants.STATUS_UN_AUTHORIZED) ||
! status.equals(Constants.STATUS_NOT_RECOGNIZED)) {
! statusResponseMessage.addStatusResponse(refToMessageId, status);
! }
! else {
! long time = Long.parseLong(timestamp);
! Date date = new Date(time);
! String utcTime = Utility.toUTCString(date);
! statusResponseMessage.
! addStatusResponse(refToMessageId, status, utcTime);
! }
}
catch (SOAPException e) {
--- 2537,2545 ----
logger.debug("=> MessageServiceHandler.generateStatusResponseMessage");
! EbxmlMessage statusResponseMessage = null;
try {
! statusResponseMessage
! = SignalMessageGenerator.generateStatusResponseMessage(
! statusRequestMessage, status, timestamp);
}
catch (SOAPException e) {
***************
*** 2719,2731 ****
logger.debug("=> MessageServiceHandler.generateErrorMessage");
!
! final EbxmlMessage errorMessage = generateResponseMessage
! (ebxmlMessage, ACTION_MESSAGE_ERROR);
try {
! errorMessage.getMessageHeader().
! setRefToMessageId(ebxmlMessage.getMessageId());
! errorMessage.addErrorList(errorCode, severity, description,
! location);
! errorMessage.saveChanges();
}
catch (SOAPException e) {
--- 2608,2615 ----
logger.debug("=> MessageServiceHandler.generateErrorMessage");
! EbxmlMessage errorMessage = null;
try {
! errorMessage = SignalMessageGenerator.generateErrorMessage(
! ebxmlMessage, errorCode, severity, description, location);
}
catch (SOAPException e) {
***************
*** 2760,2769 ****
logger.debug("=> MessageServiceHandler.generatePongMessage");
! final EbxmlMessage pongMessage =
! generateResponseMessage(pingMessage, ACTION_PONG);
try {
! pongMessage.getMessageHeader().
! setRefToMessageId(pingMessage.getMessageId());
! pongMessage.saveChanges();
}
catch (SOAPException e) {
--- 2644,2651 ----
logger.debug("=> MessageServiceHandler.generatePongMessage");
! EbxmlMessage pongMessage = null;
try {
! pongMessage = SignalMessageGenerator.generatePongMessage(
! pingMessage);
}
catch (SOAPException e) {
***************
*** 4464,4471 ****
final String service = ebxmlMessage.getService();
final String action = ebxmlMessage.getAction();
! final boolean isPing = service.equals(SERVICE) &&
! action.equals(ACTION_PING);
! final boolean isPong = service.equals(SERVICE) &&
! action.equals(ACTION_PONG);
final boolean isError = (ebxmlMessage.getErrorList() != null);
--- 4346,4353 ----
final String service = ebxmlMessage.getService();
final String action = ebxmlMessage.getAction();
! final boolean isPing = service.equals(Constants.SERVICE) &&
! action.equals(Constants.ACTION_PING);
! final boolean isPong = service.equals(Constants.SERVICE) &&
! action.equals(Constants.ACTION_PONG);
final boolean isError = (ebxmlMessage.getErrorList() != null);
|