aboutsummaryrefslogtreecommitdiffstats
path: root/ncomp-sirius-manager-model/src/main/xcore-gen/org/openecomp/ncomp/sirius/manager/server/impl/AbstractManagementServerConfigurationImpl.java
blob: 1eebb174f10b354b78c90b29e2acbd720a180da0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
/*-
 * ============LICENSE_START==========================================
 * OPENECOMP - DCAE
 * ===================================================================
 * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
 * ===================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END============================================
 */
	
/**
 */
package org.openecomp.ncomp.sirius.manager.server.impl;

import org.openecomp.ncomp.core.alerts.AlertingTemplate;
import org.openecomp.ncomp.core.function.Function;
import org.openecomp.ncomp.core.logs.LogMessageRule;
import org.openecomp.ncomp.core.metrics.MetricValueOption;
import org.openecomp.ncomp.sirius.manager.properties.impl.ModuleContainerImpl;
import org.openecomp.ncomp.sirius.manager.server.AbstractManagementServerConfiguration;
import org.openecomp.ncomp.sirius.manager.server.ServerPackage;
import org.openecomp.ncomp.sirius.manager.server.VersionConfiguration;
import org.openecomp.ncomp.sirius.manager.tableTemplate.AbstractTableTemplate;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Abstract Management Server Configuration</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link org.openecomp.ncomp.sirius.manager.server.impl.AbstractManagementServerConfigurationImpl#getRules <em>Rules</em>}</li>
 *   <li>{@link org.openecomp.ncomp.sirius.manager.server.impl.AbstractManagementServerConfigurationImpl#getMetricOptions <em>Metric Options</em>}</li>
 *   <li>{@link org.openecomp.ncomp.sirius.manager.server.impl.AbstractManagementServerConfigurationImpl#getTableTemplates <em>Table Templates</em>}</li>
 *   <li>{@link org.openecomp.ncomp.sirius.manager.server.impl.AbstractManagementServerConfigurationImpl#getAlertTemplates <em>Alert Templates</em>}</li>
 *   <li>{@link org.openecomp.ncomp.sirius.manager.server.impl.AbstractManagementServerConfigurationImpl#getFunctions <em>Functions</em>}</li>
 *   <li>{@link org.openecomp.ncomp.sirius.manager.server.impl.AbstractManagementServerConfigurationImpl#getVersion <em>Version</em>}</li>
 * </ul>
 *
 * @generated
 */
public class AbstractManagementServerConfigurationImpl extends ModuleContainerImpl implements AbstractManagementServerConfiguration {
	/**
	 * The cached value of the '{@link #getRules() <em>Rules</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRules()
	 * @generated
	 * @ordered
	 */
	protected EList<LogMessageRule> rules;

	/**
	 * The cached value of the '{@link #getMetricOptions() <em>Metric Options</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMetricOptions()
	 * @generated
	 * @ordered
	 */
	protected EList<MetricValueOption> metricOptions;

	/**
	 * The cached value of the '{@link #getTableTemplates() <em>Table Templates</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTableTemplates()
	 * @generated
	 * @ordered
	 */
	protected EList<AbstractTableTemplate> tableTemplates;

	/**
	 * The cached value of the '{@link #getAlertTemplates() <em>Alert Templates</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAlertTemplates()
	 * @generated
	 * @ordered
	 */
	protected EList<AlertingTemplate> alertTemplates;

	/**
	 * The cached value of the '{@link #getFunctions() <em>Functions</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFunctions()
	 * @generated
	 * @ordered
	 */
	protected EList<Function> functions;

	/**
	 * The cached value of the '{@link #getVersion() <em>Version</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVersion()
	 * @generated
	 * @ordered
	 */
	protected VersionConfiguration version;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected AbstractManagementServerConfigurationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ServerPackage.Literals.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<LogMessageRule> getRules() {
		if (rules == null) {
			rules = new EObjectContainmentEList<LogMessageRule>(LogMessageRule.class, this, ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__RULES);
		}
		return rules;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<MetricValueOption> getMetricOptions() {
		if (metricOptions == null) {
			metricOptions = new EObjectContainmentEList<MetricValueOption>(MetricValueOption.class, this, ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__METRIC_OPTIONS);
		}
		return metricOptions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<AbstractTableTemplate> getTableTemplates() {
		if (tableTemplates == null) {
			tableTemplates = new EObjectContainmentEList<AbstractTableTemplate>(AbstractTableTemplate.class, this, ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__TABLE_TEMPLATES);
		}
		return tableTemplates;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<AlertingTemplate> getAlertTemplates() {
		if (alertTemplates == null) {
			alertTemplates = new EObjectContainmentEList<AlertingTemplate>(AlertingTemplate.class, this, ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__ALERT_TEMPLATES);
		}
		return alertTemplates;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Function> getFunctions() {
		if (functions == null) {
			functions = new EObjectContainmentEList<Function>(Function.class, this, ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__FUNCTIONS);
		}
		return functions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public VersionConfiguration getVersion() {
		return version;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetVersion(VersionConfiguration newVersion, NotificationChain msgs) {
		VersionConfiguration oldVersion = version;
		version = newVersion;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION, oldVersion, newVersion);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setVersion(VersionConfiguration newVersion) {
		if (newVersion != version) {
			NotificationChain msgs = null;
			if (version != null)
				msgs = ((InternalEObject)version).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION, null, msgs);
			if (newVersion != null)
				msgs = ((InternalEObject)newVersion).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION, null, msgs);
			msgs = basicSetVersion(newVersion, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION, newVersion, newVersion));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__RULES:
				return ((InternalEList<?>)getRules()).basicRemove(otherEnd, msgs);
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__METRIC_OPTIONS:
				return ((InternalEList<?>)getMetricOptions()).basicRemove(otherEnd, msgs);
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__TABLE_TEMPLATES:
				return ((InternalEList<?>)getTableTemplates()).basicRemove(otherEnd, msgs);
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__ALERT_TEMPLATES:
				return ((InternalEList<?>)getAlertTemplates()).basicRemove(otherEnd, msgs);
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__FUNCTIONS:
				return ((InternalEList<?>)getFunctions()).basicRemove(otherEnd, msgs);
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION:
				return basicSetVersion(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__RULES:
				return getRules();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__METRIC_OPTIONS:
				return getMetricOptions();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__TABLE_TEMPLATES:
				return getTableTemplates();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__ALERT_TEMPLATES:
				return getAlertTemplates();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__FUNCTIONS:
				return getFunctions();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION:
				return getVersion();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__RULES:
				getRules().clear();
				getRules().addAll((Collection<? extends LogMessageRule>)newValue);
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__METRIC_OPTIONS:
				getMetricOptions().clear();
				getMetricOptions().addAll((Collection<? extends MetricValueOption>)newValue);
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__TABLE_TEMPLATES:
				getTableTemplates().clear();
				getTableTemplates().addAll((Collection<? extends AbstractTableTemplate>)newValue);
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__ALERT_TEMPLATES:
				getAlertTemplates().clear();
				getAlertTemplates().addAll((Collection<? extends AlertingTemplate>)newValue);
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__FUNCTIONS:
				getFunctions().clear();
				getFunctions().addAll((Collection<? extends Function>)newValue);
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION:
				setVersion((VersionConfiguration)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__RULES:
				getRules().clear();
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__METRIC_OPTIONS:
				getMetricOptions().clear();
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__TABLE_TEMPLATES:
				getTableTemplates().clear();
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__ALERT_TEMPLATES:
				getAlertTemplates().clear();
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__FUNCTIONS:
				getFunctions().clear();
				return;
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION:
				setVersion((VersionConfiguration)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__RULES:
				return rules != null && !rules.isEmpty();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__METRIC_OPTIONS:
				return metricOptions != null && !metricOptions.isEmpty();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__TABLE_TEMPLATES:
				return tableTemplates != null && !tableTemplates.isEmpty();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__ALERT_TEMPLATES:
				return alertTemplates != null && !alertTemplates.isEmpty();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__FUNCTIONS:
				return functions != null && !functions.isEmpty();
			case ServerPackage.ABSTRACT_MANAGEMENT_SERVER_CONFIGURATION__VERSION:
				return version != null;
		}
		return super.eIsSet(featureID);
	}

} //AbstractManagementServerConfigurationImpl