Example usage for java.util Collections unmodifiableCollection

List of usage examples for java.util Collections unmodifiableCollection

Introduction

In this page you can find the example usage for java.util Collections unmodifiableCollection.

Prototype

public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c) 

Source Link

Document

Returns an unmodifiable view of the specified collection.

Usage

From source file:com.vmware.identity.openidconnect.protocol.IDToken.java

public IDToken(RSAPrivateKey privateKey, TokenType tokenType, JWTID jwtId, Issuer issuer, Subject subject,
        List<String> audience, Date issueTime,

        Date expirationTime, Scope scope, String tenant, ClientID clientId, SessionID sessionId,
        RSAPublicKey holderOfKey, Subject actAs, Nonce nonce,

        Collection<String> groups, String givenName, String familyName) throws JOSEException {
    super(TOKEN_CLASS, tokenType, jwtId, issuer, subject, audience, issueTime, expirationTime, scope, tenant,
            clientId, sessionId, holderOfKey, actAs, nonce);

    Validate.notNull(privateKey, "privateKey");

    this.groups = (groups == null) ? null : Collections.unmodifiableCollection(groups);
    this.givenName = givenName;
    this.familyName = familyName;

    JWTClaimsSet.Builder claimsBuilder = super.claimsBuilder();
    if (this.groups != null) {
        claimsBuilder = claimsBuilder.claim("groups", this.groups);
    }//w  ww  .j  a v  a 2s.  c  o  m
    if (this.givenName != null) {
        claimsBuilder = claimsBuilder.claim("given_name", this.givenName);
    }
    if (this.familyName != null) {
        claimsBuilder = claimsBuilder.claim("family_name", this.familyName);
    }

    this.signedJwt = JWTUtils.signClaimsSet(claimsBuilder.build(), privateKey);
}

From source file:org.jasig.cas.services.DefaultServicesManagerImpl.java

public Collection<RegisteredService> getAllServices() {
    return Collections.unmodifiableCollection(this.services.values());
}

From source file:com.smartitengineering.cms.ws.common.providers.TextURIListProvider.java

@Override
public Collection<URI> readFrom(Class<Collection<URI>> type, Type genericType, Annotation[] annotations,
        MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
        throws IOException, WebApplicationException {
    if (isReadable(type, genericType, annotations, mediaType)) {
        List<String> asLines = IOUtils.readLines(entityStream, null);
        if (asLines == null || asLines.isEmpty()) {
            return Collections.emptyList();
        }/*from   www .j av a 2 s  .  c o m*/
        List<URI> uris = new ArrayList<URI>();
        for (String line : asLines) {
            try {
                if (logger.isDebugEnabled()) {
                    logger.debug(new StringBuilder("Trying add ").append(line).append(" as an URI").toString());
                }
                uris.add(new URI(line));
            } catch (URISyntaxException ex) {
                logger.error("URI exception while trying to form an URI", ex);
                throw new IOException(ex);
            }
        }
        return Collections.unmodifiableCollection(uris);
    } else {
        return Collections.emptyList();
    }
}

From source file:org.shredzone.cilla.ws.impl.SectionFacadeImpl.java

@Override
public Collection<String> getSectionTypes() {
    return Collections.unmodifiableCollection(typeMap.keySet());
}

From source file:com.bstek.dorado.console.performance.PerformanceMonitor.java

/**
 * dorado(?) </p>/* w  w w . j a v  a2  s.  c  o  m*/
 * 
 * @return
 */
public Collection<Process> getLastProcess() {
    return Collections.unmodifiableCollection(lastProcessMap.values());
}

From source file:com.vmware.identity.session.Session.java

/**
 * @return the sessionParticipants//from  w w  w  . j a v  a 2  s .co m
 */
public Collection<SessionParticipant> getSessionParticipants() {
    return Collections.unmodifiableCollection(participants.values());
}

From source file:ca.mcgill.cs.creco.data.CRData.java

@Override
public Collection<Category> getCategories() {
    return Collections.unmodifiableCollection(aCategoryIndex.values());
}

From source file:com.github.ukase.toolkit.jar.JarSource.java

@Override
public Collection<String> getFontsUrls() {
    return Collections.unmodifiableCollection(fonts);
}

From source file:edu.uci.ics.jung.graph.DirectedSparseMultigraph.java

public Collection<E> getInEdges(V vertex) {
    if (!containsVertex(vertex))
        return null;

    return Collections.unmodifiableCollection(getIncoming_internal(vertex));
}

From source file:com.autentia.poda.FilesCollection.java

@Override
public Iterator<FileMetadata> iterator() {
    return Collections.unmodifiableCollection(filesByPath.values()).iterator();
}