2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.aai.ingestModel;
23 import java.util.ArrayList;
25 import javax.servlet.ServletContextEvent;
26 import javax.servlet.ServletContextListener;
28 import org.openecomp.aai.exceptions.AAIException;
29 import org.openecomp.aai.logging.ErrorLogHelper;
30 import com.att.eelf.configuration.EELFLogger;
31 import com.att.eelf.configuration.EELFManager;
34 * The listener interface for receiving ingestModel events.
35 * The class that is interested in processing a ingestModel
36 * event implements this interface, and the object created
37 * with that class is registered with a component using the
38 * component's <code>addIngestModelListener<code> method. When
39 * the ingestModel event occurs, that object's appropriate
42 * @see IngestModelEvent
44 public class IngestModelListener implements ServletContextListener {
46 private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(IngestModelListener.class);
51 * @param arg0 the ServletContextEvent
54 public void contextDestroyed(ServletContextEvent arg0) {
55 IngestModelMoxyOxm m = new IngestModelMoxyOxm();
57 LOGGER.info("AAI Auth Listener contextDestroyed() complete.");
60 //Run this before web application is started
62 * Initializaes the context.
64 * @param arg0 the ServletContextEvent
67 public void contextInitialized(ServletContextEvent arg0) {
69 LOGGER.info("IngestModel starts initialization...");
71 ArrayList<String> apiVersions = new ArrayList<String>();
72 apiVersions.add("v10");
73 apiVersions.add("v9");
74 apiVersions.add("v8");
75 apiVersions.add("v7");
76 apiVersions.add("v2");
77 IngestModelMoxyOxm m = new IngestModelMoxyOxm();
79 } catch (AAIException e) {
80 ErrorLogHelper.logException(e);