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.customer.server.transfer; 018 019import com.echothree.model.control.customer.server.control.CustomerControl; 020import com.echothree.model.data.user.server.entity.UserVisit; 021import com.echothree.util.server.transfer.BaseTransferCaches; 022 023public class CustomerTransferCaches 024 extends BaseTransferCaches { 025 026 protected CustomerControl customerControl; 027 028 protected CustomerTypeTransferCache customerTypeTransferCache; 029 protected CustomerTypeDescriptionTransferCache customerTypeDescriptionTransferCache; 030 protected CustomerTransferCache customerTransferCache; 031 protected CustomerTypePaymentMethodTransferCache customerTypePaymentMethodTransferCache; 032 protected CustomerTypeShippingMethodTransferCache customerTypeShippingMethodTransferCache; 033 034 /** Creates a new instance of CustomerTransferCaches */ 035 public CustomerTransferCaches(UserVisit userVisit, CustomerControl customerControl) { 036 super(userVisit); 037 038 this.customerControl = customerControl; 039 } 040 041 public CustomerTypeTransferCache getCustomerTypeTransferCache() { 042 if(customerTypeTransferCache == null) 043 customerTypeTransferCache = new CustomerTypeTransferCache(userVisit, customerControl); 044 045 return customerTypeTransferCache; 046 } 047 048 public CustomerTypeDescriptionTransferCache getCustomerTypeDescriptionTransferCache() { 049 if(customerTypeDescriptionTransferCache == null) 050 customerTypeDescriptionTransferCache = new CustomerTypeDescriptionTransferCache(userVisit, customerControl); 051 052 return customerTypeDescriptionTransferCache; 053 } 054 055 public CustomerTransferCache getCustomerTransferCache() { 056 if(customerTransferCache == null) 057 customerTransferCache = new CustomerTransferCache(userVisit, customerControl); 058 059 return customerTransferCache; 060 } 061 062 public CustomerTypePaymentMethodTransferCache getCustomerTypePaymentMethodTransferCache() { 063 if(customerTypePaymentMethodTransferCache == null) 064 customerTypePaymentMethodTransferCache = new CustomerTypePaymentMethodTransferCache(userVisit, customerControl); 065 066 return customerTypePaymentMethodTransferCache; 067 } 068 069 public CustomerTypeShippingMethodTransferCache getCustomerTypeShippingMethodTransferCache() { 070 if(customerTypeShippingMethodTransferCache == null) 071 customerTypeShippingMethodTransferCache = new CustomerTypeShippingMethodTransferCache(userVisit, customerControl); 072 073 return customerTypeShippingMethodTransferCache; 074 } 075 076}