001// --------------------------------------------------------------------------------
002// Copyright 2002-2024 Echo Three, LLC
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 com.echothree.model.control.user.server.transfer;
018
019import com.echothree.model.control.user.server.control.UserControl;
020import com.echothree.model.data.user.server.entity.UserVisit;
021import com.echothree.util.server.transfer.BaseTransferCaches;
022
023public class UserTransferCaches
024        extends BaseTransferCaches {
025    
026    protected UserControl userControl;
027    
028    protected RecoveryAnswerTransferCache recoveryAnswerTransferCache;
029    protected RecoveryQuestionTransferCache recoveryQuestionTransferCache;
030    protected RecoveryQuestionDescriptionTransferCache recoveryQuestionDescriptionTransferCache;
031    protected UserKeyTransferCache userKeyTransferCache;
032    protected UserSessionTransferCache userSessionTransferCache;
033    protected UserVisitTransferCache userVisitTransferCache;
034    protected UserVisitGroupTransferCache userVisitGroupTransferCache;
035    protected UserLoginTransferCache userLoginTransferCache;
036    protected UserLoginPasswordTransferCache userLoginPasswordTransferCache;
037    protected UserLoginPasswordTypeTransferCache userLoginPasswordTypeTransferCache;
038    protected UserLoginPasswordEncoderTypeTransferCache userLoginPasswordEncoderTypeTransferCache;
039    
040    /** Creates a new instance of UserTransferCaches */
041    public UserTransferCaches(UserVisit userVisit, UserControl userControl) {
042        super(userVisit);
043        
044        this.userControl = userControl;
045    }
046    
047    public RecoveryAnswerTransferCache getRecoveryAnswerTransferCache() {
048        if(recoveryAnswerTransferCache == null)
049            recoveryAnswerTransferCache = new RecoveryAnswerTransferCache(userVisit, userControl);
050        
051        return recoveryAnswerTransferCache;
052    }
053    
054    public RecoveryQuestionTransferCache getRecoveryQuestionTransferCache() {
055        if(recoveryQuestionTransferCache == null)
056            recoveryQuestionTransferCache = new RecoveryQuestionTransferCache(userVisit, userControl);
057        
058        return recoveryQuestionTransferCache;
059    }
060    
061    public RecoveryQuestionDescriptionTransferCache getRecoveryQuestionDescriptionTransferCache() {
062        if(recoveryQuestionDescriptionTransferCache == null)
063            recoveryQuestionDescriptionTransferCache = new RecoveryQuestionDescriptionTransferCache(userVisit, userControl);
064        
065        return recoveryQuestionDescriptionTransferCache;
066    }
067    
068    public UserKeyTransferCache getUserKeyTransferCache() {
069        if(userKeyTransferCache == null)
070            userKeyTransferCache = new UserKeyTransferCache(userVisit, userControl);
071        
072        return userKeyTransferCache;
073    }
074    
075    public UserSessionTransferCache getUserSessionTransferCache() {
076        if(userSessionTransferCache == null)
077            userSessionTransferCache = new UserSessionTransferCache(userVisit, userControl);
078        
079        return userSessionTransferCache;
080    }
081    
082    public UserVisitTransferCache getUserVisitTransferCache() {
083        if(userVisitTransferCache == null)
084            userVisitTransferCache = new UserVisitTransferCache(userVisit, userControl);
085        
086        return userVisitTransferCache;
087    }
088    
089    public UserVisitGroupTransferCache getUserVisitGroupTransferCache() {
090        if(userVisitGroupTransferCache == null)
091            userVisitGroupTransferCache = new UserVisitGroupTransferCache(userVisit, userControl);
092        
093        return userVisitGroupTransferCache;
094    }
095    
096    public UserLoginTransferCache getUserLoginTransferCache() {
097        if(userLoginTransferCache == null)
098            userLoginTransferCache = new UserLoginTransferCache(userVisit, userControl);
099
100        return userLoginTransferCache;
101    }
102
103    public UserLoginPasswordTransferCache getUserLoginPasswordTransferCache() {
104        if(userLoginPasswordTransferCache == null)
105            userLoginPasswordTransferCache = new UserLoginPasswordTransferCache(userVisit, userControl);
106
107        return userLoginPasswordTransferCache;
108    }
109
110    public UserLoginPasswordTypeTransferCache getUserLoginPasswordTypeTransferCache() {
111        if(userLoginPasswordTypeTransferCache == null)
112            userLoginPasswordTypeTransferCache = new UserLoginPasswordTypeTransferCache(userVisit, userControl);
113
114        return userLoginPasswordTypeTransferCache;
115    }
116
117    public UserLoginPasswordEncoderTypeTransferCache getUserLoginPasswordEncoderTypeTransferCache() {
118        if(userLoginPasswordEncoderTypeTransferCache == null)
119            userLoginPasswordEncoderTypeTransferCache = new UserLoginPasswordEncoderTypeTransferCache(userVisit, userControl);
120
121        return userLoginPasswordEncoderTypeTransferCache;
122    }
123
124}