當前位置: 首頁>>代碼示例>>Java>>正文


Java FaultHelper類代碼示例

本文整理匯總了Java中gov.nih.nci.cagrid.common.FaultHelper的典型用法代碼示例。如果您正苦於以下問題:Java FaultHelper類的具體用法?Java FaultHelper怎麽用?Java FaultHelper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FaultHelper類屬於gov.nih.nci.cagrid.common包,在下文中一共展示了FaultHelper類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isAccessDenied

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
private boolean isAccessDenied(Exception ex) {
    Throwable cause = ex;
    Set<Throwable> seenCauses = new HashSet<Throwable>();
    boolean isDenied = false;
    while (cause != null && !seenCauses.contains(cause) && !isDenied) {
        String message = cause.getMessage();
        if (cause instanceof BaseFaultType) {
            message = FaultHelper.getMessage(cause);
        }
        if (message.contains(ACCESS_DENIED_MESSAGE)) {
            isDenied = true;
        }
        seenCauses.add(cause);
        cause = cause.getCause();
    }
    return isDenied;
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:18,代碼來源:InvokeCsmDataServiceStep.java

示例2: removeUser

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
public synchronized void removeUser(long idpId, String uid) throws DorianInternalFault {
    this.buildDatabase();
    Connection c = null;
    try {
        c = db.getConnection();
        PreparedStatement s = c.prepareStatement("delete from " + USERS_TABLE + " WHERE " + IDP_FIELD + "= ? AND "
            + UID_FIELD + "= ?");
        s.setLong(1, idpId);
        s.setString(2, uid);
        s.execute();
        s.close();
    } catch (Exception e) {
        DorianInternalFault fault = new DorianInternalFault();
        fault.setFaultString("Unexpected Database Error - Could not remove user!!!");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianInternalFault) helper.getFault();
        throw fault;
    } finally {
        db.releaseConnection(c);
    }
}
 
開發者ID:NCIP,項目名稱:cagrid2,代碼行數:23,代碼來源:UserManager.java

示例3: getDelegatedCredential

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
private GlobusCredential getDelegatedCredential(DelegatedCredentialReference reference) throws InternalErrorFault {
    GlobusCredential userCredential = null;
    LOG.info("Retrieving delegated credential");
    try {
        DelegatedCredentialUserClient credentialClient = 
            new DelegatedCredentialUserClient(reference);
        userCredential = credentialClient.getDelegatedCredential();
    } catch (Exception ex) {
        String message = "Error obtaining delegated credential from CDS";
        LOG.error(message, ex);
        FaultHelper helper = new FaultHelper(new InternalErrorFault());
        helper.addDescription(message);
        helper.addDescription(ex.getMessage());
        helper.addFaultCause(ex);
        throw (InternalErrorFault) helper.getFault();
    }
    return userCredential;
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:19,代碼來源:FQPAsynchronousQueryUtil.java

示例4: isSpringJava6Error

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
protected boolean isSpringJava6Error(Exception ex) {
    Throwable cause = ex;
    while (cause != null) {
        String message = cause.getMessage();
        if (cause instanceof BaseFaultType) {
            message = FaultHelper.getMessage(cause);
        }
        if (message != null) {
            for (String findme : JDK6_SPRING_ERROR_MESSAGES) {
                if (message.contains(findme)) {
                    return true;
                }
            }
        }
        cause = cause.getCause();
    }
    return false;
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:19,代碼來源:InvokeCql2DataServiceStep.java

示例5: buildDatabase

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
public void buildDatabase() throws DorianInternalFault {
    if (!dbBuilt) {
        try {
            if (!this.db.tableExists(TABLE)) {

                String certificates = "CREATE TABLE " + TABLE + " (" + SERIAL + " BIGINT PRIMARY KEY," + SUBJECT
                    + " TEXT NOT NULL," + REASON + " VARCHAR(255) NOT NULL," + CERTIFICATE + " TEXT,"
                    + "INDEX document_index (" + SERIAL + "));";
                db.update(certificates);

            }
        } catch (Exception e) {
            log.error(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;
        }
        this.dbBuilt = true;
    }
}
 
開發者ID:NCIP,項目名稱:cagrid2,代碼行數:24,代碼來源:CertificateBlacklistManager.java

示例6: removeCertificateFromBlackList

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
public void removeCertificateFromBlackList(long serialNumber) throws DorianInternalFault {
    buildDatabase();
    Connection c = null;
    try {
        c = db.getConnection();
        PreparedStatement s = c.prepareStatement("delete from " + TABLE + " where " + SERIAL + "= ?");
        s.setLong(1, serialNumber);
        s.executeUpdate();
        s.close();
    } catch (Exception e) {
        DorianInternalFault fault = new DorianInternalFault();
        fault.setFaultString("Unexpected Error");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianInternalFault) helper.getFault();
        throw fault;
    } finally {
        db.releaseConnection(c);
    }

}
 
開發者ID:NCIP,項目名稱:cagrid2,代碼行數:22,代碼來源:CertificateBlacklistManager.java

示例7: deleteAssertingCredentials

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
public synchronized void deleteAssertingCredentials() throws DorianInternalFault {
    this.buildDatabase();
    Connection c = null;
    try {
        c = db.getConnection();
        PreparedStatement s = c.prepareStatement("delete from " + CREDENTIALS_TABLE + " where ALIAS= ? ");
        s.setString(1, CERT_DN);
        s.execute();
        s.close();
    } catch (Exception e) {
        logError(e.getMessage(), e);
        DorianInternalFault fault = new DorianInternalFault();
        fault.setFaultString("Unexpected error deleting the Dorian IdP asserting credentials.");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianInternalFault) helper.getFault();
        throw fault;
    } finally {
        db.releaseConnection(c);
    }
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:22,代碼來源:AssertionCredentialsManager.java

示例8: removeUser

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
public synchronized void removeUser(String uid) throws DorianInternalFault {
    this.buildDatabase();
    Connection c = null;
    try {
        c = db.getConnection();
        PreparedStatement ps = c.prepareStatement("DELETE FROM " + IDP_USERS_TABLE + " WHERE UID= ?");
        ps.setString(1, uid);
        ps.executeUpdate();
        ps.close();
        this.passwordSecurityManager.deleteEntry(uid);
    } catch (Exception e) {
        logError(e.getMessage(), e);
        DorianInternalFault fault = new DorianInternalFault();
        fault.setFaultString("Unexpected Error, Could not delete user!!!");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianInternalFault) helper.getFault();
        throw fault;
    } finally {
        db.releaseConnection(c);
    }
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:23,代碼來源:UserManager.java

示例9: doesUserExist

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的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,項目名稱:cagrid2,代碼行數:27,代碼來源:LocalAdministrationClient.java

示例10: deleteEntry

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
public synchronized void deleteEntry(String uid) throws DorianInternalFault {
    this.buildDatabase();
    Connection c = null;
    try {
        c = db.getConnection();
        PreparedStatement ps = c.prepareStatement("DELETE FROM " + TABLE + " WHERE " + UID + " = ?");
        ps.setString(1, uid);
        ps.executeUpdate();
        ps.close();
    } 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;
    } finally {
        db.releaseConnection(c);
    }

}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:23,代碼來源:PasswordSecurityManager.java

示例11: getBlackList

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的package包/類
public List<Long> getBlackList() throws DorianInternalFault {
    buildDatabase();
    List<Long> list = new ArrayList<Long>();
    Connection c = null;
    try {
        c = db.getConnection();
        PreparedStatement s = c.prepareStatement("select " + SERIAL + " from " + TABLE);
        ResultSet rs = s.executeQuery();
        while (rs.next()) {
            list.add(Long.valueOf(rs.getLong(SERIAL)));
        }
        rs.close();
        s.close();
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        DorianInternalFault fault = new DorianInternalFault();
        fault.setFaultString("Unexpected error encountered.");
        FaultHelper helper = new FaultHelper(fault);
        helper.addFaultCause(e);
        fault = (DorianInternalFault) helper.getFault();
        throw fault;
    } finally {
        db.releaseConnection(c);
    }
    return list;
}
 
開發者ID:NCIP,項目名稱:cagrid2,代碼行數:27,代碼來源:CertificateBlacklistManager.java

示例12: 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

示例13: getUserPolicies

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的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,項目名稱:cagrid2,代碼行數:27,代碼來源:GridAdministrationClient.java

示例14: findUsers

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的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

示例15: removeUser

import gov.nih.nci.cagrid.common.FaultHelper; //導入依賴的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


注:本文中的gov.nih.nci.cagrid.common.FaultHelper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。