当前位置: 首页>>代码示例>>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;未经允许,请勿转载。