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


Java NotEmpty类代码示例

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


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

示例1: lookupIdentifier

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
/**
 * Get list of information matching a given identifier.
 * 
 * @param identifier identifier to lookup
 * @return a list of information
 * @throws ResolverException if an error occurs
 */
@Nonnull @NonnullElements protected List<Value> lookupIdentifier(
        @Nonnull @NotEmpty final Key identifier)
        throws ResolverException {
    if (!isInitialized()) {
        throw new ResolverException("Metadata resolver has not been initialized");
    }

    if (identifier == null || Strings.isNullOrEmpty(identifier.getValue())) {
        log.debug("Identifier was null or empty, skipping search for it");
        return Collections.emptyList();
    }

    List<Value> allInformation = lookupIndexedIdentifier(identifier);
    if (allInformation.isEmpty()) {
        log.debug("Backing store does not contain any information with the ID: {}", identifier);
        return allInformation;
    }
    return allInformation;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:27,代码来源:AbstractOIDCEntityResolver.java

示例2: create

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的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

示例3: getName

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@Nonnull
@NotEmpty
public String getName() {
    return authnContextClassReference;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:8,代码来源:AuthenticationContextClassReferencePrincipal.java

示例4: lookupIndexedIdentifier

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
/**
 * Lookup the specified identifier from the index. The returned list will be a copy of what is stored in the 
 * backing index, and is safe to be manipulated by callers.
 * 
 * @param identifier the identifier to lookup
 * 
 * @return list copy of indexed identifiers, may be empty, will never be null
 */
@Nonnull @NonnullElements protected List<Value> lookupIndexedIdentifier(
        @Nonnull @NotEmpty final Key identifier) {
    List<Value> allInformation = getBackingStore().getIndexedInformation().get(identifier);
    if (allInformation != null) {
        return new ArrayList<>(allInformation);
    } else {
        return Collections.emptyList();
    }
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:18,代码来源:AbstractOIDCEntityResolver.java

示例5: OIDCCoreProtocolConfiguration

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
/**
 * Creates a new configuration instance.
 *
 * @param profileId Unique profile identifier.
 */
public OIDCCoreProtocolConfiguration(@Nonnull @NotEmpty final String profileId) {
    super(profileId);
    authenticationFlows = Collections.emptySet();
    postAuthenticationFlows = Collections.emptyList();
    defaultAuthenticationContexts = Collections.emptyList();
    nameIDFormatPrecedence = Collections.emptyList();
    signIDTokensPredicate = Predicates.alwaysTrue();
    pairwiseSubject = Predicates.alwaysFalse();
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:15,代码来源:OIDCCoreProtocolConfiguration.java

示例6: updateContextExpiration

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
public void updateContextExpiration(@Nonnull @NotEmpty String context, @Nullable Long expiration) throws IOException {
    for (Object key : this.getContextKeySet(context)) {
        this.updateExpiration(((CompositeKey) key).getContext(), ((CompositeKey) key).getKey(), expiration);
    }

}
 
开发者ID:UniconLabs,项目名称:shibboleth-hazelcast-storage-service,代码行数:8,代码来源:SingleHazelcastMapBackedStorageService.java

示例7: deleteContext

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
public void deleteContext(@Nonnull @NotEmpty String context) throws IOException {
    IMap backingMap = this.getMap(context, null);
    Set keySet = this.getContextKeySet(context);
    for (Object o : keySet) {
        backingMap.delete(o);
    }
}
 
开发者ID:UniconLabs,项目名称:shibboleth-hazelcast-storage-service,代码行数:9,代码来源:SingleHazelcastMapBackedStorageService.java

示例8: updateWithVersion

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的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

示例9: deserialize

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
@Nonnull
public T deserialize(
        final long version,
        @Nonnull @NotEmpty final String context,
        @Nonnull @NotEmpty final String key,
        @Nonnull @NotEmpty final String value,
        @Nullable final Long expiration) throws IOException {
    return createTicket(key, SPLIT_PATTERN.split(value));
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:11,代码来源:AbstractTicketSerializer.java

示例10: extractFields

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
@NotEmpty
protected String[] extractFields(@Nonnull final ProxyGrantingTicket ticket) {
    final ArrayList<String> fields = new ArrayList<String>(4);
    fields.add(ticket.getSessionId());
    fields.add(ticket.getService());
    fields.add(String.valueOf(ticket.getExpirationInstant().getMillis()));
    if (ticket.getParentId() != null) {
        fields.add(ticket.getParentId());
    }
    return fields.toArray(new String[fields.size()]);
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:13,代码来源:ProxyGrantingTicketSerializer.java

示例11: createTicket

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
@Nonnull
protected ProxyGrantingTicket createTicket(@Nonnull final String id, @NotEmpty final String[] fields) {
    if (fields.length < 3) {
        throw new IllegalArgumentException("Expected at least 3 fields but got " + fields.length);
    }
    return new ProxyGrantingTicket(
            id,
            fields[0],
            fields[1],
            new Instant(Long.valueOf(fields[2])),
            fields.length > 3 ? fields[3] : null);
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:14,代码来源:ProxyGrantingTicketSerializer.java

示例12: extractFields

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
@NotEmpty
protected String[] extractFields(@Nonnull final ProxyTicket ticket) {
    return new String[] {
            ticket.getSessionId(),
            ticket.getService(),
            String.valueOf(ticket.getExpirationInstant().getMillis()),
            ticket.getPgtId(),
    };
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:11,代码来源:ProxyTicketSerializer.java

示例13: createTicket

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
@Nonnull
protected ProxyTicket createTicket(@Nonnull final String id, @NotEmpty final String[] fields) {
    if (fields.length != 4) {
        throw new IllegalArgumentException("Expected 4 fields but got " + fields.length);
    }
    return new ProxyTicket(
            id,
            fields[0],
            fields[1],
            new Instant(Long.valueOf(fields[2])),
            fields[3]);
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:14,代码来源:ProxyTicketSerializer.java

示例14: extractFields

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
@NotEmpty
protected String[] extractFields(@Nonnull final ServiceTicket ticket) {
    return new String[] {
            ticket.getSessionId(),
            ticket.getService(),
            String.valueOf(ticket.getExpirationInstant().getMillis()),
            String.valueOf(ticket.isRenew()),
    };
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:11,代码来源:ServiceTicketSerializer.java

示例15: createTicket

import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty; //导入依赖的package包/类
@Override
@Nonnull
protected ServiceTicket createTicket(@Nonnull final String id, @NotEmpty final String[] fields) {
    if (fields.length != 4) {
        throw new IllegalArgumentException("Expected 4 fields but got " + fields.length);
    }
    return new ServiceTicket(
            id, fields[0], fields[1], new Instant(Long.valueOf(fields[2])), Boolean.parseBoolean(fields[3]));
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:10,代码来源:ServiceTicketSerializer.java


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