package org.cagrid.gaards.authentication.client;
import java.io.InputStream;
import java.rmi.RemoteException;
import javax.xml.namespace.QName;
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.oasis.wsrf.properties.GetResourcePropertyResponse;
import org.globus.gsi.GlobusCredential;
import org.cagrid.gaards.authentication.stubs.AuthenticationServicePortType;
import org.cagrid.gaards.authentication.stubs.service.AuthenticationServiceAddressingLocator;
import org.cagrid.gaards.authentication.common.AuthenticationServiceI;
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 class AuthenticationServiceClient extends AuthenticationServiceClientBase implements AuthenticationServiceI {
public AuthenticationServiceClient(String url) throws MalformedURIException, RemoteException {
this(url,null);
}
public AuthenticationServiceClient(String url, GlobusCredential proxy) throws MalformedURIException, RemoteException {
super(url,proxy);
}
public AuthenticationServiceClient(EndpointReferenceType epr) throws MalformedURIException, RemoteException {
this(epr,null);
}
public AuthenticationServiceClient(EndpointReferenceType epr, GlobusCredential proxy) throws MalformedURIException, RemoteException {
super(epr,proxy);
}
public static void usage(){
System.out.println(AuthenticationServiceClient.class.getName() + " -url <service url>");
}
public static void main(String [] args){
System.out.println("Running the Grid Service Client");
try{
if(!(args.length < 2)){
if(args[0].equals("-url")){
AuthenticationServiceClient client = new AuthenticationServiceClient(args[1]);
// place client calls here if you want to use this main as a
// test....
} else {
usage();
System.exit(1);
}
} else {
usage();
System.exit(1);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
public gov.nih.nci.cagrid.opensaml.SAMLAssertion authenticateUser(org.cagrid.gaards.authentication.Credential credential) throws RemoteException, org.cagrid.gaards.authentication.faults.AuthenticationProviderFault, org.cagrid.gaards.authentication.faults.CredentialNotSupportedFault, org.cagrid.gaards.authentication.faults.InsufficientAttributeFault, org.cagrid.gaards.authentication.faults.InvalidCredentialFault {
synchronized(portTypeMutex){
configureStubSecurity((Stub)portType,"authenticateUser");
org.cagrid.gaards.authentication.stubs.AuthenticateUserRequest params = new org.cagrid.gaards.authentication.stubs.AuthenticateUserRequest();
org.cagrid.gaards.authentication.stubs.AuthenticateUserRequestCredential credentialContainer = new org.cagrid.gaards.authentication.stubs.AuthenticateUserRequestCredential();
credentialContainer.setCredential(credential);
params.setCredential(credentialContainer);
org.cagrid.gaards.authentication.stubs.AuthenticateUserResponse boxedResult = portType.authenticateUser(params);
return boxedResult.getAssertion();
}
}
public gov.nih.nci.cagrid.authentication.bean.SAMLAssertion authenticate(gov.nih.nci.cagrid.authentication.bean.Credential credential) throws RemoteException, gov.nih.nci.cagrid.authentication.stubs.types.InvalidCredentialFault, gov.nih.nci.cagrid.authentication.stubs.types.InsufficientAttributeFault, gov.nih.nci.cagrid.authentication.stubs.types.AuthenticationProviderFault {
synchronized(portTypeMutex){
configureStubSecurity((Stub)portType,"authenticate");
gov.nih.nci.cagrid.authentication.AuthenticateRequest params = new gov.nih.nci.cagrid.authentication.AuthenticateRequest();
gov.nih.nci.cagrid.authentication.AuthenticateRequestCredential credentialContainer = new gov.nih.nci.cagrid.authentication.AuthenticateRequestCredential();
credentialContainer.setCredential(credential);
params.setCredential(credentialContainer);
gov.nih.nci.cagrid.authentication.AuthenticateResponse boxedResult = portType.authenticate(params);
return boxedResult.getSAMLAssertion();
}
}
public org.oasis.wsrf.properties.GetMultipleResourcePropertiesResponse getMultipleResourceProperties(org.oasis.wsrf.properties.GetMultipleResourceProperties_Element params) throws RemoteException {
synchronized(portTypeMutex){
configureStubSecurity((Stub)portType,"getMultipleResourceProperties");
return portType.getMultipleResourceProperties(params);
}
}
public org.oasis.wsrf.properties.GetResourcePropertyResponse getResourceProperty(javax.xml.namespace.QName params) throws RemoteException {
synchronized(portTypeMutex){
configureStubSecurity((Stub)portType,"getResourceProperty");
return portType.getResourceProperty(params);
}
}
public org.oasis.wsrf.properties.QueryResourcePropertiesResponse queryResourceProperties(org.oasis.wsrf.properties.QueryResourceProperties_Element params) throws RemoteException {
synchronized(portTypeMutex){
configureStubSecurity((Stub)portType,"queryResourceProperties");
return portType.queryResourceProperties(params);
}
}
public org.cagrid.gaards.authentication.lockout.LockedUserInfo[] getLockedOutUsers() throws RemoteException {
synchronized(portTypeMutex){
configureStubSecurity((Stub)portType,"getLockedOutUsers");
org.cagrid.gaards.authentication.stubs.GetLockedOutUsersRequest params = new org.cagrid.gaards.authentication.stubs.GetLockedOutUsersRequest();
org.cagrid.gaards.authentication.stubs.GetLockedOutUsersResponse boxedResult = portType.getLockedOutUsers(params);
return boxedResult.getLockedUserInfo();
}
}
}