
com.adobe.fd.fp.config.FormsPortalSchedulerService Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2015-2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/
package com.adobe.fd.fp.config;
import java.util.Dictionary;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.commons.osgi.OsgiUtil;
import org.osgi.service.component.ComponentContext;
@Component(metatype = true, label = "Forms Portal Clean Up Configuration Service", description = "Settings for the clean up thread")
@Service(value = FormsPortalSchedulerService.class)
public class FormsPortalSchedulerService {
private static final String DEFAULT_INTERVAL = "12";
@Property(value = DEFAULT_INTERVAL, label = "Interval(in hours)", description = "Interval in which clean up thread should trigger")
private static final String STR_INTERVAL = "formportal.interval";
private String interval = DEFAULT_INTERVAL;
protected void activate(ComponentContext context){
Dictionary props = context.getProperties();
interval = OsgiUtil.toString(props.get(STR_INTERVAL), DEFAULT_INTERVAL);
}
public long getInterval() {
//converts hours into seconds
return Long.valueOf(interval)*60*60;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy