View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.core.provisioning.java;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  import org.quartz.impl.jdbcjobstore.DriverDelegate;
24  import org.springframework.boot.context.properties.ConfigurationProperties;
25  
26  @ConfigurationProperties("provisioning")
27  public class ProvisioningProperties {
28  
29      public static class QuartzProperties {
30  
31          private Class<? extends DriverDelegate> delegate;
32  
33          private String sql;
34  
35          private boolean disableInstance = false;
36  
37          private boolean waitForJobsToCompleteOnShutdown = true;
38  
39          private int idleWaitTime = 30000;
40  
41          private int misfireThreshold = 60000;
42  
43          public Class<? extends DriverDelegate> getDelegate() {
44              return delegate;
45          }
46  
47          public void setDelegate(final Class<? extends DriverDelegate> delegate) {
48              this.delegate = delegate;
49          }
50  
51          public String getSql() {
52              return sql;
53          }
54  
55          public void setSql(final String sql) {
56              this.sql = sql;
57          }
58  
59          public boolean isDisableInstance() {
60              return disableInstance;
61          }
62  
63          public void setDisableInstance(final boolean disableInstance) {
64              this.disableInstance = disableInstance;
65          }
66  
67          public boolean isWaitForJobsToCompleteOnShutdown() {
68              return waitForJobsToCompleteOnShutdown;
69          }
70  
71          public void setWaitForJobsToCompleteOnShutdown(final boolean waitForJobsToCompleteOnShutdown) {
72              this.waitForJobsToCompleteOnShutdown = waitForJobsToCompleteOnShutdown;
73          }
74  
75          public int getIdleWaitTime() {
76              return idleWaitTime;
77          }
78  
79          public void setIdleWaitTime(final int idleWaitTime) {
80              this.idleWaitTime = idleWaitTime;
81          }
82  
83          public int getMisfireThreshold() {
84              return misfireThreshold;
85          }
86  
87          public void setMisfireThreshold(final int misfireThreshold) {
88              this.misfireThreshold = misfireThreshold;
89          }
90      }
91  
92      private final ExecutorProperties asyncConnectorFacadeExecutor = new ExecutorProperties();
93  
94      private final ExecutorProperties propagationTaskExecutorAsyncExecutor = new ExecutorProperties();
95  
96      private String virAttrCacheSpec = "maximumSize=5000,expireAfterAccess=1m";
97  
98      private final List<String> connIdLocation = new ArrayList<>();
99  
100     private final QuartzProperties quartz = new QuartzProperties();
101 
102     public String getVirAttrCacheSpec() {
103         return virAttrCacheSpec;
104     }
105 
106     public void setVirAttrCacheSpec(final String virAttrCacheSpec) {
107         this.virAttrCacheSpec = virAttrCacheSpec;
108     }
109 
110     public ExecutorProperties getAsyncConnectorFacadeExecutor() {
111         return asyncConnectorFacadeExecutor;
112     }
113 
114     public ExecutorProperties getPropagationTaskExecutorAsyncExecutor() {
115         return propagationTaskExecutorAsyncExecutor;
116     }
117 
118     public List<String> getConnIdLocation() {
119         return connIdLocation;
120     }
121 
122     public QuartzProperties getQuartz() {
123         return quartz;
124     }
125 }