/** * Convert to {@link XMLGregorianCalendar} type * and also to avoid to duplicate piece of code * * @param time The {@link Date} Object to convert to a {@link XMLGregorianCalendar} object * @param logger The logger to use to log possible {@link DatatypeConfigurationException} * @return the corresponding {@link XMLGregorianCalendar} object. */ public static XMLGregorianCalendar toXMLGregorianCalendar(Date time, Logger logger) { GregorianCalendar timeAsCalendar = new GregorianCalendar(); timeAsCalendar.setTime(time); return WsrfbfUtils.toXMLGregorianCalendar(timeAsCalendar, logger); }
@Override public final Document writeGetCurrentMessageResponseAsDOM( GetCurrentMessageResponse value) throws WsnbException { Document result = null; try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.GetCurrentMessageResponse> element = new JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.GetCurrentMessageResponse>(WsnbConstants.GET_CURRENT_MESSAGE_RESPONSE_QNAME, com.ebmwebsourcing.wsstar.jaxb.notification.base.GetCurrentMessageResponse.class,((GetCurrentMessageResponseImpl)value).getJaxbTypeObj()); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } return result; }
@Override public final Document writeSubscribeResponseAsDOM(SubscribeResponse value) throws WsnbException { Document result = null; try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.SubscribeResponse> element = new JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.SubscribeResponse>(WsnbConstants.SUBSCRIBE_RESPONSE_QNAME, com.ebmwebsourcing.wsstar.jaxb.notification.base.SubscribeResponse.class, SubscribeResponseImpl.toJaxbModel(value)); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } return result; }
@Override public final void setNewTerminationTime(Date value) { this.jaxbTypeObj.setNewTerminationTime(WsrfbfUtils.toXMLGregorianCalendar(value, SetTerminationTimeResponseImpl.logger)); }
@Override public final Document writeUseRawAsDOM(UseRaw value) throws WsnbException { Document result = null; if (value instanceof UseRawImpl){ try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.UseRaw> element = new JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.UseRaw>(WsnbConstants.USERAW_QNAME, com.ebmwebsourcing.wsstar.jaxb.notification.base.UseRaw.class,((UseRawImpl)value).getJaxbTypeObj()); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } } return result; }
@Override public final void setValue(Date value) { this.jaxbTypeObj.setValue(WsrfbfUtils.toXMLGregorianCalendar(value, TerminationTimeImpl.logger)); }
@Override public final Document writeUnsubscribeAsDOM(Unsubscribe value) throws WsnbException { Document result = null; if (value instanceof UnsubscribeImpl){ try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.Unsubscribe> element = new JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.Unsubscribe>(WsnbConstants.UNSUBSCRIBE_QNAME, com.ebmwebsourcing.wsstar.jaxb.notification.base.Unsubscribe.class,((UnsubscribeImpl)value).getJaxbTypeObj()); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } } return result; }
/** * Convert {@link JaxbElement<XMLGregorianCalendar>} type in order to avoid to duplicate piece of code * * @param time The {@link GregorianCalendar} Object to convert to a {@link XMLGregorianCalendar} object * @return the corresponding {@link XMLGregorianCalendar} object. */ private static JAXBElement<XMLGregorianCalendar> toXMLGregorianCalendarJaxbElt(Date time) { XMLGregorianCalendar xmlTime = WsrfbfUtils.toXMLGregorianCalendar(time, SetTerminationTimeImpl.logger); return WsrfrlJAXBContext.WSRFRL_JAXB_FACTORY.createSetTerminationTimeRequestedTerminationTime(xmlTime); } }
@Override public final Document writeUnsubscribeResponseAsDOM(UnsubscribeResponse value) throws WsnbException { Document result = null; if (value instanceof UnsubscribeResponseImpl){ try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.UnsubscribeResponse> element = new JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.UnsubscribeResponse>(WsnbConstants.UNSUBSCRIBE_RESPONSE_QNAME, com.ebmwebsourcing.wsstar.jaxb.notification.base.UnsubscribeResponse.class,((UnsubscribeResponseImpl)value).getJaxbTypeObj()); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } } return result; }
@Override public final void setTimestamp(Date value) { this.jaxbTypeObj.setTimestamp(WsrfbfUtils.toXMLGregorianCalendar(value,this.logger)); }
@Override public final Document writeDestroyAsDOM(Destroy value) throws WsrfrlException { Document result = null; if (value instanceof DestroyImpl){ try { Marshaller marshaller = this.resourceLifetimeJaxbContext.createWSResourceLifetimeMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.resource.resourcelifetime.Destroy> element = new JAXBElement<com.ebmwebsourcing.wsstar.jaxb.resource.resourcelifetime.Destroy>(WsrfrlConstants.DESTROY_QNAME, com.ebmwebsourcing.wsstar.jaxb.resource.resourcelifetime.Destroy.class, ((DestroyImpl)value).getJaxbTypeObj()); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsrfrlException(WsrfbfUtils.getBindingExMessage(value), ex); } } return result; }
@Override public final void setTerminationTime(Date value) { this.jaxbTypeObj.setTerminationTime(WsrfbfUtils.toXMLGregorianCalendar(value, RenewResponseImpl.logger)); }
@Override public final Document writeRenewAsDOM(Renew value) throws WsnbException { Document result = null; if (value instanceof RenewImpl){ try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.Renew> element = new JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.Renew>(WsnbConstants.RENEW_QNAME, com.ebmwebsourcing.wsstar.jaxb.notification.base.Renew.class,((RenewImpl)value).getJaxbTypeObj()); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } } return result; }
@Override public final void setCurrentTime(Date value) { this.jaxbTypeObj.setCurrentTime(WsrfbfUtils.toXMLGregorianCalendar(value, RenewResponseImpl.logger)); }
@Override public final Document writeSubscriptionPolicyTypeAsDOM( SubscriptionPolicyType value) throws WsnbException { Document result = null; try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.SubscriptionPolicyType> element = WsnbJAXBContext.WSNB_JAXB_FACTORY.createSubscriptionPolicy(SubscriptionPolicyTypeImpl.toJaxbModel(value)); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } return result; }
@Override public final void setCreationTime(Date value) { this.jaxbTypeObj.setCreationTime(WsrfbfUtils.toXMLGregorianCalendar(value, SubscriptionManagerRPImpl.logger)); }
@Override public final Document writeProducerPropertiesExpressionAsDOM(ProducerPropertiesExpression value) throws WsnbException { Document result = null; try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.QueryExpressionType> element = WsnbJAXBContext.WSNB_JAXB_FACTORY.createProducerProperties(ProducerPropertiesExpressionImpl.toJaxbModel(value)); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } return result; }
@Override public final void setTerminationTime(Date termTime) { this.jaxbTypeObj.setTerminationTime(WsrfbfUtils.toXMLGregorianCalendar(termTime, SubscribeResponseImpl.logger)); }
@Override public final Document writeMessageContentExpressionAsDOM(MessageContentExpression value) throws WsnbException { Document result = null; try { Marshaller marshaller = this.wsnbJaxbContext.createWSNotificationMarshaller(); result = WsstarCommonUtils.getNamespaceDocumentBuilder().newDocument(); // TODO : Check if it is a Thread safe method final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.QueryExpressionType> element = WsnbJAXBContext.WSNB_JAXB_FACTORY.createMessageContent(MessageContentExpressionImpl.toJaxbModel(value)); marshaller.marshal(element, result); } catch (final JAXBException ex) { throw new WsnbException(WsrfbfUtils.getBindingExMessage(value), ex); } return result; }
@Override public final void setCurrentTime(Date value) { this.jaxbTypeObj.setCurrentTime(WsrfbfUtils.toXMLGregorianCalendar(value, SubscribeResponseImpl.logger)); }