當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。