1 /* 2 * Copyright 2012 smartics, Kronseder & Reiner GmbH 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package de.smartics.sandbox.mail; 17 18 import javax.validation.constraints.Min; 19 import javax.validation.constraints.NotNull; 20 21 import de.smartics.properties.api.core.annotations.AccessType; 22 import de.smartics.properties.api.core.annotations.PropertyExpression; 23 import de.smartics.properties.api.core.annotations.PropertyLifecycle; 24 import de.smartics.properties.api.core.annotations.PropertyLifecycle.UpdateInterval; 25 import de.smartics.properties.api.core.annotations.PropertySet; 26 import de.smartics.properties.api.core.domain.PropertyKey; 27 28 /** 29 * Announcement Properties 30 */ 31 @PropertySet("announce") 32 public interface AnnouncementProperties 33 { 34 /** 35 * The file system directory where announcements are stored. 36 * 37 * @return the file system directory where announcements are stored. 38 */ 39 @NotNull 40 String directory(); 41 42 /** 43 * The lookup interval for checking {@link directory} for new announcements. 44 * The value is expected in milliseconds. A value of zero indicates, that no 45 * automatic lookup is used. 46 * 47 * @return the lookup interval for checking {@link directory} for new 48 * announcements. 49 */ 50 @PropertyExpression("300000" /* = 5 * 60 * 1000 ms = 5 min */) 51 @Min(value = 0) 52 @PropertyLifecycle(access = AccessType.READ_WRITE, 53 updateInterval = 30 * UpdateInterval.ONE_SECOND) 54 int lookupIntervalMs(); 55 56 /** 57 * Returns the property key for the property {@link #lookupIntervalMs()}. 58 * 59 * @return the property key for the property {@link #lookupIntervalMs()}. 60 */ 61 PropertyKey getLookupIntervalMsPropertyKey(); 62 }