001    package railo.runtime.type.scope;
002    
003    import java.io.Serializable;
004    
005    import railo.runtime.type.Collection;
006    
007    public final class ClusterEntryImpl  implements ClusterEntry {
008    
009            private Collection.Key key;
010            private long time;
011            private Serializable value;
012    
013            public ClusterEntryImpl(Collection.Key key,Serializable value, int offset) {
014                    this.key=key;
015                    this.time=System.currentTimeMillis()+offset;
016                    this.value=value;
017            }
018            public ClusterEntryImpl(Collection.Key key,Serializable value, long time) {
019                    this.key=key;
020                    this.time=time;
021                    this.value=value;
022            }
023            
024            /**
025             * Constructor of the class for Webservice Bean Deserializer
026             */
027            public ClusterEntryImpl() {}
028    
029            /**
030             * @param key the key to set
031             */
032            public void setKey(Collection.Key key) {
033                    this.key = key;
034            }
035            /**
036             * @param time the time to set
037             */
038            public void setTime(long time) {
039                    this.time = time;
040            }
041            /**
042             * @param value the value to set
043             */
044            public void setValue(Serializable value) {
045                    this.value = value;
046            }
047            /**
048             * @return the key
049             */
050            public Collection.Key getKey() {
051                    return key;
052            }
053    
054            /**
055             * @return the time
056             */
057            public Long getTimeRef() {
058                    return Long.valueOf(time);
059            }
060            
061            public long getTime() {
062                    return time;
063            }
064    
065            /**
066             * @return the value
067             */
068            public Serializable getValue() {
069                    return value;
070            }
071            
072            /**
073             *
074             * @see java.lang.Object#equals(java.lang.Object)
075             */
076            public boolean equals(Object obj) {
077                    if(obj instanceof ClusterEntry) {
078                            ClusterEntry other = (ClusterEntry)obj;
079                            return key.equalsIgnoreCase(other.getKey());
080                    }
081                    return false;
082            }
083    }