SchedulerController up
[portal.git] / portal-BE / src / main / java / org / onap / portal / scheduler / SchedulerProperties.java
1 /*
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  * Modifications Copyright (c) 2019 Samsung
8  * ===================================================================
9  *
10  * Unless otherwise specified, all software contained herein is licensed
11  * under the Apache License, Version 2.0 (the "License");
12  * you may not use this software except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *             http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  * Unless otherwise specified, all documentation contained herein is licensed
24  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
25  * you may not use this documentation except in compliance with the License.
26  * You may obtain a copy of the License at
27  *
28  *             https://creativecommons.org/licenses/by/4.0/
29  *
30  * Unless required by applicable law or agreed to in writing, documentation
31  * distributed under the License is distributed on an "AS IS" BASIS,
32  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33  * See the License for the specific language governing permissions and
34  * limitations under the License.
35  *
36  * ============LICENSE_END============================================
37  *
38  *
39  */
40
41 package org.onap.portal.scheduler;
42
43 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
44 import org.springframework.beans.factory.annotation.Autowired;
45 import org.springframework.context.annotation.Configuration;
46 import org.springframework.context.annotation.PropertySource;
47 import org.springframework.core.env.Environment;
48
49 @Configuration
50 @PropertySource(value = { "classpath:/conf/scheduler.properties" })
51 public class SchedulerProperties {
52
53         private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerProperties.class);
54
55         private static Environment environment;
56
57
58         public SchedulerProperties() {
59         }
60
61         protected Environment getEnvironment() {
62                 return environment;
63         }
64
65         @Autowired
66         public void setEnvironment(Environment environment) {
67                 SchedulerProperties.environment = environment;
68         }
69
70         public static boolean containsProperty(String key) {
71                 return environment.containsProperty(key);
72         }
73
74         public static String getProperty(String key) {
75                 String value = "";
76                 if (environment == null) {
77                         logger.error(EELFLoggerDelegate.errorLogger, "getProperty: environment is null, should never happen!");
78                 } else {
79                         value = environment.getRequiredProperty(key);
80                         if (value != null)
81                                 value = value.trim();
82                 }
83                 return value;
84         }
85
86         public static final String SCHEDULER_USER_NAME_VAL = "scheduler.user.name";
87
88         public static final String SCHEDULER_PASSWORD_VAL = "scheduler.password";
89
90         public static final String SCHEDULER_SERVER_URL_VAL = "scheduler.server.url";
91
92         public static final String SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL = "scheduler.create.new.vnf.change.instance";
93
94         public static final String SCHEDULER_GET_TIME_SLOTS = "scheduler.get.time.slots";
95
96         public static final String SCHEDULER_SUBMIT_NEW_VNF_CHANGE = "scheduler.submit.new.vnf.change";
97
98         public static final String SCHEDULERAUX_CLIENTAUTH_VAL = "scheduleraux.ClientAuth";
99
100         public static final String SCHEDULERAUX_CLIENT_MECHID_VAL = "scheduleraux.client.mechId";
101
102         public static final String SCHEDULERAUX_CLIENT_PASSWORD_VAL = "scheduleraux.client.password";
103
104         public static final String SCHEDULERAUX_USERNAME_VAL = "scheduleraux.username";
105
106         public static final String SCHEDULERAUX_PASSWORD_VAL = "scheduleraux.password";
107
108         public static final String SCHEDULERAUX_AUTHORIZATION_VAL = "scheduleraux.Authorization";
109
110         public static final String SCHEDULERAUX_SERVER_URL_VAL = "scheduleraux.server.url";
111
112         public static final String SCHEDULERAUX_ENVIRONMENT_VAL = "scheduleraux.environment";
113
114         public static final String SCHEDULERAUX_GET_CONFIG_VAL = "scheduleraux.get.config";
115         
116
117         /** The Constant VID_TRUSTSTORE_FILENAME. */
118         public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename";
119
120         /** The Constant VID_TRUSTSTORE_PASSWD_X. */
121         public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x";
122
123         /** The Constant FILESEPARATOR. */
124         public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
125         
126         /** Scheduler UI constant **/
127         public static final String SCHEDULER_DOMAIN_NAME = "scheduler.domain.name";
128
129         public static final String SCHEDULER_SCHEDULE_NAME = "scheduler.schedule.name";
130
131         public static final String SCHEDULER_WORKFLOW_NAME = "scheduler.workflow.name";
132
133         public static final String SCHEDULER_CALLBACK_URL = "scheduler.callback.url";
134         
135         public static final String SCHEDULER_APPROVAL_TYPE = "scheduler.approval.type";
136
137         public static final String SCHEDULER_APPROVAL_SUBMIT_STATUS = "scheduler.approval.submit.status";
138
139         public static final String SCHEDULER_APPROVAL_REJECT_STATUS = "scheduler.approval.reject.status";       
140         
141         public static final String SCHEDULER_INTERVAL_GET_TIMESLOT_RATE = "scheduler.interval.get.timeslot.rate";       
142         
143         public static final String SCHEDULER_POLICY_NAME = "scheduler.policy.name";
144
145         public static final String SCHEDULER_GROUP_ID = "scheduler.group.id";   
146
147 }