/*
 * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you 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.
 */

package org.wso2.carbon.uuf.internal.deployment;

import org.wso2.carbon.uuf.spi.HttpConnector;

import java.util.Map;
import java.util.Set;

/**
 * A notifier that notify app deployment event to others.
 *
 * @since 1.0.0
 */
public abstract class DeploymentNotifier {

    /**
     * Returns the HTTP connectors that need to notified.
     *
     * @return HTTP connectors
     */
    protected abstract Set<HttpConnector> getHttpConnectors();

    /**
     * Notifies all the HTTP connectors that the specified apps are available now.
     *
     * @param deployedApps context paths of deployed apps, key = app name and value = context path
     * @see #getHttpConnectors()
     */
    public void notify(Map<String, String> deployedApps) {
        for (HttpConnector httpConnector : getHttpConnectors()) {
            for (Map.Entry<String, String> appNameContextPath : deployedApps.entrySet()) {
                httpConnector.registerApp(appNameContextPath.getKey(), appNameContextPath.getValue());
            }
        }
    }
}

@@ -730,65 +730,41 @@
 org.
-wso2.carbon.uuf.spi.HttpConnector;%0A%0Aimport java.util.Map;
+apache.commons.lang3.tuple.Pair;%0A
 %0Aimp
@@ -777,18 +777,19 @@
 va.util.
-Se
+Lis
 t;%0A%0A/**%0A
@@ -880,22 +880,17 @@
 lic 
-abstract class
+interface
  Dep
@@ -927,221 +927,71 @@
   * 
-Returns the HTTP connectors that need to notified.%0A     *%0A     * @return HTTP connectors%0A     */%0A    protected abstract Set%3CHttpConnector%3E getHttpConnectors();%0A%0A    /**%0A     * Notifies all the HTTP connectors that
+Notifies relevant components/services about the availability of
  the
@@ -1009,26 +1009,8 @@
 apps
- are available now
 .%0A  
@@ -1032,79 +1032,38 @@
 ram 
-deployedApps c
+appNamesC
 ontext
- p
+P
 aths 
-of deployed apps, key = app 
 name
+s
  and
- value =
  con
@@ -1075,41 +1075,31 @@
 path
-%0A     * @see #getHttpConnectors()
+s of the available apps
 %0A   
@@ -1107,23 +1107,16 @@
  */%0A    
-public 
 void not
@@ -1123,136 +1123,17 @@
 ify(
-Map%3CString, String%3E deployedApps) %7B%0A        for (HttpConnector httpConnector : getHttpConnectors()) %7B%0A            for (Map.Entry
+List%3CPair
 %3CStr
@@ -1144,24 +1144,25 @@
  String%3E
+%3E
  appName
 ContextP
@@ -1145,32 +1145,33 @@
 String%3E%3E appName
+s
 ContextPath : de
@@ -1169,169 +1169,10 @@
 Path
- : deployedApps.entrySet()) %7B%0A                httpConnector.registerApp(appNameContextPath.getKey(), appNameContextPath.getValue());%0A            %7D%0A        %7D%0A    %7D
+s);
 %0A%7D%0A

convert DeploymentNotifier abstract class to an interface