Author: asankaa Date: Tue Dec 23 01:48:18 2008 New Revision: 27749 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=27749
Log: fixing CARBON-643 Modified: branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/eventing/EventSourceFactory.java branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java Modified: branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/eventing/EventSourceFactory.java URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/eventing/EventSourceFactory.java?rev=27749&r1=27748&r2=27749&view=diff ============================================================================== --- branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/eventing/EventSourceFactory.java (original) +++ branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/eventing/EventSourceFactory.java Tue Dec 23 01:48:18 2008 @@ -185,7 +185,11 @@ OMElement elmExpires = elmSubscription.getFirstChildWithName(EXPIRES_QNAME); if(elmExpires!=null){ try{ - synapseSubscription.setExpires(ConverterUtil.convertToDateTime(elmExpires.getText())); + if(elmExpires.getText().startsWith("P")){ + synapseSubscription.setExpires(ConverterUtil.convertToDuration(elmExpires.getText()).getAsCalendar()); + }else{ + synapseSubscription.setExpires(ConverterUtil.convertToDateTime(elmExpires.getText())); + } }catch(Exception e){ handleException("Error in creating static subscription. invalid date format",e); } Modified: branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java?rev=27749&r1=27748&r2=27749&view=diff ============================================================================== --- branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java (original) +++ branches/synapse/1.2.wso2v1/modules/core/src/main/java/org/apache/synapse/eventing/builders/SubscriptionMessageBuilder.java Tue Dec 23 01:48:18 2008 @@ -168,7 +168,11 @@ if (expiryElem != null) { Calendar calendarExpires = null; try { - calendarExpires = ConverterUtil.convertToDateTime(expiryElem.getText()); + if(expiryElem.getText().startsWith("P")){ + calendarExpires = ConverterUtil.convertToDuration(expiryElem.getText()).getAsCalendar(); + }else{ + calendarExpires = ConverterUtil.convertToDateTime(expiryElem.getText()); + } } catch (Exception e) { log.error("Error converting the expiration date ," + e.toString()); setExpirationFault(subscription); @@ -273,7 +277,11 @@ if (expiryElem != null) { Calendar calendarExpires=null; try{ - calendarExpires = ConverterUtil.convertToDateTime(expiryElem.getText()); + if(expiryElem.getText().startsWith("P")){ + calendarExpires = ConverterUtil.convertToDuration(expiryElem.getText()).getAsCalendar(); + }else{ + calendarExpires = ConverterUtil.convertToDateTime(expiryElem.getText()); + } }catch(Exception e){ setExpirationFault(subscription); } _______________________________________________ Esb-java-dev mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
