本文整理汇总了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();
}
示例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;
}
}
示例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());
}
示例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;
}
示例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);
}
}
示例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;
}
}