git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@14816 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8fbbf80a6e
commit
b2e03278d6
|
@ -3,8 +3,14 @@ package org.gcube.application.framework.core.security;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import javax.xml.rpc.ServiceException;
|
||||
|
||||
import org.gcube.application.framework.core.util.Settings;
|
||||
import org.gcube.vomanagement.vomsAdmin.impl.VOMSAdminImpl;
|
||||
import org.gcube.vomanagement.vomsapi.ExtendedVOMSAdmin;
|
||||
import org.gcube.vomanagement.vomsapi.VOMSAdmin;
|
||||
import org.gcube.vomanagement.vomsapi.impl.VOMSAPIConfiguration;
|
||||
import org.gcube.vomanagement.vomsapi.impl.VOMSAPIConfigurationException;
|
||||
import org.gcube.vomanagement.vomsapi.impl.VOMSAPIFactory;
|
||||
|
||||
/**
|
||||
* @author Valia Tsagkalidou (NKUA)
|
||||
|
@ -15,29 +21,94 @@ public class VOMSAdminManager {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
protected static VOMSAdminImpl vomsAdmin= null;
|
||||
protected static VOMSAPIFactory factory = null;
|
||||
protected static VOMSAdmin vomsAdmin = null;
|
||||
protected static ExtendedVOMSAdmin extendedVomsAdmin = null;
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public static VOMSAdminImpl getVOMSAdmin()
|
||||
public static VOMSAPIFactory getVOMSFactory()
|
||||
{
|
||||
if(vomsAdmin == null)
|
||||
if(factory == null)
|
||||
{
|
||||
try {
|
||||
System.out.println("I am in ASL and I am creating vomsAdmin - location should be printed");
|
||||
System.out.println("The location is: " + Settings.getInstance().getProperty("sharedDir") + File.separator + "vomsAPI.properties");
|
||||
// must be uncomented!!!!!
|
||||
vomsAdmin = new VOMSAdminImpl(Settings.getInstance().getProperty("sharedDir")+ File.separator + "vomsAPI.properties");
|
||||
|
||||
// this is wrong
|
||||
// vomsAdmin = new VOMSAdminImpl();
|
||||
//vomsAdmin = new VOMSAdminImpl(Settings.getInstance().getProperty("sharedDir")+ File.separator + "vomsAPI.properties");
|
||||
factory = new VOMSAPIFactory(new VOMSAPIConfiguration(new File(Settings.getInstance().getProperty("sharedDir")+ File.separator + "vomsAPI.properties")));
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
|
||||
|
||||
public static VOMSAdmin getVOMSAdmin() {
|
||||
if (vomsAdmin == null) {
|
||||
if (factory == null) {
|
||||
try {
|
||||
System.out.println("I am in ASL and I am creating vomsAdmin - location should be printed");
|
||||
System.out.println("The location is: " + Settings.getInstance().getProperty("sharedDir") + File.separator + "vomsAPI.properties");
|
||||
// must be uncomented!!!!!
|
||||
//vomsAdmin = new VOMSAdminImpl(Settings.getInstance().getProperty("sharedDir")+ File.separator + "vomsAPI.properties");
|
||||
factory = new VOMSAPIFactory(new VOMSAPIConfiguration(new File(Settings.getInstance().getProperty("sharedDir")+ File.separator + "vomsAPI.properties")));
|
||||
|
||||
vomsAdmin = factory.getVOMSAdmin();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
vomsAdmin = factory.getVOMSAdmin();
|
||||
} catch (VOMSAPIConfigurationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ServiceException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return vomsAdmin;
|
||||
}
|
||||
|
||||
|
||||
public static ExtendedVOMSAdmin getExtendedVomsAdmin() {
|
||||
if (extendedVomsAdmin == null) {
|
||||
if (factory == null) {
|
||||
try {
|
||||
System.out.println("I am in ASL and I am creating vomsAdmin - location should be printed");
|
||||
System.out.println("The location is: " + Settings.getInstance().getProperty("sharedDir") + File.separator + "vomsAPI.properties");
|
||||
// must be uncomented!!!!!
|
||||
//vomsAdmin = new VOMSAdminImpl(Settings.getInstance().getProperty("sharedDir")+ File.separator + "vomsAPI.properties");
|
||||
factory = new VOMSAPIFactory(new VOMSAPIConfiguration(new File(Settings.getInstance().getProperty("sharedDir")+ File.separator + "vomsAPI.properties")));
|
||||
|
||||
extendedVomsAdmin = factory.getExtendedVOMSAdmin();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
extendedVomsAdmin = factory.getExtendedVOMSAdmin();
|
||||
} catch (VOMSAPIConfigurationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ServiceException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return extendedVomsAdmin;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue