001/*******************************************************************************
002 * Copyright 2017 The MIT Internet Trust Consortium
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *   http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *******************************************************************************/
016
017package org.mitre.uma.model;
018
019import javax.persistence.Basic;
020import javax.persistence.Column;
021import javax.persistence.Convert;
022import javax.persistence.Entity;
023import javax.persistence.GeneratedValue;
024import javax.persistence.GenerationType;
025import javax.persistence.Id;
026import javax.persistence.Table;
027
028import org.mitre.oauth2.model.RegisteredClient;
029import org.mitre.uma.model.convert.RegisteredClientStringConverter;
030
031/**
032 * @author jricher
033 *
034 */
035@Entity
036@Table(name = "saved_registered_client")
037public class SavedRegisteredClient {
038
039        private Long id;
040        private String issuer;
041        private RegisteredClient registeredClient;
042
043        /**
044         * @return the id
045         */
046        @Id
047        @GeneratedValue(strategy = GenerationType.IDENTITY)
048        @Column(name = "id")
049        public Long getId() {
050                return id;
051        }
052
053        /**
054         *
055         * @param id the id to set
056         */
057        public void setId(Long id) {
058                this.id = id;
059        }
060
061        /**
062         * @return the issuer
063         */
064        @Basic
065        @Column(name = "issuer")
066        public String getIssuer() {
067                return issuer;
068        }
069
070        /**
071         * @param issuer the issuer to set
072         */
073        public void setIssuer(String issuer) {
074                this.issuer = issuer;
075        }
076
077        /**
078         * @return the registeredClient
079         */
080        @Basic
081        @Column(name = "registered_client")
082        @Convert(converter = RegisteredClientStringConverter.class)
083        public RegisteredClient getRegisteredClient() {
084                return registeredClient;
085        }
086
087        /**
088         * @param registeredClient the registeredClient to set
089         */
090        public void setRegisteredClient(RegisteredClient registeredClient) {
091                this.registeredClient = registeredClient;
092        }
093
094
095
096}