package gov.nih.nci.cagrid.ncia.client;

import java.io.InputStream;
import java.rmi.RemoteException;

import javax.xml.namespace.QName;

import java.util.Calendar;
import java.util.List;

import org.apache.axis.EngineConfiguration;
import org.apache.axis.client.AxisClient;
import org.apache.axis.client.Stub;
import org.apache.axis.configuration.FileProvider;
import org.apache.axis.message.addressing.EndpointReferenceType;
import org.apache.axis.types.URI.MalformedURIException;

import org.globus.gsi.GlobusCredential;

import org.globus.wsrf.NotifyCallback;
import org.globus.wsrf.NotificationConsumerManager;
import org.globus.wsrf.container.ContainerException;

import org.oasis.wsrf.lifetime.ImmediateResourceTermination;
import org.oasis.wsrf.lifetime.WSResourceLifetimeServiceAddressingLocator;

import gov.nih.nci.cagrid.ncia.stubs.NCIACoreServicePortType;
import gov.nih.nci.cagrid.ncia.stubs.service.NCIACoreServiceAddressingLocator;
import gov.nih.nci.cagrid.ncia.common.NCIACoreServiceI;
import gov.nih.nci.cagrid.introduce.security.client.ServiceSecurityClient;


/**
 * This class is autogenerated, DO NOT EDIT GENERATED GRID SERVICE ACCESS METHODS.
 *
 * This client is generated automatically by Introduce to provide a clean unwrapped API to the
 * service.
 *
 * On construction the class instance will contact the remote service and retrieve it's security
 * metadata description which it will use to configure the Stub specifically for each method call.
 * 
 * @created by Introduce Toolkit version 1.3
 */
public abstract class NCIACoreServiceClientBase extends ServiceSecurityClient {	
	protected NCIACoreServicePortType portType;
	protected Object portTypeMutex;
    protected NotificationConsumerManager consumer = null;
    protected EndpointReferenceType consumerEPR = null;

	public NCIACoreServiceClientBase(String url, GlobusCredential proxy) throws MalformedURIException, RemoteException {
	   	super(url,proxy);
	   	initialize();
	}
	
	public NCIACoreServiceClientBase(EndpointReferenceType epr, GlobusCredential proxy) throws MalformedURIException, RemoteException {
	   	super(epr,proxy);
		initialize();
	}
	
	protected void initialize() throws RemoteException {
	    this.portTypeMutex = new Object();
		this.portType = createPortType();
	}

	protected NCIACoreServicePortType createPortType() throws RemoteException {

		NCIACoreServiceAddressingLocator locator = new NCIACoreServiceAddressingLocator();
		// attempt to load our context sensitive wsdd file
		InputStream resourceAsStream = getClass().getResourceAsStream("client-config.wsdd");
		if (resourceAsStream != null) {
			// we found it, so tell axis to configure an engine to use it
			EngineConfiguration engineConfig = new FileProvider(resourceAsStream);
			// set the engine of the locator
			locator.setEngine(new AxisClient(engineConfig));
		}
		NCIACoreServicePortType port = null;
		try {
			port = locator.getNCIACoreServicePortTypePort(getEndpointReference());
		} catch (Exception e) {
			throw new RemoteException("Unable to locate portType:" + e.getMessage(), e);
		}

		return port;
	}
	
    

}
@@ -47,98 +47,217 @@
 ort 
-java.io.InputStream;%0D%0Aimport java.rmi.RemoteException;%0D%0A%0D%0Aimport javax.xml.namespace.QName
+gov.nih.nci.cagrid.introduce.security.client.ServiceSecurityClient;%0D%0Aimport gov.nih.nci.cagrid.ncia.stubs.NCIACoreServicePortType;%0D%0Aimport gov.nih.nci.cagrid.ncia.stubs.service.NCIACoreServiceAddressingLocator
 ;%0D%0A%0D
@@ -273,21 +273,22 @@
 ava.
-util.Calendar
+io.InputStream
 ;%0D%0Ai
@@ -302,17 +302,27 @@
 ava.
-util.List
+rmi.RemoteException
 ;%0D%0A%0D
@@ -414,45 +414,8 @@
 t;%0D%0A
-import org.apache.axis.client.Stub;%0D%0A
 impo
@@ -577,34 +577,32 @@
 dURIException;%0D%0A
-%0D%0A
 import org.globu
@@ -629,50 +629,8 @@
 al;%0D
-%0A%0D%0Aimport org.globus.wsrf.NotifyCallback;%0D
 %0Aimp
@@ -683,480 +683,8 @@
 r;%0D%0A
-import org.globus.wsrf.container.ContainerException;%0D%0A%0D%0Aimport org.oasis.wsrf.lifetime.ImmediateResourceTermination;%0D%0Aimport org.oasis.wsrf.lifetime.WSResourceLifetimeServiceAddressingLocator;%0D%0A%0D%0Aimport gov.nih.nci.cagrid.ncia.stubs.NCIACoreServicePortType;%0D%0Aimport gov.nih.nci.cagrid.ncia.stubs.service.NCIACoreServiceAddressingLocator;%0D%0Aimport gov.nih.nci.cagrid.ncia.common.NCIACoreServiceI;%0D%0Aimport gov.nih.nci.cagrid.introduce.security.client.ServiceSecurityClient;%0D%0A
 %0D%0A%0D%0A

remove unused imports