com.adobe.cq.social.commons.ugclimiter.api.UGCLimiterService Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 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.cq.social.commons.ugclimiter.api;
import org.apache.sling.api.resource.ResourceResolver;
import aQute.bnd.annotation.ProviderType;
import com.adobe.cq.social.scf.User;
/**
* A service to throttle UGC creation.
*/
@ProviderType
public interface UGCLimiterService {
/**
* Check if a user can create any more UGC if UGC Limits is enabled for the user.
* @param resolver used for reading previously stored ugc limits data
* @param user the user to check
* @return true if user can create more UGC or has no UGC limits.
*/
boolean mayCreateUGC(ResourceResolver resolver, User user);
/**
* Check if a user can create any more UGC if UGC Limits is enabled for the user.
* @param resolver used for reading previously stored ugc limits data
* @param userId the userid to check
* @return true if user can create more UGC or has no UGC limits.
*/
boolean mayCreateUGC(final ResourceResolver resolver, final String userId);
/**
* Gets the ugc rate limit.
* @return the ugc limit
*/
int getUgcLimit();
/**
* Gets the ugc duration for ugc rate limit in minutes. 0 means the time never expires.
* @return the ugc duration
*/
long getUgcDuration();
/**
* Gets the to List to which a user can send mail to request for exception in ugc limit.
* @return the array containing one or more moderator mails
*/
String[] getUgcLimitedToList();
}