View Javadoc
1   /*
2    * Copyright 2014 the original author or authors.
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  
17  package org.bremersee.spring.security.ldaptive.authentication;
18  
19  import java.util.function.Supplier;
20  import org.bremersee.spring.security.ldaptive.authentication.provider.ActiveDirectoryAccountControlEvaluator;
21  import org.bremersee.spring.security.ldaptive.authentication.provider.NoAccountControlEvaluator;
22  
23  /**
24   * The enum Account control evaluator reference.
25   *
26   * @author Christian Bremer
27   */
28  public enum AccountControlEvaluatorProperty implements Supplier<AccountControlEvaluator> {
29  
30    /**
31     * The None.
32     */
33    NONE(new NoAccountControlEvaluator()),
34  
35    /**
36     * The Active directory.
37     */
38    ACTIVE_DIRECTORY(new ActiveDirectoryAccountControlEvaluator());
39  
40    private final AccountControlEvaluator evaluator;
41  
42    AccountControlEvaluatorProperty(AccountControlEvaluator evaluator) {
43      this.evaluator = evaluator;
44    }
45  
46    @Override
47    public AccountControlEvaluator get() {
48      return evaluator;
49    }
50  }