001/*******************************************************************************
002 * Copyright 2017 The MIT Internet Trust Consortium
003 *
004 * Portions copyright 2011-2013 The MITRE Corporation
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the 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
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 *******************************************************************************/
018/**
019 *
020 */
021package org.mitre.openid.connect.client.model;
022
023/**
024 *
025 * Data container to facilitate returns from the IssuerService API.
026 *
027 * @author jricher
028 *
029 */
030public class IssuerServiceResponse {
031
032        private String issuer;
033        private String loginHint;
034        private String targetLinkUri;
035        private String redirectUrl;
036
037        /**
038         * @param issuer
039         * @param loginHint
040         * @param targetLinkUri
041         */
042        public IssuerServiceResponse(String issuer, String loginHint, String targetLinkUri) {
043                this.issuer = issuer;
044                this.loginHint = loginHint;
045                this.targetLinkUri = targetLinkUri;
046        }
047
048        /**
049         * @param redirectUrl
050         */
051        public IssuerServiceResponse(String redirectUrl) {
052                this.redirectUrl = redirectUrl;
053        }
054        /**
055         * @return the issuer
056         */
057        public String getIssuer() {
058                return issuer;
059        }
060        /**
061         * @param issuer the issuer to set
062         */
063        public void setIssuer(String issuer) {
064                this.issuer = issuer;
065        }
066        /**
067         * @return the loginHint
068         */
069        public String getLoginHint() {
070                return loginHint;
071        }
072        /**
073         * @param loginHint the loginHint to set
074         */
075        public void setLoginHint(String loginHint) {
076                this.loginHint = loginHint;
077        }
078        /**
079         * @return the targetLinkUri
080         */
081        public String getTargetLinkUri() {
082                return targetLinkUri;
083        }
084        /**
085         * @param targetLinkUri the targetLinkUri to set
086         */
087        public void setTargetLinkUri(String targetLinkUri) {
088                this.targetLinkUri = targetLinkUri;
089        }
090        /**
091         * @return the redirectUrl
092         */
093        public String getRedirectUrl() {
094                return redirectUrl;
095        }
096        /**
097         * @param redirectUrl the redirectUrl to set
098         */
099        public void setRedirectUrl(String redirectUrl) {
100                this.redirectUrl = redirectUrl;
101        }
102
103        /**
104         * If the redirect url has been set, then we should send a redirect using it instead of processing things.
105         */
106        public boolean shouldRedirect() {
107                return this.redirectUrl != null;
108        }
109
110}