当前位置: 首页>>代码示例>>Java>>正文


Java Conditions.setNotBefore方法代码示例

本文整理汇总了Java中org.opensaml.saml.saml2.core.Conditions.setNotBefore方法的典型用法代码示例。如果您正苦于以下问题:Java Conditions.setNotBefore方法的具体用法?Java Conditions.setNotBefore怎么用?Java Conditions.setNotBefore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opensaml.saml.saml2.core.Conditions的用法示例。


在下文中一共展示了Conditions.setNotBefore方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newConditions

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
/**
 * New conditions element.
 *
 * @param notBefore the not before
 * @param notOnOrAfter the not on or after
 * @param audienceUri the service id
 * @return the conditions
 */
public Conditions newConditions(final DateTime notBefore, final DateTime notOnOrAfter, final String audienceUri) {
    final Conditions conditions = newSamlObject(Conditions.class);
    conditions.setNotBefore(notBefore);
    conditions.setNotOnOrAfter(notOnOrAfter);

    final AudienceRestriction audienceRestriction = newSamlObject(AudienceRestriction.class);
    final Audience audience = newSamlObject(Audience.class);
    audience.setAudienceURI(audienceUri);
    audienceRestriction.getAudiences().add(audience);
    conditions.getAudienceRestrictions().add(audienceRestriction);
    return conditions;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:AbstractSaml20ObjectBuilder.java

示例2: newConditions

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
/**
 * New conditions element.
 *
 * @param notBefore    the not before
 * @param notOnOrAfter the not on or after
 * @param audienceUri  the service id
 * @return the conditions
 */
public Conditions newConditions(final ZonedDateTime notBefore, final ZonedDateTime notOnOrAfter, final String audienceUri) {
    LOGGER.debug("Building conditions for audience [{}] that enforce not-before [{}] and not-after [{}]", audienceUri, notBefore, notOnOrAfter);
    final Conditions conditions = newSamlObject(Conditions.class);
    conditions.setNotBefore(DateTimeUtils.dateTimeOf(notBefore));
    conditions.setNotOnOrAfter(DateTimeUtils.dateTimeOf(notOnOrAfter));

    final AudienceRestriction audienceRestriction = newSamlObject(AudienceRestriction.class);
    final Audience audience = newSamlObject(Audience.class);
    audience.setAudienceURI(audienceUri);
    audienceRestriction.getAudiences().add(audience);
    conditions.getAudienceRestrictions().add(audienceRestriction);
    return conditions;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:22,代码来源:AbstractSaml20ObjectBuilder.java

示例3: aConditions

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
private static Conditions aConditions() {
    Conditions conditions = new ConditionsBuilder().buildObject();
    conditions.setNotBefore(DateTime.now());
    conditions.setNotOnOrAfter(DateTime.now().plusMinutes(10));
    AudienceRestriction audienceRestriction= new AudienceRestrictionBuilder().buildObject();
    Audience audience = new AudienceBuilder().buildObject();
    audience.setAudienceURI(HUB_SECONDARY_ENTITY_ID);
    audienceRestriction.getAudiences().add(audience);
    conditions.getAudienceRestrictions().add(audienceRestriction);
    return conditions;
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:12,代码来源:AssertionHelper.java

示例4: aConditions

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
private static Conditions aConditions() {
    Conditions conditions = new ConditionsBuilder().buildObject();
    conditions.setNotBefore(DateTime.now());
    conditions.setNotOnOrAfter(DateTime.now().plusMinutes(10));
    AudienceRestriction audienceRestriction = new AudienceRestrictionBuilder().buildObject();
    Audience audience = new AudienceBuilder().buildObject();
    audience.setAudienceURI(HUB_SECONDARY_ENTITY_ID);
    audienceRestriction.getAudiences().add(audience);
    conditions.getAudienceRestrictions().add(audienceRestriction);
    return conditions;
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:12,代码来源:CountryEnabledIntegrationTest.java

示例5: shouldReturnErrorIfNotBeforeIsNotMet

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
@Test
public void shouldReturnErrorIfNotBeforeIsNotMet() {
    Conditions conditions = new ConditionsBuilder().buildObject();
    conditions.setNotBefore(NOW.plusMillis(1));

    Messages messages = validator.validate(conditions, messages());

    assertThat(messages.size()).isEqualTo(1);
    assertThat(messages.hasErrorLike(DEFAULT_CURRENT_TIME_BEFORE_VALID_TIME_MESSAGE)).isTrue();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:11,代码来源:ConditionsValidatorTest.java

示例6: shouldReturnErrorIfNotOnOrAfterIsNotFoundInConditions

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
@Test
public void shouldReturnErrorIfNotOnOrAfterIsNotFoundInConditions() {
    Conditions conditions = new ConditionsBuilder().buildObject();
    conditions.setNotBefore(NOW);
    conditions.getAudienceRestrictions().add(audienceRestriction);

    Messages messages = validator.validate(conditions, messages());

    assertThat(messages.size()).isEqualTo(0);
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:11,代码来源:ConditionsValidatorTest.java

示例7: shouldReturnErrorIfNotBeforeIsSameAsNotOnOrAfter

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
@Test
public void shouldReturnErrorIfNotBeforeIsSameAsNotOnOrAfter() {
    Conditions conditions = new ConditionsBuilder().buildObject();
    conditions.setNotBefore(NOW);
    conditions.setNotOnOrAfter(NOW);

    Messages messages = validator.validate(conditions, messages());

    assertThat(messages.size()).isEqualTo(1);
    assertThat(messages.hasErrorLike(DEFAULT_NOT_BEFORE_MUST_BE_LESS_THAN_NOT_ON_OR_AFTER_TIME_MESSAGE)).isTrue();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:12,代码来源:ConditionsValidatorTest.java

示例8: shouldReturnErrorIfAudienceRestrictionIsNotFoundInConditions

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
@Test
public void shouldReturnErrorIfAudienceRestrictionIsNotFoundInConditions() {
    Conditions conditions = new ConditionsBuilder().buildObject();
    conditions.setNotBefore(NOW);
    conditions.setNotOnOrAfter(NOW.plusMillis(1));

    Messages messages = validator.validate(conditions, messages());

    assertThat(messages.size()).isEqualTo(1);
    assertThat(messages.hasErrorLike(DEFAULT_CONDITIONS_MUST_CONTAIN_ONE_AUDIENCE_RESTRICTION_MESSAGE)).isTrue();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:12,代码来源:ConditionsValidatorTest.java

示例9: shouldValidateConditionsSuccessfully

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
@Test
public void shouldValidateConditionsSuccessfully() {
    Conditions conditions = new ConditionsBuilder().buildObject();
    conditions.setNotBefore(NOW);
    conditions.setNotOnOrAfter(NOW.plusMillis(1));
    conditions.getAudienceRestrictions().add(audienceRestriction);

    Messages messages = validator.validate(conditions, messages());

    assertThat(messages.size()).isEqualTo(0);
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:12,代码来源:ConditionsValidatorTest.java

示例10: aConditions

import org.opensaml.saml.saml2.core.Conditions; //导入方法依赖的package包/类
private Conditions aConditions() {
    Conditions conditions = new ConditionsBuilder().buildObject();
    conditions.setNotBefore(DateTime.now());
    conditions.setNotOnOrAfter(DateTime.now().plusMinutes(10));
    AudienceRestriction audienceRestriction= new AudienceRestrictionBuilder().buildObject();
    Audience audience = new AudienceBuilder().buildObject();
    audience.setAudienceURI(HUB_CONNECTOR_ENTITY_ID);
    audienceRestriction.getAudiences().add(audience);
    conditions.getAudienceRestrictions().add(audienceRestriction);
    return conditions;
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:12,代码来源:EidasAttributeQueryValidatorTest.java


注:本文中的org.opensaml.saml.saml2.core.Conditions.setNotBefore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。