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.shipping.server.transfer;
018
019import com.echothree.model.control.shipping.server.control.ShippingControl;
020import com.echothree.model.data.user.server.entity.UserVisit;
021import com.echothree.util.server.transfer.BaseTransferCaches;
022
023public class ShippingTransferCaches
024        extends BaseTransferCaches {
025    
026    protected ShippingControl shippingControl;
027    
028    ShippingMethodDescriptionTransferCache shippingMethodDescriptionTransferCache;
029    ShippingMethodTransferCache shippingMethodTransferCache;
030    ShippingMethodCarrierServiceTransferCache shippingMethodCarrierServiceTransferCache;
031    
032    /** Creates a new instance of ShippingTransferCaches */
033    public ShippingTransferCaches(UserVisit userVisit, ShippingControl shippingControl) {
034        super(userVisit);
035        
036        this.shippingControl = shippingControl;
037    }
038    
039    public ShippingMethodDescriptionTransferCache getShippingMethodDescriptionTransferCache() {
040        if(shippingMethodDescriptionTransferCache == null)
041            shippingMethodDescriptionTransferCache = new ShippingMethodDescriptionTransferCache(userVisit, shippingControl);
042        
043        return shippingMethodDescriptionTransferCache;
044    }
045    
046    public ShippingMethodTransferCache getShippingMethodTransferCache() {
047        if(shippingMethodTransferCache == null)
048            shippingMethodTransferCache = new ShippingMethodTransferCache(userVisit, shippingControl);
049        
050        return shippingMethodTransferCache;
051    }
052    
053    public ShippingMethodCarrierServiceTransferCache getShippingMethodCarrierServiceTransferCache() {
054        if(shippingMethodCarrierServiceTransferCache == null)
055            shippingMethodCarrierServiceTransferCache = new ShippingMethodCarrierServiceTransferCache(userVisit, shippingControl);
056        
057        return shippingMethodCarrierServiceTransferCache;
058    }
059    
060}