Remove commented methods/fields in APPC
[appc.git] / appc-adapters / appc-dmaap-adapter / appc-dmaap-adapter-bundle / src / main / java / org / openecomp / appc / adapter / messaging / dmaap / AppcDmaapAdapterActivator.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : APP-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
6  *                                              reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.openecomp.appc.adapter.messaging.dmaap;
23
24 import org.openecomp.appc.configuration.ConfigurationFactory;
25 import com.att.eelf.configuration.EELFLogger;
26 import com.att.eelf.configuration.EELFManager;
27 import org.osgi.framework.BundleActivator;
28 import org.osgi.framework.BundleContext;
29 import org.osgi.framework.ServiceRegistration;
30
31 import java.util.Properties;
32
33 /**
34  * This activator is used to initialize and terminate the connection pool to one or more providers.
35  * <p>
36  * The CDP abstraction layer supports multiple types of providers, with each provider supporting multiple tenants. The
37  * "connection" to a specific tenant on a specific provider is represented by a "context" object. These context objects
38  * are authenticated to a specific tenant on the provider, but can be reused from one request to another. Contexts are
39  * slow to set up and are resource intensive, so they are cached. However, the contexts for a specific tenant on a
40  * specific provider must be cached separately.
41  * </p>
42  * <p>
43  * Activation of the bundle creates an empty cache which is organized first by provider type, then by tenant name, with
44  * the contents being an empty pool of contexts for that provider/tenant combination. The pool is created on first use,
45  * and retained for as long as the bundle is active.
46  * </p>
47  * <p>
48  * When the bundle is deactivated, the cache is torn down with all contexts being closed.
49  * </p>
50  */
51 public class AppcDmaapAdapterActivator implements BundleActivator {
52     private ServiceRegistration registration = null;
53
54     /**
55      * The logger to be used
56      */
57     private static final EELFLogger LOG = EELFManager.getInstance().getLogger(AppcDmaapAdapterActivator.class);
58
59     /**
60      * Called when this bundle is started so the Framework can perform the bundle-specific activities necessary to start
61      * this bundle. This method can be used to register services or to allocate any resources that this bundle needs.
62      * <p>
63      * This method must complete and return to its caller in a timely manner.
64      * </p>
65      *
66      * @param bundleContext
67      *            The execution context of the bundle being started.
68      * @throws java.lang.Exception
69      *             If this method throws an exception, this bundle is marked as stopped and the Framework will remove
70      *             this bundle's listeners, unregister all services registered by this bundle, and release all services
71      *             used by this bundle.
72      * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
73      */
74     @Override
75     public void start(final BundleContext bundleContext) throws Exception {
76         LOG.info("Starting Bundle " + getName());
77     }
78
79     /**
80      * Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary to stop
81      * the bundle. In general, this method should undo the work that the BundleActivator.start method started. There
82      * should be no active threads that were started by this bundle when this bundle returns. A stopped bundle must not
83      * call any Framework objects.
84      * <p>
85      * This method must complete and return to its caller in a timely manner.
86      * </p>
87      *
88      * @param ctx
89      *            The execution context of the bundle being stopped.
90      * @throws java.lang.Exception
91      *             If this method throws an exception, the bundle is still marked as stopped, and the Framework will
92      *             remove the bundle's listeners, unregister all services registered by the bundle, and release all
93      *             services used by the bundle. *
94      * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
95      */
96     @Override
97     public void stop(BundleContext ctx) throws Exception {
98         LOG.info("Stopped Bundle " + getName());
99     }
100
101     public String getName() {
102         return "DMaaP Adapter";
103     }
104
105 }