001/*
002 * oauth2-oidc-sdk
003 *
004 * Copyright 2012-2020, Connect2id Ltd and contributors.
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
007 * this file except in compliance with the License. You may obtain a copy of the
008 * License at
009 *
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software distributed
013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
015 * specific language governing permissions and limitations under the License.
016 */
017
018package com.nimbusds.openid.connect.sdk.federation.entities;
019
020
021import net.jcip.annotations.Immutable;
022
023import com.nimbusds.oauth2.sdk.id.Identifier;
024
025
026/**
027 * Federation entity type.
028 *
029 * <p>Related specifications:
030 *
031 * <ul>
032 *     <li>OpenID Connect Federation 1.0, section 4.
033 * </ul>
034 */
035@Immutable
036public final class EntityType extends Identifier {
037        
038        
039        private static final long serialVersionUID = 345842707286531482L;
040        
041        
042        /**
043         * OpenID relying party ({@code openid_relying_party}).
044         */
045        public static final EntityType OPENID_RELYING_PARTY = new EntityType("openid_relying_party");
046        
047        
048        /**
049         * OpenID provider ({@code openid_provider}).
050         */
051        public static final EntityType OPENID_PROVIDER = new EntityType("openid_provider");
052        
053        
054        /**
055         * OAuth authorisation server ({@code oauth_authorization_server}).
056         */
057        public static final EntityType OAUTH_AUTHORIZATION_SERVER = new EntityType("oauth_authorization_server");
058        
059        
060        /**
061         * OAuth client ({@code oauth_client}).
062         */
063        public static final EntityType OAUTH_CLIENT = new EntityType("oauth_client");
064        
065        
066        /**
067         * OAuth protected resource ({@code oauth_resource}).
068         */
069        public static final EntityType OAUTH_RESOURCE = new EntityType("oauth_resource");
070        
071        
072        /**
073         * Federation entity ({@code federation_entity}).
074         */
075        public static final EntityType FEDERATION_ENTITY = new EntityType("federation_entity");
076        
077        
078        /**
079         * Trust mark issuer ({@code trust_mark_issuer}).
080         */
081        @Deprecated
082        public static final EntityType TRUST_MARK_ISSUER = new EntityType("trust_mark_issuer");
083        
084        
085        /**
086         * Creates a new federation metadata type.
087         *
088         * @param value The metadata type value. Must not be {@code null}.
089         */
090        public EntityType(final String value) {
091                super(value);
092        }
093        
094        
095        @Override
096        public boolean equals(final Object object) {
097                
098                return object instanceof EntityType &&
099                        this.toString().equals(object.toString());
100        }
101}