/** * <p> * Creates an instance of {@code Lifetime} with the specified parameters. * </p> * * @param created a {@code GregorianCalendar} representing the token creation time. * @param expires a {@code GregorianCalendar} representing the token expiration time. */ public Lifetime(GregorianCalendar created, GregorianCalendar expires) { try { this.factory = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException dce) { throw new RuntimeException(ErrorCodes.PROCESSING_EXCEPTION + "Unable to get DatatypeFactory instance", dce); } // normalize the parameters (convert to UTC). this.created = factory.newXMLGregorianCalendar(created).normalize(); this.expires = factory.newXMLGregorianCalendar(expires).normalize(); // set the delegate fields. this.delegate = new LifetimeType(); AttributedDateTime dateTime = new AttributedDateTime(); dateTime.setValue(this.created.toXMLFormat()); this.delegate.setCreated(dateTime); dateTime = new AttributedDateTime(); dateTime.setValue(this.expires.toXMLFormat()); this.delegate.setExpires(dateTime); }
this.created = factory.newXMLGregorianCalendar(lifetime.getCreated().getValue()); this.expires = factory.newXMLGregorianCalendar(lifetime.getExpires().getValue()); this.delegate.getCreated().setValue(this.created.toXMLFormat()); this.delegate.getExpires().setValue(this.expires.toXMLFormat());
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Creates an instance of {@code Lifetime} with the specified parameters. * </p> * * @param created a {@code GregorianCalendar} representing the token creation time. * @param expires a {@code GregorianCalendar} representing the token expiration time. */ public Lifetime(GregorianCalendar created, GregorianCalendar expires) { try { this.factory = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException dce) { throw new RuntimeException(ErrorCodes.PROCESSING_EXCEPTION + "Unable to get DatatypeFactory instance", dce); } // normalize the parameters (convert to UTC). this.created = factory.newXMLGregorianCalendar(created).normalize(); this.expires = factory.newXMLGregorianCalendar(expires).normalize(); // set the delegate fields. this.delegate = new LifetimeType(); AttributedDateTime dateTime = new AttributedDateTime(); dateTime.setValue(this.created.toXMLFormat()); this.delegate.setCreated(dateTime); dateTime = new AttributedDateTime(); dateTime.setValue(this.expires.toXMLFormat()); this.delegate.setExpires(dateTime); }
this.created = factory.newXMLGregorianCalendar(lifetime.getCreated().getValue()); this.expires = factory.newXMLGregorianCalendar(lifetime.getExpires().getValue()); this.delegate.getCreated().setValue(this.created.toXMLFormat()); this.delegate.getExpires().setValue(this.expires.toXMLFormat());
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Creates an instance of {@code Lifetime} with the specified parameters. * </p> * * @param created a {@code GregorianCalendar} representing the token creation time. * @param expires a {@code GregorianCalendar} representing the token expiration time. */ public Lifetime(GregorianCalendar created, GregorianCalendar expires) { try { this.factory = XMLTimeUtil.newDatatypeFactory(); } catch (DatatypeConfigurationException dce) { throw logger.wsTrustUnableToGetDataTypeFactory(dce); } // normalize the parameters (convert to UTC). this.created = factory.newXMLGregorianCalendar(created).normalize(); this.expires = factory.newXMLGregorianCalendar(expires).normalize(); // set the delegate fields. this.delegate = new LifetimeType(); AttributedDateTime dateTime = new AttributedDateTime(); dateTime.setValue(this.created.toXMLFormat()); this.delegate.setCreated(dateTime); dateTime = new AttributedDateTime(); dateTime.setValue(this.expires.toXMLFormat()); this.delegate.setExpires(dateTime); }
/** * <p> * Creates a {@code Lifetime} instance using the specified {@code LifetimeType}. * </p> * * @param lifetime a reference to the {@code LifetimeType} instance that contains the information used in the * {@code Lifetime} construction. */ public Lifetime(LifetimeType lifetime) { if (lifetime == null) throw logger.nullArgumentError("LifetimeType"); try { this.factory = XMLTimeUtil.newDatatypeFactory(); } catch (DatatypeConfigurationException dce) { throw logger.wsTrustUnableToGetDataTypeFactory(dce); } this.delegate = lifetime; // construct the created and expires instances from the lifetime object. this.created = factory.newXMLGregorianCalendar(lifetime.getCreated().getValue()); this.expires = factory.newXMLGregorianCalendar(lifetime.getExpires().getValue()); // check if the supplied lifetime needs to be normalized. if (this.created.getTimezone() != 0) { this.created = this.created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); } if (this.expires.getTimezone() != 0) { this.expires = this.expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); } }
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Creates an instance of {@code Lifetime} with the specified parameters. * </p> * * @param created a {@code GregorianCalendar} representing the token creation time. * @param expires a {@code GregorianCalendar} representing the token expiration time. */ public Lifetime(GregorianCalendar created, GregorianCalendar expires) { try { this.factory = XMLTimeUtil.newDatatypeFactory(); } catch (DatatypeConfigurationException dce) { throw logger.wsTrustUnableToGetDataTypeFactory(dce); } // normalize the parameters (convert to UTC). this.created = factory.newXMLGregorianCalendar(created).normalize(); this.expires = factory.newXMLGregorianCalendar(expires).normalize(); // set the delegate fields. this.delegate = new LifetimeType(); AttributedDateTime dateTime = new AttributedDateTime(); dateTime.setValue(this.created.toXMLFormat()); this.delegate.setCreated(dateTime); dateTime = new AttributedDateTime(); dateTime.setValue(this.expires.toXMLFormat()); this.delegate.setExpires(dateTime); }
/** * <p> * Creates a {@code Lifetime} instance using the specified {@code LifetimeType}. * </p> * * @param lifetime a reference to the {@code LifetimeType} instance that contains the information used in the * {@code Lifetime} construction. */ public Lifetime(LifetimeType lifetime) { if (lifetime == null) throw logger.nullArgumentError("LifetimeType"); try { this.factory = XMLTimeUtil.newDatatypeFactory(); } catch (DatatypeConfigurationException dce) { throw logger.wsTrustUnableToGetDataTypeFactory(dce); } this.delegate = lifetime; // construct the created and expires instances from the lifetime object. this.created = factory.newXMLGregorianCalendar(lifetime.getCreated().getValue()); this.expires = factory.newXMLGregorianCalendar(lifetime.getExpires().getValue()); // check if the supplied lifetime needs to be normalized. if (this.created.getTimezone() != 0) { this.created = this.created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); } if (this.expires.getTimezone() != 0) { this.expires = this.expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); } }
/** * <p> * Sets the expiration time. * </p> * * @param expires a reference to the {@code XMLGregorianCalendar} that represents the expiration time. */ public void setExpires(XMLGregorianCalendar expires) { this.expires = expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); }
/** * <p> * Sets the creation time. * </p> * * @param created a reference to the {@code XMLGregorianCalendar} that represents the creation time to be set. */ public void setCreated(XMLGregorianCalendar created) { this.created = created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); }
/** * <p> * Creates an instance of {@code Lifetime} with the specified parameters. * </p> * * @param created a {@code GregorianCalendar} representing the token creation time. * @param expires a {@code GregorianCalendar} representing the token expiration time. */ public Lifetime(GregorianCalendar created, GregorianCalendar expires) { try { this.factory = XMLTimeUtil.newDatatypeFactory(); } catch (DatatypeConfigurationException dce) { throw logger.wsTrustUnableToGetDataTypeFactory(dce); } // normalize the parameters (convert to UTC). this.created = factory.newXMLGregorianCalendar(created).normalize(); this.expires = factory.newXMLGregorianCalendar(expires).normalize(); // set the delegate fields. this.delegate = new LifetimeType(); AttributedDateTime dateTime = new AttributedDateTime(); dateTime.setValue(this.created.toXMLFormat()); this.delegate.setCreated(dateTime); dateTime = new AttributedDateTime(); dateTime.setValue(this.expires.toXMLFormat()); this.delegate.setExpires(dateTime); }
/** * <p> * Creates a {@code Lifetime} instance using the specified {@code LifetimeType}. * </p> * * @param lifetime a reference to the {@code LifetimeType} instance that contains the information used in the * {@code Lifetime} construction. */ public Lifetime(LifetimeType lifetime) { if (lifetime == null) throw logger.nullArgumentError("LifetimeType"); try { this.factory = XMLTimeUtil.newDatatypeFactory(); } catch (DatatypeConfigurationException dce) { throw logger.wsTrustUnableToGetDataTypeFactory(dce); } this.delegate = lifetime; // construct the created and expires instances from the lifetime object. this.created = factory.newXMLGregorianCalendar(lifetime.getCreated().getValue()); this.expires = factory.newXMLGregorianCalendar(lifetime.getExpires().getValue()); // check if the supplied lifetime needs to be normalized. if (this.created.getTimezone() != 0) { this.created = this.created.normalize(); this.delegate.getCreated().setValue(this.created.toXMLFormat()); } if (this.expires.getTimezone() != 0) { this.expires = this.expires.normalize(); this.delegate.getExpires().setValue(this.expires.toXMLFormat()); } }