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


Java FaultUtil类代码示例

本文整理汇总了Java中gov.nih.nci.cagrid.common.FaultUtil的典型用法代码示例。如果您正苦于以下问题:Java FaultUtil类的具体用法?Java FaultUtil怎么用?Java FaultUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FaultUtil类属于gov.nih.nci.cagrid.common包,在下文中一共展示了FaultUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runStep

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
@Override
public void runStep() throws Throwable {
	assertNotNull(this.credential);
	assertNotNull(this.credential.getGridCredential());
	assertNotNull(this.delegatedCredential);
	assertNotNull(this.delegatedCredential
			.getDelegatedCredentialReference());
	DelegatedCredentialUserClient client = new DelegatedCredentialUserClient(
			this.delegatedCredential.getDelegatedCredentialReference(),
			this.credential.getGridCredential());
	client.suspend();

	try {
		client.getDelegatedCredential();
		fail("Should not be able to get a delegated credential that was suspended.");
	} catch (Exception e) {
		if (Utils.getExceptionMessage(e).indexOf(
				"org.globus.wsrf.NoSuchResourceException") == -1) {
			FaultUtil.printFault(e);
			fail("Should get a NoSuchResourceException when trying to get a suspended credential.");
		}
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:24,代码来源:SuspendDelegatedCredentialStep.java

示例2: addAdmin

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
private void addAdmin() {
    try {
        getProgressPanel().showProgress("Adding administrator...");
        getAddAdminButton().setEnabled(false);
        getFindUserButton().setEnabled(false);
        DelegationAdminClient client = this.session.getAdminClient();
        String admin = Utils.clean(getGridIdentity().getText());
        if (admin != null) {
            client.addAdmin(admin);
            dispose();
        } else {
            ErrorDialog.showError("Please specify an admin to add.");
            getProgressPanel().stopProgress("Error");
        }

    } catch (Exception e) {
        ErrorDialog.showError(e);
        FaultUtil.logFault(log, e);
        getProgressPanel().stopProgress("Error");
    } finally {
        getAddAdminButton().setEnabled(true);
        getFindUserButton().setEnabled(true);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:AddAdminWindow.java

示例3: getSerializedCredentialRef

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
private String getSerializedCredentialRef(
		DelegatedCredentialReference delegatedCredentialReference)
		throws AuthenticationConfigurationException {
	String serializedDelegatedCredentialReference = null;
	try {
		StringWriter stringWriter = new StringWriter();
		Utils.serializeObject(
				delegatedCredentialReference,
				new QName(
						"http://cds.gaards.cagrid.org/CredentialDelegationService/DelegatedCredential/types",
						"DelegatedCredentialReference"), stringWriter,
				DelegationUserClient.class.getResourceAsStream("client-config.wsdd"));
		serializedDelegatedCredentialReference = stringWriter.toString();
	} catch (Exception e) {
		log.error(FaultUtil.printFaultToString(e));
		throw new AuthenticationConfigurationException(
				"Unable to serialize the message Delegated Credentials: "
						+ FaultUtil.printFaultToString(e), e);
	}
	return serializedDelegatedCredentialReference;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:GridCredentialDelegatorImpl.java

示例4: getDelegationUserClient

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
private DelegationUserClient getDelegationUserClient(
		GlobusCredential globusCredential)
		throws AuthenticationConfigurationException {
	DelegationUserClient client = null;
	try {
		client = new DelegationUserClient(
				this.credentialDelegationServiceInformation.getServiceURL(),
				globusCredential);

		if (Utils.clean(credentialDelegationServiceInformation
				.getServiceIdentity()) != null) {
			IdentityAuthorization auth = new IdentityAuthorization(
					credentialDelegationServiceInformation
							.getServiceIdentity());
			client.setAuthorization(auth);
		}
	} catch (Exception e) {
		log.error(FaultUtil.printFaultToString(e));
		throw new AuthenticationConfigurationException(
				"Error accessing the Delegation Service : "
						+ e.getMessage(), e);
	}
	return client;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:GridCredentialDelegatorImpl.java

示例5: addGridGrouper

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
public void addGridGrouper(final String uri, final GlobusCredential cred) {
	Runner runner = new Runner() {
		public void execute() {
			try {
				GridGrouper grouper = new GridGrouper(uri, cred);
				rootNode.addGridGrouper(grouper);
			} catch (Exception e) {
				ErrorDialog.showError(e);
				FaultUtil.logFault(log, e);
			}
		}
	};
	try {
		GridApplication.getContext().executeInBackground(runner);
	} catch (Exception t) {
		t.getMessage();
	}

}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:20,代码来源:GridGrouperTree.java

示例6: doesUserExist

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method allows a client to determine whether or not a user id is
 * already registered with the Dorian Identity Provider.
 * 
 * @param userId
 *            The user id to determine whether or not is registered.
 * @return True is returned a user with the user id is registered with the
 *         Dorian Identity Provider, otherwise False is returned.
 * @throws DorianFault
 * @throws DorianInternalFault
 */
public boolean doesUserExist(String userId) throws DorianFault, DorianInternalFault {
    try {
        return getClient().doesLocalUserExist(userId);
    } catch (DorianInternalFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:27,代码来源:LocalAdministrationClient.java

示例7: findUsers

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This methods returns the list of users registered with the Dorian
 * Identity Provider meeting the specified search criteria.
 * 
 * @param filter
 *            The search criteria specifying the users to find.
 * @return The list of users found meeting the search criteria.
 * @throws DorianFault
 * @throws DorianInternalFault
 * @throws PermissionDeniedFault
 */
public List<LocalUser> findUsers(LocalUserFilter filter) throws DorianFault, DorianInternalFault,
    PermissionDeniedFault {
    try {
        List<LocalUser> list = Utils.asList(getClient().findLocalUsers(filter));
        return list;
    } catch (DorianInternalFault gie) {
        throw gie;
    } catch (PermissionDeniedFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:31,代码来源:LocalAdministrationClient.java

示例8: removeUser

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method deletes a user account in the Dorian Identity Provider.
 * 
 * @param userId
 *            The user id of the account to be deleted.
 * @throws DorianFault
 * @throws DorianInternalFault
 * @throws PermissionDeniedFault
 */
public void removeUser(String userId) throws DorianFault, DorianInternalFault, PermissionDeniedFault {
    try {
        getClient().removeLocalUser(userId);
    } catch (DorianInternalFault gie) {
        throw gie;
    } catch (PermissionDeniedFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }

}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:28,代码来源:LocalAdministrationClient.java

示例9: doesUserExist

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method allows a client to determine whether or not a user id is
 * already registered with the Dorian Identity Provider.
 * 
 * @param userId
 *            The user id to determine whether or not is registered.
 * @return True is returned a user with the user id is registered with the
 *         Dorian Identity Provider, otherwise False is returned.
 * @throws DorianFault
 * @throws DorianInternalFault
 */

public boolean doesUserExist(String userId) throws DorianFault, DorianInternalFault {
    try {
        return getClient().doesLocalUserExist(userId);
    } catch (DorianInternalFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:28,代码来源:LocalUserClient.java

示例10: register

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method allow a client to apply for a user account with the Dorian
 * Identity Provider.
 * 
 * @param a
 *            The user application.
 * @return A message regarding the status of the application.
 * @throws DorianFault
 * @throws DorianInternalFault
 * @throws InvalidUserPropertyFault
 */
public String register(Application a) throws DorianFault, DorianInternalFault, InvalidUserPropertyFault {
    try {
        String version = getServiceVersion();
        if (version.equals(VERSION_1_0) || version.equals(VERSION_1_1) || version.equals(VERSION_1_2)
            || version.equals(VERSION_UNKNOWN)) {
            return getClient().registerWithIdP(a);
        } else {
            return getClient().registerLocalUser(a);
        }
    } catch (DorianInternalFault gie) {
        throw gie;
    } catch (InvalidUserPropertyFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:35,代码来源:LocalUserClient.java

示例11: getOwnedHostCertificates

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method returns a list for all the host certificates owned by the
 * user.
 * 
 * @return The list of host certificates owned by the user.
 * @throws DorianFault
 * @throws DorianInternalFault
 * @throws PermissionDeniedFault
 */
public List<HostCertificateRecord> getOwnedHostCertificates() throws DorianFault, DorianInternalFault,
    PermissionDeniedFault {
    try {
        List<HostCertificateRecord> list = Utils.asList(getClient().getOwnedHostCertificates());
        return list;
    } catch (DorianInternalFault gie) {
        throw gie;
    } catch (PermissionDeniedFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }

}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:30,代码来源:GridUserClient.java

示例12: getCACertificate

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method obtains Dorian's CA certificate.
 * 
 * @return This method obtains Dorian's CA certificate.
 * @throws DorianFault
 * @throws DorianInternalFault
 */

public X509Certificate getCACertificate() throws DorianFault, DorianInternalFault {
    try {
        return CertUtil.loadCertificate(getClient().getCACertificate().getCertificateAsString());
    } catch (DorianInternalFault gie) {
        throw gie;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:24,代码来源:GridUserClient.java

示例13: getUserPolicies

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method returns the list of IdP user policies supported by Dorian.
 * 
 * @return The list of IdP user policies supported by Dorian.
 * @throws DorianFault
 * @throws PermissionDeniedFault
 * @throws DorianInternalFault
 */
public List<GridUserPolicy> getUserPolicies() throws DorianFault, PermissionDeniedFault, DorianInternalFault {
    try {
        List<GridUserPolicy> list = Utils.asList(getClient().getGridUserPolicies());
        return list;
    } catch (DorianInternalFault gie) {
        throw gie;
    } catch (PermissionDeniedFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:27,代码来源:GridAdministrationClient.java

示例14: removeAdmin

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method revokes a user's privilege to administrate grid accounts.
 * 
 * @param gridIdentity
 *            The Grid identity of the user to revoke privileges.
 * @throws DorianFault
 * @throws DorianInternalFault
 * @throws PermissionDeniedFault
 */
public void removeAdmin(java.lang.String gridIdentity) throws DorianFault, DorianInternalFault,
    PermissionDeniedFault {
    try {
        getClient().removeAdmin(gridIdentity);
    } catch (DorianInternalFault gie) {
        throw gie;
    } catch (PermissionDeniedFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }

}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:29,代码来源:GridAdministrationClient.java

示例15: getAdmins

import gov.nih.nci.cagrid.common.FaultUtil; //导入依赖的package包/类
/**
 * This method obtains a list of all the users with privileges to
 * administrate Grid accounts.
 * 
 * @return A list containing the grid identities of users whom have the
 *         privilege to administrate Grid accounts.
 * @throws DorianFault
 * @throws DorianInternalFault
 * @throws PermissionDeniedFault
 */

public List<String> getAdmins() throws DorianFault, DorianInternalFault, PermissionDeniedFault {
    try {
        List<String> list = Utils.asList(getClient().getAdmins());
        return list;
    } catch (DorianInternalFault gie) {
        throw gie;
    } catch (PermissionDeniedFault f) {
        throw f;
    } catch (Exception e) {
        FaultUtil.printFault(e);
        DorianFault fault = new DorianFault();
        fault.setFaultString(Utils.getExceptionMessage(e));
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:30,代码来源:GridAdministrationClient.java


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