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


Java GlobusCredential.getIdentity方法代码示例

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


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

示例1: check

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
public void check(GlobusCredential credential, Throwable error)
		throws Exception {
	if (error != null) {
		throw new Exception(
				"The following error was received when one was NOT expected: "
						+ error.getMessage(), error);
	}
	if (credential == null) {
		throw new Exception(
				"No grid credential received when one was expected.");
	}
	if ((expectedGridIdentity != null)
			&& (!credential.getIdentity().equals(expectedGridIdentity))) {
		throw new Exception("A credential with the identity "
				+ credential.getIdentity()
				+ " was received when a credential with the identity "
				+ expectedGridIdentity + " was expected.");
	}
	credential.verify();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:SuccessfullGridCredentialRequest.java

示例2: getProxyIdentity

import org.globus.gsi.GlobusCredential; //导入方法依赖的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

示例3: GlobusGSSCredentialImpl

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
/**
    * Creates regular credential from specified
    * GlobusCredential object.
    *
    * @param cred the credential
    * @param usage credential usage
    */
   public GlobusGSSCredentialImpl(GlobusCredential cred,
			   int usage) 
throws GSSException {
if (cred == null) {
    throw new IllegalArgumentException("cred == null");
}

this.cred = cred;
this.usage = usage;
this.name = new GlobusGSSName(cred.getIdentity());
   }
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:19,代码来源:GlobusGSSCredentialImpl.java

示例4: getTestUserId

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
private String getTestUserId() {
    String id = null;
    try {
        File proxyFile = new File(serviceContainer.getCertificatesDirectory(), USER_PROXY_FILE);
        GlobusCredential cred = new GlobusCredential(proxyFile.getAbsolutePath());
        id = cred.getIdentity();
        LOG.debug("Test user identity determined to be " + id);
    } catch (Exception ex) {
        ex.printStackTrace();
        fail("Error obtaining test user proxy: " + ex.getMessage());
    }
    return id;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:14,代码来源:ChangeCsmUserInDatabaseStep.java

示例5: checkUpdateIdPs

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
private void checkUpdateIdPs() {
	try {
		query.setEnabled(false);
		getIdp().hidePopup();
		final String serviceUrl = getSession().getServiceURI();
		final GlobusCredential cred = getSession().getCredential();
		if ((serviceUrl.equals(this.lastService))
				&& (cred.getIdentity().equals(this.lastGridIdentity))) {
			getIdp().showPopup();
			return;
		} else {
			this.lastService = serviceUrl;
			this.lastGridIdentity = cred.getIdentity();

			Runner runner = new Runner() {
				public void execute() {
					updateIdPs(serviceUrl, cred);
				}
			};
			try {
				GridApplication.getContext().executeInBackground(runner);
			} catch (Exception t) {
				t.getMessage();
			}

		}
	} catch (Exception e) {
		ErrorDialog.showError(e);
		FaultUtil.logFault(log, e);
	} finally {
		query.setEnabled(true);
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:34,代码来源:UserSearchDialog.java

示例6: checkUpdateIdPs

import org.globus.gsi.GlobusCredential; //导入方法依赖的package包/类
private void checkUpdateIdPs() {
    try {
        getIdp().hidePopup();
        final String serviceUrl = getSession().getServiceURI();
        final GlobusCredential cred = getSession().getCredential();
        if ((serviceUrl.equals(this.lastService)) && (cred.getIdentity().equals(this.lastGridIdentity))) {
            getIdp().showPopup();
            return;
        } else {
            this.lastService = serviceUrl;
            this.lastGridIdentity = cred.getIdentity();

            Runner runner = new Runner() {
                public void execute() {
                    updateIdPs(serviceUrl, cred);
                }
            };
            try {
                GridApplication.getContext().executeInBackground(runner);
            } catch (Exception t) {
            	FaultUtil.logFault(log, t);
            }

        }
    } catch (Exception e) {
        ErrorDialog.showError(e);
        FaultUtil.logFault(log, e);
        idpFindError = true;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:31,代码来源:UserManagerWindow.java


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