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


Java FaultHelper.getFault方法代码示例

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


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

示例1: findHostCertificates

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
/**
 * Returns the list of host certificates meeting the specified search
 * criteria.
 * 
 * @param filter
 *            The search criteria.
 * @return The list of host certificates meeting the specified search
 *         criteria.
 * @throws DorianFault
 * @throws DorianInternalFault
 * @throws PermissionDeniedFault
 */
public List<HostCertificateRecord> findHostCertificates(HostCertificateFilter filter) throws DorianFault,
    DorianInternalFault, PermissionDeniedFault {
    try {
        List<HostCertificateRecord> list = Utils.asList(getClient().findHostCertificates(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,项目名称:cagrid2,代码行数:33,代码来源:GridAdministrationClient.java

示例2: IdentityProvider

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public IdentityProvider(IdentityProviderProperties conf, Database db, CertificateAuthority ca,
    EventManager eventManager) throws DorianInternalFault {
    this.conf = conf;
    this.eventManager = eventManager;
    this.db = db;
    try {
        initializeEventManager();
        this.registrationPolicy = conf.getRegistrationPolicy();
        this.userManager = new UserManager(db, conf);
        this.assertionManager = new AssertionCredentialsManager(conf, ca, db);
    } catch (Exception e) {
        logError(e.getMessage(), e);
        String message = "Error initializing the Identity Manager Provider.";
        this.eventManager.logEvent(AuditConstants.SYSTEM_ID, AuditConstants.SYSTEM_ID,
            FederationAudit.InternalError.getValue(), message + "\n\n" + FaultUtil.printFaultToString(e));
        DorianInternalFault fault = new DorianInternalFault();
        fault.setFaultString(message);
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianInternalFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:24,代码来源:IdentityProvider.java

示例3: init

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
private synchronized void init() throws CertificateAuthorityFault {
    try {
        if (!initialized) {
            if (!hasCACredentials()) {
                if (properties.isAutoCreateCAEnabled()) {
                    Lifetime lifetime = properties.getCreationPolicy().getLifetime();
                    this.createCertifcateAuthorityCredentials(properties.getCreationPolicy().getSubject(), Utils
                        .getExpiredDate(lifetime), properties.getCreationPolicy().getKeySize());
                }
            }
            initialized = true;
        }
    } catch (Exception e) {
        logError(e.getMessage(), e);
        CertificateAuthorityFault fault = new CertificateAuthorityFault();
        fault.setFaultString("Unexpected Error, could not initialize the Dorian Certificate Authority.");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (CertificateAuthorityFault) helper.getFault();
        throw fault;
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:23,代码来源:CertificateAuthority.java

示例4: execute

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public gov.nih.nci.cagrid.dcqlresult.DCQLQueryResultsCollection execute(gov.nih.nci.cagrid.dcql.DCQLQuery query)
    throws RemoteException, gov.nih.nci.cagrid.fqp.stubs.types.FederatedQueryProcessingFault {
    validateQueryConstraints(query, null);
    
    FederatedQueryEngine engine = new FederatedQueryEngine(null, null, getWorkExecutorService());
    DCQLQueryResultsCollection results = null;
    try {
        results = engine.execute(query);
    } catch (FederatedQueryProcessingException e) {
        LOG.error("Problem executing query: " + e.getMessage());
        FederatedQueryProcessingFault fault = new FederatedQueryProcessingFault();
        fault.setFaultString("Problem executing query: " + e.getMessage());
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        throw helper.getFault();
    }
    return results;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:FederatedQueryProcessorImpl.java

示例5: removePolicy

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void removePolicy(DelegationIdentifier id) throws CDSInternalFault {
	buildDatabase();
	Connection c = null;
	try {
		c = this.db.getConnection();
		PreparedStatement s = c.prepareStatement("DELETE FROM " + TABLE
				+ "  WHERE " + DELEGATION_ID + "= ?");
		s.setLong(1, id.getDelegationId());
		s.execute();
		s.close();
	} catch (Exception e) {
		log.error(e.getMessage(), e);
		CDSInternalFault f = new CDSInternalFault();
		f.setFaultString("Unexpected Database Error.");
		FaultHelper helper = new FaultHelper(f);
		helper.addFaultCause(e);
		f = (CDSInternalFault) helper.getFault();
		throw f;
	} finally {
		this.db.releaseConnection(c);
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:23,代码来源:IdentityPolicyHandler.java

示例6: buildDatabase

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
private void buildDatabase() throws DorianInternalFault {
    if (!dbBuilt) {
        try {
            if (!this.db.tableExists(CREDENTIALS_TABLE)) {
                String users = "CREATE TABLE " + CREDENTIALS_TABLE + " ("
                    + "ALIAS VARCHAR(255) NOT NULL PRIMARY KEY," + "CERTIFICATE TEXT NOT NULL,"
                    + "PRIVATE_KEY BLOB," + "IV BLOB," + "INDEX document_index (ALIAS));";
                db.update(users);
            }
            this.dbBuilt = true;
        } catch (Exception e) {
            logError(e.getMessage(), e);
            DorianInternalFault fault = new DorianInternalFault();
            fault.setFaultString("Unexpected error creating the CA database");
            FaultHelper helper = new FaultHelper(fault);
            helper.addFaultCause(e);
            fault = (DorianInternalFault) helper.getFault();
            throw fault;
        }
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:AssertionCredentialsManager.java

示例7: getCACertificate

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的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,代码来源:GridAdministrationClient.java

示例8: removeCertificates

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void removeCertificates(String gridIdentity) throws DorianInternalFault {
    buildDatabase();
    Connection c = null;
    try {
        c = db.getConnection();
        PreparedStatement s = c.prepareStatement("select " + SERIAL + " from " + TABLE + " WHERE " + GID + "= ?");
        s.setString(1, gridIdentity);
        ResultSet rs = s.executeQuery();
        while (rs.next()) {
            removeCertificate(rs.getLong(SERIAL));
        }
        rs.close();
        s.close();
    } catch (Exception e) {
        DorianInternalFault fault = new DorianInternalFault();
        fault.setFaultString("Unexpected Database Error");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianInternalFault) helper.getFault();
        throw fault;
    } finally {
        db.releaseConnection(c);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:UserCertificateManager.java

示例9: destroyDatabase

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void destroyDatabase() throws GridGrouperRuntimeFault {
	try {
		if (databaseExists(DB)) {
			Query.update(this.root, "drop database if exists " + DB);
		}
		if (core != null) {
			core.destroy();
		}
		if (root != null) {
			root.closeAllUnusedConnections();
		}
		core = null;
		dbBuilt = false;
	} catch (Exception e) {
		e.printStackTrace();
		GridGrouperRuntimeFault fault = new GridGrouperRuntimeFault();
		fault.setFaultString("An error occured while trying to destroy the Grid Grouper database (" + DB + ")");
		FaultHelper helper = new FaultHelper(fault);
		helper.addFaultCause(e);
		fault = (GridGrouperRuntimeFault) helper.getFault();
		throw fault;
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:24,代码来源:MysqlDBUtil.java

示例10: convertJavaExceptionToFault

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
private static BaseFaultType convertJavaExceptionToFault(BaseFaultType fault, Exception e) {
	fault.setFaultString(e.getMessage());
	FaultHelper helper = new FaultHelper(fault);
	helper.addFaultCause(e);
	fault = helper.getFault();
	return fault;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:8,代码来源:GalleryImpl.java

示例11: deleteCACredentials

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void deleteCACredentials() throws CertificateAuthorityFault {
    try {
        getKeyStore().deleteEntry(CA_ALIAS);
    } catch (Exception e) {
        logError(e.getMessage(), e);
        CertificateAuthorityFault fault = new CertificateAuthorityFault();
        fault.setFaultString("Unexpected Error, could not delete the CA credentials.");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (CertificateAuthorityFault) helper.getFault();
        throw fault;
    }

}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:15,代码来源:EracomCertificateAuthority.java

示例12: buildDatabase

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void buildDatabase() throws DorianInternalFault {
    if (!dbBuilt) {
        try {
            if (!this.db.tableExists(TRUST_MANAGER_TABLE)) {
                String trust = "CREATE TABLE " + TRUST_MANAGER_TABLE + " (" + ID_FIELD
                    + " INT NOT NULL AUTO_INCREMENT PRIMARY KEY," + NAME_FIELD + " VARCHAR(255) NOT NULL,"
                    + DISPLAY_NAME_FIELD + " TEXT NOT NULL," + STATUS_FIELD + " VARCHAR(50) NOT NULL,"
                    + POLICY_CLASS_FIELD + " TEXT NOT NULL," + IDP_SUBJECT_FIELD + " TEXT NOT NULL,"
                    + IDP_CERTIFICATE_FIELD + " TEXT NOT NULL," + AUTHENTICATION_SERVICE_URL_FIELD + " TEXT,"
                    + AUTHENTICATION_SERVICE_IDENTITY_FIELD + " TEXT," + PUBLISH_FIELD + " VARCHAR(1),"
                    + USER_ID_ATT_NS_FIELD + " TEXT NOT NULL," + USER_ID_ATT_NAME_FIELD + " TEXT NOT NULL,"
                    + FIRST_NAME_ATT_NS_FIELD + " TEXT NOT NULL," + FIRST_NAME_ATT_NAME_FIELD + " TEXT NOT NULL,"
                    + LAST_NAME_ATT_NS_FIELD + " TEXT NOT NULL," + LAST_NAME_ATT_NAME_FIELD + " TEXT NOT NULL,"
                    + EMAIL_ATT_NS_FIELD + " TEXT NOT NULL," + EMAIL_ATT_NAME_FIELD + " TEXT NOT NULL,"
                    + "INDEX document_index (" + NAME_FIELD + "));";
                db.update(trust);

                String methods = "CREATE TABLE " + AUTH_METHODS_TABLE + " (" + METHOD_ID_FIELD
                    + " INT NOT NULL AUTO_INCREMENT PRIMARY KEY," + IDP_ID_FIELD + " INT NOT NULL," + METHOD_FIELD
                    + " VARCHAR(255) NOT NULL," + "INDEX document_index (" + METHOD_ID_FIELD + "));";
                db.update(methods);
            }

        } catch (Exception e) {
            logError(e.getMessage(), e);
            DorianInternalFault fault = new DorianInternalFault();
            fault.setFaultString("An unexpected database error occurred.");
            FaultHelper helper = new FaultHelper(fault);
            helper.addFaultCause(e);
            fault = (DorianInternalFault) helper.getFault();
            throw fault;
        }
        dbBuilt = true;
    }
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:36,代码来源:TrustedIdPManager.java

示例13: isCertificateUnique

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
private boolean isCertificateUnique(String certAsString) throws DorianInternalFault {
    buildDatabase();
    Connection c = null;
    boolean exists = true;
    try {
        c = db.getConnection();
        Statement s = c.createStatement();
        ResultSet rs = s.executeQuery("select count(*) from " + TRUST_MANAGER_TABLE + " where "
            + IDP_CERTIFICATE_FIELD + "='" + certAsString + "'");
        if (rs.next()) {
            int count = rs.getInt(1);
            if (count > 0) {
                exists = false;
            }
        }
        rs.close();
        s.close();

    } catch (Exception e) {
        DorianInternalFault fault = new DorianInternalFault();
        fault.setFaultString("Unexpected Database Error");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianInternalFault) helper.getFault();
        throw fault;
    } finally {
        db.releaseConnection(c);
    }
    return exists;
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:31,代码来源:TrustedIdPManager.java

示例14: getInternalFault

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public static CDSInternalFault getInternalFault(String error, Exception e) {
	CDSInternalFault f = new CDSInternalFault();
	f.setFaultString(error);
	FaultHelper helper = new FaultHelper(f);
	helper.addFaultCause(e);
	f = (CDSInternalFault) helper.getFault();
	return f;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:9,代码来源:Errors.java

示例15: validateQueryConstraints

import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
private void validateQueryConstraints(org.cagrid.data.dcql.DCQLQuery query, QueryExecutionParameters parameters) throws FederatedQueryProcessingFault {
    // validate the query constraints before trying to do anything else
    try {
        queryConstraintsValidator.validateAgainstConstraints(query, parameters);
    } catch (FederatedQueryProcessingException ex) {
        FaultHelper helper = new FaultHelper(new FederatedQueryProcessingFault());
        helper.addDescription("Query or query execution parameters violate this service's query constraints");
        helper.addDescription(ex.getMessage());
        helper.addFaultCause(ex);
        throw (FederatedQueryProcessingFault) helper.getFault();
    }        
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:13,代码来源:FederatedQueryProcessorImpl.java


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