01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15:
16: package org.acegisecurity.captcha;
17:
18: import org.acegisecurity.context.SecurityContext;
19:
20: /**
21: * Interface that add humanity concerns to the SecurityContext
22: *
23: * @author marc antoine garrigue
24: */
25: public interface CaptchaSecurityContext extends SecurityContext {
26: //~ Methods ========================================================================================================
27:
28: /**
29: * DOCUMENT ME!
30: *
31: * @return number of human restricted resources requests since the last passed captcha.
32: */
33: int getHumanRestrictedResourcesRequestsCount();
34:
35: /**
36: * DOCUMENT ME!
37: *
38: * @return the date of the last passed Captcha in millis, 0 if the user never passed captcha.
39: */
40: long getLastPassedCaptchaDateInMillis();
41:
42: /**
43: * Method to increment the human Restricted Resrouces Requests Count;
44: */
45: void incrementHumanRestrictedRessoucesRequestsCount();
46:
47: /**
48: * DOCUMENT ME!
49: *
50: * @return true if the current user has already passed a captcha.
51: */
52: boolean isHuman();
53:
54: /**
55: * set human attribute, should called after captcha validation.
56: */
57: void setHuman();
58: }
|