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


Java Positive类代码示例

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


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

示例1: create

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean create(@Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull String value, @Nullable @Positive Long expiration) throws IOException {
    IMap<Object, StorageRecord> backingMap = getMap(context, key);
    Object ikey = getKey(context, key);
    if (backingMap.containsKey(ikey)) {
        return false;
    }
    StorageRecord storageRecord = new MutableStorageRecord(value, expiration);
    if (expiration != null) {
        backingMap.put(ikey, storageRecord, getSystemExpiration(expiration), TimeUnit.MILLISECONDS);
    } else {
        backingMap.put(ikey, storageRecord);
    }
    return true;
}
 
开发者ID:UniconLabs,项目名称:shibboleth-hazelcast-storage-service,代码行数:19,代码来源:AbstractHazelcastMapBackedStorageService.java

示例2: setMinRefreshDelay

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * Sets the minimum amount of time, in milliseconds, between refreshes.
 * 
 * @param delay minimum amount of time, in milliseconds, between refreshes
 */
@Duration public void setMinRefreshDelay(@Duration @Positive final long delay) {
    ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
    ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);

    if (delay < 0) {
        throw new IllegalArgumentException("Minimum refresh delay must be greater than 0");
    }
    minRefreshDelay = delay;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:15,代码来源:AbstractReloadingOIDCEntityResolver.java

示例3: setMaxRefreshDelay

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * Sets the maximum amount of time, in milliseconds, between refresh intervals.
 * 
 * @param delay maximum amount of time, in milliseconds, between refresh intervals
 */
@Duration public void setMaxRefreshDelay(@Duration @Positive final long delay) {
    ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
    ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
    
    if (delay < 0) {
        throw new IllegalArgumentException("Maximum refresh delay must be greater than 0");
    }
    maxRefreshDelay = delay;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:15,代码来源:AbstractReloadingOIDCEntityResolver.java

示例4: updateWithVersion

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Nullable
@Override
public Long updateWithVersion(@Positive long version, @Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull String value, @Nullable @Positive Long expiration) throws IOException, VersionMismatchException {
    try {
        return doUpdate(version, context, key, value, expiration);
    } catch (VersionMismatchWrapperException e) {
        throw (VersionMismatchException)e.getCause();
    }
}
 
开发者ID:UniconLabs,项目名称:shibboleth-hazelcast-storage-service,代码行数:13,代码来源:AbstractHazelcastMapBackedStorageService.java

示例5: TicketIdentifierGenerationStrategy

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * Creates a new ticket ID generator.
 *
 * @param randomLength Length in characters of random part of the ticket.
 * @param prefix Ticket ID prefix (e.g. ST, PT, PGT). MUST be a URL safe string.
 */
public TicketIdentifierGenerationStrategy(
        @Positive final int randomLength,
        @Nonnull @NotEmpty final String prefix) {
    if (randomLength < 1) {
        throw new IllegalArgumentException("Length of random part of ticket must be positive");
    }
    this.randomPartGenerator = new RandomIdGenerator(randomLength);
    this.prefix = Constraint.isNotNull(StringSupport.trimOrNull(prefix), "Prefix cannot be null or empty");
    if (!isUrlSafe(this.prefix)) {
        throw new IllegalArgumentException("Unsupported prefix " + this.prefix);
    }
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:19,代码来源:TicketIdentifierGenerationStrategy.java

示例6: CASSPSession

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * Creates a new CAS SP session.
 *
 * @param id         the identifier of the service associated with this session
 * @param creation   creation time of session, in milliseconds since the epoch
 * @param expiration expiration time of session, in milliseconds since the epoch
 * @param ticketId   ticket ID used to gain access to the service
 */
public CASSPSession(
        @Nonnull @NotEmpty String id,
        @Duration @Positive long creation,
        @Duration @Positive long expiration,
        @Nonnull @NotEmpty String ticketId) {
    super(id, creation, expiration);
    this.ticketId = Constraint.isNotNull(StringSupport.trimOrNull(ticketId), "Ticket ID cannot be null or empty");
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:17,代码来源:CASSPSession.java

示例7: read

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Nonnull
@Override
public Pair<Long, StorageRecord> read(@Nonnull @NotEmpty final String context, @Nonnull @NotEmpty final String key, @Positive final long version) throws IOException {
    return doRead(context, key, version);
}
 
开发者ID:UniconLabs,项目名称:shibboleth-hazelcast-storage-service,代码行数:9,代码来源:AbstractHazelcastMapBackedStorageService.java

示例8: update

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean update(@Nonnull @NotEmpty final String context, @Nonnull @NotEmpty final String key, @Nonnull @NotEmpty final String value, @Nullable @Positive final Long expiration) throws IOException {
    return doUpdate(null, context, key, value, expiration) != null;
}
 
开发者ID:UniconLabs,项目名称:shibboleth-hazelcast-storage-service,代码行数:8,代码来源:AbstractHazelcastMapBackedStorageService.java

示例9: getTicketValidityPeriod

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * @return Ticket validity period in milliseconds.
 */
@Positive
public long getTicketValidityPeriod() {
    return ticketValidityPeriod;
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:8,代码来源:AbstractTicketConfiguration.java

示例10: storeClientInformation

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * Store a {@link ClientInformation} object.
 * 
 * @param clientInformation The client information to be stored.
 * @param expiration The expiration for record, or null.
 * @throws ClientInformationManagerException If the client information cannot be stored.
 */
@Nonnull void storeClientInformation(@Nonnull final OIDCClientInformation clientInformation, 
        @Nullable @Positive final Long expiration) throws ClientInformationManagerException;
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:10,代码来源:ClientInformationManager.java

示例11: UpdateIdPSessionWithSPSessionAction

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * Creates a new instance with given parameters.
 *
 * @param lifetime lifetime in milliseconds, determines upper bound for expiration of the
 * {@link CASSPSession} to be created
 */
public UpdateIdPSessionWithSPSessionAction(@Positive @Duration final long lifetime) {
    sessionLifetime = Constraint.isGreaterThan(0, lifetime, "Lifetime must be greater than 0");
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:10,代码来源:UpdateIdPSessionWithSPSessionAction.java

示例12: setTimeout

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * Sets connect and socket timeouts for HTTP connection to proxy callback endpoint.
 *
 * @param timeout Non-zero timeout in milliseconds for both connection and socket timeouts.
 */
public void setTimeout(@Positive final int timeout) {
    this.timeout = (int) Constraint.isGreaterThan(timeout, 0, "Timeout must be positive");
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:9,代码来源:PkixProxyAuthenticator.java

示例13: setTicketValidityPeriod

import net.shibboleth.utilities.java.support.annotation.constraint.Positive; //导入依赖的package包/类
/**
 * Sets the ticket validity period.
 *
 * @param millis Ticket validity period in milliseconds.
 */
public void setTicketValidityPeriod(@Duration @Positive final long millis) {
    this.ticketValidityPeriod = Constraint.isGreaterThan(0, millis, "Ticket validity period must be positive.");
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:9,代码来源:AbstractTicketConfiguration.java


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