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.selector.server.evaluator;
018
019import com.echothree.model.data.selector.server.entity.Selector;
020import com.echothree.model.data.selector.server.entity.SelectorTime;
021
022public class CachedSelectorWithTime
023        extends CachedSelector {
024    
025    SelectorTime selectorTime;
026    
027    /** Create a new instance of CachedSelectorWithTime */
028    /** Creates a new instance of CachedSelectorWithTime */
029    public CachedSelectorWithTime(Selector selector) {
030        super(selector);
031        
032        selectorTime = selectorControl.getSelectorTimeForUpdate(selector);
033        if(selectorTime == null) {
034            selectorControl.createSelectorTime(selector);
035            selectorTime = selectorControl.getSelectorTimeForUpdate(selector);
036        }
037    }
038    
039    public Long getLastEvaluationTime() {
040        return selectorTime.getLastEvaluationTime();
041    }
042    
043    public void setLastEvaluationTime(Long lastEvaluationTime) {
044        selectorTime.setLastEvaluationTime(lastEvaluationTime);
045    }
046    
047    public Long getMaxEntityCreatedTime() {
048        return selectorTime.getMaxEntityCreatedTime();
049    }
050    
051    public void setMaxEntityCreatedTime(Long maxEntityCreatedTime) {
052        selectorTime.setMaxEntityCreatedTime(maxEntityCreatedTime);
053    }
054    
055    public Long getMaxEntityModifiedTime() {
056        return selectorTime.getMaxEntityModifiedTime();
057    }
058    
059    public void setMaxEntityModifiedTime(Long maxEntityModifiedTime) {
060        selectorTime.setMaxEntityModifiedTime(maxEntityModifiedTime);
061    }
062    
063    public Long getMaxEntityDeletedTime() {
064        return selectorTime.getMaxEntityDeletedTime();
065    }
066    
067    public void setMaxEntityDeletedTime(Long maxEntityDeletedTime) {
068        selectorTime.setMaxEntityDeletedTime(maxEntityDeletedTime);
069    }
070    
071}