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


Java SAML2Helper类代码示例

本文整理汇总了Java中org.opensaml.saml2.common.SAML2Helper的典型用法代码示例。如果您正苦于以下问题:Java SAML2Helper类的具体用法?Java SAML2Helper怎么用?Java SAML2Helper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: processCachedMetadata

import org.opensaml.saml2.common.SAML2Helper; //导入依赖的package包/类
/**
 * Processes a cached metadata document in order to determine, and schedule, the next time it should be refreshed.
 * 
 * @param metadataIdentifier identifier of the metadata source
 * @param refreshStart when the current refresh cycle started
 * 
 * @throws MetadataProviderException throw is there is a problem process the cached metadata
 */
protected void processCachedMetadata(String metadataIdentifier, DateTime refreshStart)
        throws MetadataProviderException {
    log.debug("Computing new expiration time for cached metadata from '{}", metadataIdentifier);
    DateTime metadataExpirationTime =
            SAML2Helper
                    .getEarliestExpiration(cachedMetadata, refreshStart.plus(getMaxRefreshDelay()), refreshStart);

    expirationTime = metadataExpirationTime;
    long nextRefreshDelay = computeNextRefreshDelay(expirationTime);
    nextRefresh = new DateTime(ISOChronology.getInstanceUTC()).plus(nextRefreshDelay);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:AbstractReloadingMetadataProvider.java

示例2: isValid

import org.opensaml.saml2.common.SAML2Helper; //导入依赖的package包/类
/**
 * Returns whether the given descriptor is valid. If valid metadata is not required this method always returns true.
 * 
 * @param descriptor the descriptor to check
 * 
 * @return true if valid metadata is not required or the given descriptor is valid, false otherwise
 */
protected boolean isValid(XMLObject descriptor) {
    if (descriptor == null) {
        return false;
    }

    if (!requireValidMetadata()) {
        return true;
    }

    return SAML2Helper.isValid(descriptor);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AbstractMetadataProvider.java

示例3: isValid

import org.opensaml.saml2.common.SAML2Helper; //导入依赖的package包/类
/**
 * Returns whether the given descriptor is valid. If valid metadata is not required this method always returns true.
 * 
 * @param descriptor the descriptor to check
 * 
 * @return true if valid metadata is not required or the given descriptor is valid, false otherwise
 */
protected boolean isValid(XMLObject descriptor) {
    if (!requireValidMetadata()) {
        return true;
    }

    return SAML2Helper.isValid(descriptor);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:15,代码来源:AbstractMetadataProvider.java

示例4: processNonExpiredMetadata

import org.opensaml.saml2.common.SAML2Helper; //导入依赖的package包/类
/**
 * Processes metadata that has been determined to be valid at the time it was fetched. A metadata document is
 * considered be valid if its root element returns true when passed to the {@link #isValid(XMLObject)} method.
 * 
 * @param metadataIdentifier identifier of the metadata source
 * @param refreshStart when the current refresh cycle started
 * @param metadataBytes raw bytes of the new metadata document
 * @param metadata new metadata document unmarshalled
 * 
 * @throws MetadataProviderException thrown if there s a problem processing the metadata
 */
protected void processNonExpiredMetadata(String metadataIdentifier, DateTime refreshStart, byte[] metadataBytes,
        XMLObject metadata) throws MetadataProviderException {
    Document metadataDom = metadata.getDOM().getOwnerDocument();

    log.debug("Filtering metadata from '{}'", metadataIdentifier);
    try {
        filterMetadata(metadata);
    } catch (FilterException e) {
        String errMsg = "Error filtering metadata from " + metadataIdentifier;
        log.error(errMsg, e);
        throw new MetadataProviderException(errMsg, e);
    }

    log.debug("Releasing cached DOM for metadata from '{}'", metadataIdentifier);
    releaseMetadataDOM(metadata);

    log.debug("Post-processing metadata from '{}'", metadataIdentifier);
    postProcessMetadata(metadataBytes, metadataDom, metadata);

    log.debug("Computing expiration time for metadata from '{}'", metadataIdentifier);
    DateTime metadataExpirationTime =
            SAML2Helper.getEarliestExpiration(metadata, refreshStart.plus(getMaxRefreshDelay()), refreshStart);
    log.debug("Expiration of metadata from '{}' will occur at {}", metadataIdentifier,
            metadataExpirationTime.toString());

    cachedMetadata = metadata;
    lastUpdate = refreshStart;

    long nextRefreshDelay;
    if (metadataExpirationTime.isBeforeNow()) {
        expirationTime = new DateTime(ISOChronology.getInstanceUTC()).plus(getMinRefreshDelay());
        nextRefreshDelay = getMaxRefreshDelay();
    } else {
        expirationTime = metadataExpirationTime;
        nextRefreshDelay = computeNextRefreshDelay(expirationTime);
    }
    nextRefresh = new DateTime(ISOChronology.getInstanceUTC()).plus(nextRefreshDelay);

    emitChangeEvent();
    log.info("New metadata succesfully loaded for '{}'", getMetadataIdentifier());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:53,代码来源:AbstractReloadingMetadataProvider.java


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