001package org.apache.archiva.admin.model.beans; 002/* 003 * Licensed to the Apache Software Foundation (ASF) under one 004 * or more contributor license agreements. See the NOTICE file 005 * distributed with this work for additional information 006 * regarding copyright ownership. The ASF licenses this file 007 * to you under the Apache License, Version 2.0 (the 008 * "License"); you may not use this file except in compliance 009 * with the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, 014 * software distributed under the License is distributed on an 015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 016 * KIND, either express or implied. See the License for the 017 * specific language governing permissions and limitations 018 * under the License. 019 */ 020 021import javax.xml.bind.annotation.XmlRootElement; 022import java.io.Serializable; 023 024/** 025 * @author Olivier Lamy 026 * @since 1.4-M4 027 */ 028@XmlRootElement( name = "cacheConfiguration" ) 029public class CacheConfiguration 030 implements Serializable 031{ 032 /** 033 * TimeToIdleSeconds. 034 */ 035 private int timeToIdleSeconds = -1; 036 037 /** 038 * TimeToLiveSeconds. 039 */ 040 private int timeToLiveSeconds = -1; 041 042 /** 043 * max elements in memory. 044 */ 045 private int maxElementsInMemory = -1; 046 047 /** 048 * max elements on disk. 049 */ 050 private int maxElementsOnDisk = -1; 051 052 public CacheConfiguration() 053 { 054 // no op 055 } 056 057 public int getTimeToIdleSeconds() 058 { 059 return timeToIdleSeconds; 060 } 061 062 public void setTimeToIdleSeconds( int timeToIdleSeconds ) 063 { 064 this.timeToIdleSeconds = timeToIdleSeconds; 065 } 066 067 public int getTimeToLiveSeconds() 068 { 069 return timeToLiveSeconds; 070 } 071 072 public void setTimeToLiveSeconds( int timeToLiveSeconds ) 073 { 074 this.timeToLiveSeconds = timeToLiveSeconds; 075 } 076 077 public int getMaxElementsInMemory() 078 { 079 return maxElementsInMemory; 080 } 081 082 public void setMaxElementsInMemory( int maxElementsInMemory ) 083 { 084 this.maxElementsInMemory = maxElementsInMemory; 085 } 086 087 public int getMaxElementsOnDisk() 088 { 089 return maxElementsOnDisk; 090 } 091 092 public void setMaxElementsOnDisk( int maxElementsOnDisk ) 093 { 094 this.maxElementsOnDisk = maxElementsOnDisk; 095 } 096 097 @Override 098 public String toString() 099 { 100 final StringBuilder sb = new StringBuilder(); 101 sb.append( "CacheConfiguration" ); 102 sb.append( "{timeToIdleSeconds=" ).append( timeToIdleSeconds ); 103 sb.append( ", timeToLiveSeconds=" ).append( timeToLiveSeconds ); 104 sb.append( ", maxElementsInMemory=" ).append( maxElementsInMemory ); 105 sb.append( ", maxElementsOnDisk=" ).append( maxElementsOnDisk ); 106 sb.append( '}' ); 107 return sb.toString(); 108 } 109}