当前位置: 首页>>代码示例>>Java>>正文


Java ProxyUtil.getDefaultProxy方法代码示例

本文整理汇总了Java中gov.nih.nci.cagrid.common.security.ProxyUtil.getDefaultProxy方法的典型用法代码示例。如果您正苦于以下问题:Java ProxyUtil.getDefaultProxy方法的具体用法?Java ProxyUtil.getDefaultProxy怎么用?Java ProxyUtil.getDefaultProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nih.nci.cagrid.common.security.ProxyUtil的用法示例。


在下文中一共展示了ProxyUtil.getDefaultProxy方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: register

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
private void register() {
    try {
        getRegister().setEnabled(false);
        getProgress().showProgress("Registering for tutorial....");
        PhotoSharingRegistrationClient client = new PhotoSharingRegistrationClient(
            org.cagrid.tutorials.photosharing.Utils.getRegistrationService(), ProxyUtil.getDefaultProxy());
        client.registerPhotoSharingService(CertUtil.subjectToIdentity(getHostCertificates()
            .getSelectedHostCertificate().getSubject()));
        getProgress().stopProgress();
        getRegister().setEnabled(true);
        dispose();
        GridApplication.getContext().showMessage(
            "Congratulations you have successfully registered for the photo sharing tutorial.");
    } catch (Exception e) {
        getProgress().stopProgress();
        ErrorDialog.showError(Utils.getExceptionMessage(e), e);
        getRegister().setEnabled(true);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:20,代码来源:RegistrationWindow.java

示例2: getLocalCredential

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
public static GlobusCredential getLocalCredential(String currentProxyFile) throws Exception 
{
	GlobusCredential credential = null;
	if(currentProxyFile!=null)
	{
		credential = ProxyUtil.loadProxy(currentProxyFile);			
	}
	else
	{
		credential = ProxyUtil.getDefaultProxy();
	}
	if(credential == null)
	{
		throw new Exception("Unable to get the local credential. \nPlease creat a valid proxy in the default location \nor give a path to the proxy file.");
	}
	return credential;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:18,代码来源:TavernaWorkflowServiceClient.java

示例3: getProxyIdentity

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
public String getProxyIdentity() {
    if (getProxy() != null) {
        return getProxy().getIdentity();
    } else if (!isAnonymousPrefered()) {
        try {
            GlobusCredential cred = ProxyUtil.getDefaultProxy();
            if (cred.getTimeLeft() > 0) {
                return cred.getIdentity();
            }
        } catch (Exception e) {
            // TODO: handle exception
        }
        return null;
    } else {
        return null;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:18,代码来源:GridGrouperClient.java

示例4: GridGrouperExpressionEditor

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
public GridGrouperExpressionEditor(List gridGrouperURIs,
		boolean loadOnStartup, MembershipExpression expression) {
	super();
	this.gridGrouperURIs = gridGrouperURIs;
	this.expression = expression;
	initialize();
	if ((loadOnStartup) && (gridGrouperURIs != null)
			&& (gridGrouperURIs.size() > 0)) {
		GlobusCredential cred = null;
		try {
			cred = ProxyUtil.getDefaultProxy();
			if (cred.getTimeLeft() <= 0) {
				cred = null;
			}
		} catch (Exception e) {

		}
		this.getGrouperTree().addGridGrouper(
				(String) gridGrouperURIs.get(0), cred);
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:GridGrouperExpressionEditor.java

示例5: findMyDelegatedCredentials

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
/**
 * This method allows a user to find credentials that they delegated.
 * 
 * @param filter
 *            Search criteria to use in finding delegated credentials
 * @return A list of records each representing a credential delegated by the
 *         user
 * @throws RemoteException
 * @throws CDSInternalFault
 * @throws DelegationInternalFault
 * @throws PermissionDeniedFault
 */

public List<DelegationRecord> findMyDelegatedCredentials(
		DelegationRecordFilter filter) throws RemoteException,
		CDSInternalFault, DelegationFault, PermissionDeniedFault {
	if (filter == null) {
		filter = new DelegationRecordFilter();
	}
	if (cred != null) {
		filter.setGridIdentity(cred.getIdentity());
	} else {
		try {
			GlobusCredential c = ProxyUtil.getDefaultProxy();
			if (c != null) {
				filter.setGridIdentity(c.getIdentity());
			}
		} catch (Exception e) {
			DelegationFault f = new DelegationFault();
			f.setFaultString(e.getMessage());
			throw f;
		}
	}

	if (filter.getGridIdentity() == null) {
		throw Errors
				.getPermissionDeniedFault(Errors.AUTHENTICATION_REQUIRED);
	}

	DelegationRecord[] records = client.findDelegatedCredentials(filter);
	if (records == null) {
		return new ArrayList<DelegationRecord>();
	} else {
		List<DelegationRecord> list = Arrays.asList(records);
		return list;
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:48,代码来源:DelegationUserClient.java

示例6: AccountProfileWindow

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
/**
 * This is the default constructor
 */
public AccountProfileWindow() {
    super();
    try {

        GlobusCredential cred = ProxyUtil.getDefaultProxy();
        X509CredentialEntry defaultCredential = CredentialEntryFactory.getEntry(cred);
        defaultCredential = CredentialManager.getInstance().setDefaultCredential(defaultCredential);
        if (defaultCredential instanceof DorianUserCredentialEntry) {
            DorianUserCredentialEntry entry = (DorianUserCredentialEntry) defaultCredential;
            DorianHandle handle = ServicesManager.getInstance().getDorianHandle(entry.getDorianURL());
            if (handle == null) {
                throw new Exception("Cannot determine the connection information for " + entry.getDorianURL() + ".");
            }
            this.session = new DorianSession(handle, entry.getCredential());
            this.profile = this.session.getLocalUserClient().getAccountProfile();
            this.modificationAllowed = session.getHandle().localAccountModification();
        } else {
            throw new Exception("The account manager for your credential could not be determined.");
        }
    } catch (Exception e) {
        ErrorDialog.showError(e);
        FaultUtil.logFault(log, e);
        dispose();
    }
    initialize();
    this.setFrameIcon(DorianLookAndFeel.getUserIcon());
    setActiveComponents(true);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:32,代码来源:AccountProfileWindow.java

示例7: handleDefaultCredential

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
public void handleDefaultCredential(boolean setSelected) {
    X509CredentialEntry defaultCredential = null;
    try {
        GlobusCredential cred = ProxyUtil.getDefaultProxy();
        defaultCredential = CredentialEntryFactory.getEntry(cred);
        defaultCredential = CredentialManager.getInstance().setDefaultCredential(defaultCredential);

    } catch (Exception ex) {

    }
    populateList();
    if ((setSelected) && (defaultCredential != null)) {
        setSelectedItem(defaultCredential);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:16,代码来源:CredentialComboBox.java

示例8: PhotoSharingHandle

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
public PhotoSharingHandle(ServiceDescriptor des) throws Exception {
    super(des);
    cred = ProxyUtil.getDefaultProxy();
    client = new PhotoSharingClient(des.getServiceURL(), cred);
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:6,代码来源:PhotoSharingHandle.java

示例9: DelegationUserClient

import gov.nih.nci.cagrid.common.security.ProxyUtil; //导入方法依赖的package包/类
public DelegationUserClient(String url) throws Exception {
	this(url, ProxyUtil.getDefaultProxy());
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:4,代码来源:DelegationUserClient.java


注:本文中的gov.nih.nci.cagrid.common.security.ProxyUtil.getDefaultProxy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。