/*
 *Copyright (c) 2015, 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.identity.application.mgt;

import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException;
import org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig;
import org.wso2.carbon.identity.application.common.model.Property;
import org.wso2.carbon.identity.application.common.model.ServiceProvider;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 *
 */
public abstract class AbstractInboundAuthenticatorConfig {

    private final static String DEFAULT_TENANT_NAME = "carbon.super";

    /**
     *
     * @return
     */
    public abstract String getName();

    /**
     *
     * @return
     */
    public abstract String getType();

    /**
     *
     * @return
     */
    public abstract Property[] getConfigurationProperties();

    /**
     *
     * @param tenantDomain
     * @param spIssuer
     * @param propertyNames
     * @return
     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException
     */
    protected Map<String, String> getPropertyValues(String tenantDomain, String spIssuer, List<String> propertyNames)
            throws IdentityApplicationManagementException {

        ServiceProvider serviceProvider = ApplicationMgtSystemConfig.getInstance().getApplicationDAO()
                .getApplication(spIssuer, tenantDomain);

        if (serviceProvider == null) {
            throw new IdentityApplicationManagementException(
                    "No service provider exists in the provided tenant, with the given issuer id.");
        }

        Map<String, String> propKeyValueMap = new HashMap<String, String>();

        InboundAuthenticationRequestConfig[] inboundAuthReqConfigs = serviceProvider.getInboundAuthenticationConfig()
                .getInboundAuthenticationRequestConfigs();

        if (inboundAuthReqConfigs != null && inboundAuthReqConfigs.length > 0) {
            for (InboundAuthenticationRequestConfig authConfig : inboundAuthReqConfigs) {
                if (authConfig.getInboundAuthType().equals(getType())
                        && authConfig.getInboundAuthKey().equals(getName())) {
                    Property[] properties = authConfig.getProperties();
                    for (Property prop : properties) {
                        if (propertyNames.contains(prop.getName())) {
                            propKeyValueMap.put(prop.getName(), prop.getValue());
                        }
                    }
                }
            }
        }

        return propKeyValueMap;
    }
}
@@ -758,380 +758,22 @@
 mon.
-IdentityApplicationManagementException;%0Aimport org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig;%0Aimport org.wso2.carbon.identity.application.common.model.Property;%0Aimport org.wso2.carbon.identity.application.common.model.ServiceProvider;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map
+model.Property
 ;%0A%0A/
@@ -849,79 +849,8 @@
  %7B%0A%0A
-    private final static String DEFAULT_TENANT_NAME = %22carbon.super%22;%0A%0A
     
@@ -1103,1756 +1103,5 @@
 );%0A%0A
-    /**%0A     *%0A     * @param tenantDomain%0A     * @param spIssuer%0A     * @param propertyNames%0A     * @return%0A     * @throws org.wso2.carbon.identity.application.common.IdentityApplicationManagementException%0A     */%0A    protected Map%3CString, String%3E getPropertyValues(String tenantDomain, String spIssuer, List%3CString%3E propertyNames)%0A            throws IdentityApplicationManagementException %7B%0A%0A        ServiceProvider serviceProvider = ApplicationMgtSystemConfig.getInstance().getApplicationDAO()%0A                .getApplication(spIssuer, tenantDomain);%0A%0A        if (serviceProvider == null) %7B%0A            throw new IdentityApplicationManagementException(%0A                    %22No service provider exists in the provided tenant, with the given issuer id.%22);%0A        %7D%0A%0A        Map%3CString, String%3E propKeyValueMap = new HashMap%3CString, String%3E();%0A%0A        InboundAuthenticationRequestConfig%5B%5D inboundAuthReqConfigs = serviceProvider.getInboundAuthenticationConfig()%0A                .getInboundAuthenticationRequestConfigs();%0A%0A        if (inboundAuthReqConfigs != null && inboundAuthReqConfigs.length %3E 0) %7B%0A            for (InboundAuthenticationRequestConfig authConfig : inboundAuthReqConfigs) %7B%0A                if (authConfig.getInboundAuthType().equals(getType())%0A                        && authConfig.getInboundAuthKey().equals(getName())) %7B%0A                    Property%5B%5D properties = authConfig.getProperties();%0A                    for (Property prop : properties) %7B%0A                        if (propertyNames.contains(prop.getName())) %7B%0A                            propKeyValueMap.put(prop.getName(), prop.getValue());%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A%0A        return propKeyValueMap;%0A    %7D%0A
 %7D

Change getProperties method