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.openid.connect.service;
018
019import java.util.HashMap;
020import java.util.Map;
021import java.util.Set;
022
023/**
024 * @author jricher
025 *
026 */
027public class MITREidDataServiceMaps {
028
029        private Map<Long, Long> accessTokenOldToNewIdMap = new HashMap<Long, Long>();
030        private Map<Long, Long> accessTokenToAuthHolderRefs = new HashMap<Long, Long>();
031        private Map<Long, String> accessTokenToClientRefs = new HashMap<Long, String>();
032        private Map<Long, Long> accessTokenToRefreshTokenRefs = new HashMap<Long, Long>();
033        private Map<Long, Long> authHolderOldToNewIdMap = new HashMap<Long, Long>();
034        private Map<Long, Long> grantOldToNewIdMap = new HashMap<>();
035        private Map<Long, Set<Long>> grantToAccessTokensRefs = new HashMap<>();
036        private Map<Long, Long> refreshTokenOldToNewIdMap = new HashMap<Long, Long>();
037        private Map<Long, Long> refreshTokenToAuthHolderRefs = new HashMap<Long, Long>();
038        private Map<Long, String> refreshTokenToClientRefs = new HashMap<Long, String>();
039        private Map<Long, Long> whitelistedSiteOldToNewIdMap = new HashMap<Long, Long>();
040        /**
041         * @return the accessTokenOldToNewIdMap
042         */
043        public Map<Long, Long> getAccessTokenOldToNewIdMap() {
044                return accessTokenOldToNewIdMap;
045        }
046        /**
047         * @return the accessTokenToAuthHolderRefs
048         */
049        public Map<Long, Long> getAccessTokenToAuthHolderRefs() {
050                return accessTokenToAuthHolderRefs;
051        }
052        /**
053         * @return the accessTokenToClientRefs
054         */
055        public Map<Long, String> getAccessTokenToClientRefs() {
056                return accessTokenToClientRefs;
057        }
058        /**
059         * @return the accessTokenToRefreshTokenRefs
060         */
061        public Map<Long, Long> getAccessTokenToRefreshTokenRefs() {
062                return accessTokenToRefreshTokenRefs;
063        }
064        /**
065         * @return the authHolderOldToNewIdMap
066         */
067        public Map<Long, Long> getAuthHolderOldToNewIdMap() {
068                return authHolderOldToNewIdMap;
069        }
070        /**
071         * @return the grantOldToNewIdMap
072         */
073        public Map<Long, Long> getGrantOldToNewIdMap() {
074                return grantOldToNewIdMap;
075        }
076        /**
077         * @return the grantToAccessTokensRefs
078         */
079        public Map<Long, Set<Long>> getGrantToAccessTokensRefs() {
080                return grantToAccessTokensRefs;
081        }
082        /**
083         * @return the refreshTokenOldToNewIdMap
084         */
085        public Map<Long, Long> getRefreshTokenOldToNewIdMap() {
086                return refreshTokenOldToNewIdMap;
087        }
088        /**
089         * @return the refreshTokenToAuthHolderRefs
090         */
091        public Map<Long, Long> getRefreshTokenToAuthHolderRefs() {
092                return refreshTokenToAuthHolderRefs;
093        }
094        /**
095         * @return the refreshTokenToClientRefs
096         */
097        public Map<Long, String> getRefreshTokenToClientRefs() {
098                return refreshTokenToClientRefs;
099        }
100        /**
101         * @return the whitelistedSiteOldToNewIdMap
102         */
103        public Map<Long, Long> getWhitelistedSiteOldToNewIdMap() {
104                return whitelistedSiteOldToNewIdMap;
105        }
106
107        public void clearAll() {
108                refreshTokenToClientRefs.clear();
109                refreshTokenToAuthHolderRefs.clear();
110                accessTokenToClientRefs.clear();
111                accessTokenToAuthHolderRefs.clear();
112                accessTokenToRefreshTokenRefs.clear();
113                refreshTokenOldToNewIdMap.clear();
114                accessTokenOldToNewIdMap.clear();
115                grantOldToNewIdMap.clear();
116        }
117
118}