本文整理汇总了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);
}
}
示例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");
}
示例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;
}
示例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;
示例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");
}
示例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");
}
示例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.");
}