/*
*  Copyright (c) 2005-2010, 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.provider.openid.admin.ui.client;

import java.util.ArrayList;

import org.apache.axis2.AxisFault;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.identity.provider.openid.admin.stub.OpenIDConfigurationServiceStub;
import org.wso2.carbon.identity.provider.openid.admin.stub.dto.OpenIDConfigurationDTO;

public class OpenIDConfigurationClient {

    private OpenIDConfigurationServiceStub stub;
    private static final Log log = LogFactory.getLog(OpenIDConfigurationClient.class);

    /**
     * Instantiates RelyingPartyServiceClient
     * 
     * @param cookie
     *            For session management
     * @param backendServerURL
     *            URL of the back end server where UserRegistrationAdminService is running.
     * @param configCtx
     *            ConfigurationContext
     * @throws org.apache.axis2.AxisFault
     *             if error occurs when instantiating the stub
     */
    public OpenIDConfigurationClient(String cookie, String backendServerURL,
            ConfigurationContext configCtx) throws AxisFault {
        String serviceURL = backendServerURL + "OpenIDConfigurationService";
        stub = new OpenIDConfigurationServiceStub(configCtx, serviceURL);
        ServiceClient client = stub._getServiceClient();
        Options option = client.getOptions();
        option.setManageSession(true);
        option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
    }

    public void createOrUpdateOpenIDAdmin(OpenIDConfigurationDTO dto) throws AxisFault {
        try {
            stub.createOrUpdateOpenIDCOnfiguration(dto);
        } catch (Exception e) {
            throw new AxisFault(e.getMessage(), e);
        }
    }
    
    public OpenIDConfigurationDTO getOpenIDAdmin(String userName,String domainName) throws AxisFault {
        try {
            return stub.getOpenIDConfiguration(userName, domainName);
        } catch (Exception e) {
            throw new AxisFault(e.getMessage(), e);
        }
    }

}
@@ -751,39 +751,8 @@
 %0D%0A%0D%0A
-import java.util.ArrayList;%0D%0A%0D%0A
 impo
@@ -1243,58 +1243,8 @@
 %0D%0A%0D%0A
-    private OpenIDConfigurationServiceStub stub;%0D%0A
     
@@ -1326,16 +1326,66 @@
 class);%0D
+%0A    private OpenIDConfigurationServiceStub stub;%0D
 %0A%0D%0A    /
@@ -1441,17 +1441,16 @@
 %0D%0A     *
- 
 %0D%0A     *
@@ -1463,25 +1463,16 @@
 m cookie
-%0D%0A     * 
         
@@ -1528,35 +1528,16 @@
 erverURL
-%0D%0A     *           
  URL of 
@@ -1627,28 +1627,16 @@
 onfigCtx
-%0D%0A     *    
         
@@ -1702,28 +1702,8 @@
 ault
-%0D%0A     *            
  if 
@@ -1831,16 +1831,41 @@
 erURL,%0D%0A
+                         
         
@@ -2592,20 +2592,16 @@
 %0A    %7D%0D%0A
-    
 %0D%0A    pu
@@ -2659,16 +2659,17 @@
 serName,
+ 
 String d

reformat code