2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
7 * Modifications Copyright (c) 2019 Samsung
8 * ===================================================================
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
15 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
28 * https://creativecommons.org/licenses/by/4.0/
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.
36 * ============LICENSE_END============================================
41 package org.onap.portal.scheduler;
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;
50 @PropertySource(value = { "classpath:/conf/scheduler.properties" })
51 public class SchedulerProperties {
53 private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerProperties.class);
55 private static Environment environment;
58 public SchedulerProperties() {
61 protected Environment getEnvironment() {
66 public void setEnvironment(Environment environment) {
67 SchedulerProperties.environment = environment;
70 public static boolean containsProperty(String key) {
71 return environment.containsProperty(key);
74 public static String getProperty(String key) {
76 if (environment == null) {
77 logger.error(EELFLoggerDelegate.errorLogger, "getProperty: environment is null, should never happen!");
79 value = environment.getRequiredProperty(key);
86 public static final String SCHEDULER_USER_NAME_VAL = "scheduler.user.name";
88 public static final String SCHEDULER_PASSWORD_VAL = "scheduler.password";
90 public static final String SCHEDULER_SERVER_URL_VAL = "scheduler.server.url";
92 public static final String SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL = "scheduler.create.new.vnf.change.instance";
94 public static final String SCHEDULER_GET_TIME_SLOTS = "scheduler.get.time.slots";
96 public static final String SCHEDULER_SUBMIT_NEW_VNF_CHANGE = "scheduler.submit.new.vnf.change";
98 public static final String SCHEDULERAUX_CLIENTAUTH_VAL = "scheduleraux.ClientAuth";
100 public static final String SCHEDULERAUX_CLIENT_MECHID_VAL = "scheduleraux.client.mechId";
102 public static final String SCHEDULERAUX_CLIENT_PASSWORD_VAL = "scheduleraux.client.password";
104 public static final String SCHEDULERAUX_USERNAME_VAL = "scheduleraux.username";
106 public static final String SCHEDULERAUX_PASSWORD_VAL = "scheduleraux.password";
108 public static final String SCHEDULERAUX_AUTHORIZATION_VAL = "scheduleraux.Authorization";
110 public static final String SCHEDULERAUX_SERVER_URL_VAL = "scheduleraux.server.url";
112 public static final String SCHEDULERAUX_ENVIRONMENT_VAL = "scheduleraux.environment";
114 public static final String SCHEDULERAUX_GET_CONFIG_VAL = "scheduleraux.get.config";
117 /** The Constant VID_TRUSTSTORE_FILENAME. */
118 public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename";
120 /** The Constant VID_TRUSTSTORE_PASSWD_X. */
121 public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x";
123 /** The Constant FILESEPARATOR. */
124 public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
126 /** Scheduler UI constant **/
127 public static final String SCHEDULER_DOMAIN_NAME = "scheduler.domain.name";
129 public static final String SCHEDULER_SCHEDULE_NAME = "scheduler.schedule.name";
131 public static final String SCHEDULER_WORKFLOW_NAME = "scheduler.workflow.name";
133 public static final String SCHEDULER_CALLBACK_URL = "scheduler.callback.url";
135 public static final String SCHEDULER_APPROVAL_TYPE = "scheduler.approval.type";
137 public static final String SCHEDULER_APPROVAL_SUBMIT_STATUS = "scheduler.approval.submit.status";
139 public static final String SCHEDULER_APPROVAL_REJECT_STATUS = "scheduler.approval.reject.status";
141 public static final String SCHEDULER_INTERVAL_GET_TIMESLOT_RATE = "scheduler.interval.get.timeslot.rate";
143 public static final String SCHEDULER_POLICY_NAME = "scheduler.policy.name";
145 public static final String SCHEDULER_GROUP_ID = "scheduler.group.id";