001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2015-2016 ForgeRock AS.
015 */
016
017package org.forgerock.oauth2.core;
018
019import java.util.Set;
020
021/**
022 * An OAuth 2.0 token abstraction for introspection.
023 *
024 * @supported.all.api
025 */
026public interface IntrospectableToken extends Token {
027
028    /**
029     * Gets the token's expiry time.
030     *
031     * @return The token's expiry time.
032     */
033    long getExpiryTime();
034
035    /**
036     * Gets whether the token has expired.
037     *
038     * @return Whether the token has expired.
039     */
040    boolean isExpired();
041
042    /**
043     * Gets the token's realm.
044     *
045     * @return The token's realm.
046     */
047    String getRealm();
048
049    /**
050     * Gets the token's client id.
051     *
052     * @return The token's client id.
053     */
054    String getClientId();
055
056    /**
057     * Gets the token's resource owner id.
058     *
059     * @return The token's resource owner id.
060     */
061    String getResourceOwnerId();
062
063    /**
064     * Gets the token's scopes.
065     *
066     * @return The token's scopes.
067     */
068    Set<String> getScope();
069
070    /**
071     * Gets the end user's authentication time in seconds.
072     *
073     * @return The authentication time.
074     */
075    long getAuthTimeSeconds();
076}