|
From: Ladislav U. <lad...@us...> - 2006-01-04 18:21:12
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19003/hk/hku/cecid/phoenix/message/packaging Modified Files: MessageHeader.java Log Message: Set the role only if role attribure is not null The same is for TimeToLive Index: MessageHeader.java =================================================================== RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/MessageHeader.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MessageHeader.java 3 Aug 2005 04:20:16 -0000 1.16 --- MessageHeader.java 4 Jan 2006 18:20:58 -0000 1.17 *************** *** 749,771 **** } ! /** * Set Role element in the From core extension element. * ! * @param role Role name. ! * @throws SOAPException */ public void setFromRole(String role) throws SOAPException { ! if (fromRole == null) { ! if (fromPartyIds.size() > 0) { ! from.addChildElement(ELEMENT_ROLE, role); } ! fromRole = role; ! } ! else { ! throw new SOAPValidationException ! (SOAPValidationException.SOAP_FAULT_CLIENT, ! "<" + NAMESPACE_PREFIX_EB + ":" + ELEMENT_ROLE ! + "> has already been " + "set in <" + NAMESPACE_PREFIX_EB ! + ":" + ELEMENT_FROM + ">!"); } } --- 749,777 ---- } ! /** * Set Role element in the From core extension element. * ! * @param role ! * Role name. ! * @throws SOAPException */ public void setFromRole(String role) throws SOAPException { ! /** Set the role only if role attribure is not null **/ ! if (role.equals(null) == false) { ! ! if (fromRole == null) { ! if (fromPartyIds.size() > 0) { ! from.addChildElement(ELEMENT_ROLE, role); ! } ! fromRole = role; ! } else { ! throw new SOAPValidationException( ! SOAPValidationException.SOAP_FAULT_CLIENT, "<" ! + NAMESPACE_PREFIX_EB + ":" + ELEMENT_ROLE ! + "> has already been " + "set in <" ! + NAMESPACE_PREFIX_EB + ":" + ELEMENT_FROM ! + ">!"); } ! } } *************** *** 780,802 **** } ! /** * Set Role element in the To core extension element. * ! * @param role Role name. ! * @throws SOAPException */ public void setToRole(String role) throws SOAPException { ! if (toRole == null) { ! if (toPartyIds.size() > 0) { ! to.addChildElement(ELEMENT_ROLE, role); } ! toRole = role; ! } ! else { ! throw new SOAPValidationException ! (SOAPValidationException.SOAP_FAULT_CLIENT, ! "<" + NAMESPACE_PREFIX_EB + ":" + ELEMENT_ROLE ! + "> has already been " + "set in <" + NAMESPACE_PREFIX_EB + ":" ! + ELEMENT_TO + ">!"); } } --- 786,813 ---- } ! /** * Set Role element in the To core extension element. * ! * @param role ! * Role name. ! * @throws SOAPException */ public void setToRole(String role) throws SOAPException { ! /** Set the role only if role attribure is not null * */ ! if (role.equals(null) == false) { ! ! if (toRole == null) { ! if (toPartyIds.size() > 0) { ! to.addChildElement(ELEMENT_ROLE, role); ! } ! toRole = role; ! } else { ! throw new SOAPValidationException( ! SOAPValidationException.SOAP_FAULT_CLIENT, "<" ! + NAMESPACE_PREFIX_EB + ":" + ELEMENT_ROLE ! + "> has already been " + "set in <" ! + NAMESPACE_PREFIX_EB + ":" + ELEMENT_TO + ">!"); } ! } } *************** *** 814,824 **** * Set cpaId of the message header. This property can be set only once. * ! * @param cpaId Collaborative Protocol Agreement ID. * @throws SOAPException */ ! public void setCpaId(String cpaId) throws SOAPException { if (this.cpaId == null) { ! this.cpaId = cpaId; ! addChildElement(ELEMENT_CPA_ID, cpaId); if (conversationId != null) { addChildElement(ELEMENT_CONVERSATION_ID, conversationId); --- 825,835 ---- * Set cpaId of the message header. This property can be set only once. * ! * @param cpaIdAtr Collaborative Protocol Agreement ID. * @throws SOAPException */ ! public void setCpaId(String cpaIdAtr) throws SOAPException { if (this.cpaId == null) { ! this.cpaId = cpaIdAtr; ! addChildElement(ELEMENT_CPA_ID, cpaIdAtr); if (conversationId != null) { addChildElement(ELEMENT_CONVERSATION_ID, conversationId); *************** *** 1179,1202 **** /** ! * Set optional "TimeToLive" element. This property can be set only once. * ! * @param time TimeToLive expressed in UTC format. ! * @throws SOAPException */ ! public void setTimeToLive(String time) ! throws SOAPException { ! if (timeToLive == null) { ! timeToLive = time; ! if (cpaId != null && conversationId != null && service != null && ! action != null && messageId != null && timestamp != null) { ! messageData.addChildElement(ELEMENT_TIME_TO_LIVE, time); } ! } ! else { ! throw new SOAPValidationException ! (SOAPValidationException.SOAP_FAULT_CLIENT, ! "<" + NAMESPACE_PREFIX_EB + ":" + ELEMENT_TIME_TO_LIVE ! + "> has " + "already been set in <" + NAMESPACE_PREFIX_EB ! + ":" + ELEMENT_MESSAGE_DATA + ">!"); } } --- 1190,1220 ---- /** ! * Set optional "TimeToLive" element. This property can be set only once. * ! * @param time ! * TimeToLive expressed in UTC format. ! * @throws SOAPException */ ! public void setTimeToLive(String time) throws SOAPException { ! ! /** Set time only if attribute time is not null **/ ! if (time.equals(null) == false) { ! ! if (timeToLive == null) { ! timeToLive = time; ! if (cpaId != null && conversationId != null && service != null ! && action != null && messageId != null ! && timestamp != null) { ! messageData.addChildElement(ELEMENT_TIME_TO_LIVE, time); ! } ! } else { ! throw new SOAPValidationException( ! SOAPValidationException.SOAP_FAULT_CLIENT, "<" ! + NAMESPACE_PREFIX_EB + ":" ! + ELEMENT_TIME_TO_LIVE + "> has " ! + "already been set in <" + NAMESPACE_PREFIX_EB ! + ":" + ELEMENT_MESSAGE_DATA + ">!"); } ! } } |