本文整理汇总了Java中gov.nih.nci.cagrid.common.FaultHelper.addFaultCause方法的典型用法代码示例。如果您正苦于以下问题:Java FaultHelper.addFaultCause方法的具体用法?Java FaultHelper.addFaultCause怎么用?Java FaultHelper.addFaultCause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.cagrid.common.FaultHelper
的用法示例。
在下文中一共展示了FaultHelper.addFaultCause方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
}
示例2: 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;
}
示例3: getAdmins
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public String[] getAdmins(String callerIdentity) throws CDSInternalFault,
PermissionDeniedFault {
verifyAuthenticated(callerIdentity);
verifyAdmin(callerIdentity);
try {
List<String> list = this.administrators.getMembers();
return list.toArray(new String[list.size()]);
} catch (GroupException e) {
log.error(e.getMessage(), e);
CDSInternalFault fault = new CDSInternalFault();
fault
.setFaultString("An unexpected error occurred in obtaining a list of administrators.");
FaultHelper helper = new FaultHelper(fault);
helper.addFaultCause(e);
fault = (CDSInternalFault) helper.getFault();
throw fault;
}
}
示例4: 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," + GID
+ " TEXT," + STATUS + " VARCHAR(15) NOT NULL," + NOT_BEFORE + " BIGINT," + NOT_AFTER
+ " BIGINT," + NOTES + " TEXT," + 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;
}
}
示例5: removeTrustedIdP
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public synchronized void removeTrustedIdP(long id) throws DorianInternalFault {
buildDatabase();
Connection c = null;
try {
c = db.getConnection();
PreparedStatement s = c.prepareStatement("delete from " + TRUST_MANAGER_TABLE + " WHERE " + ID_FIELD
+ "= ?");
s.setLong(1, id);
s.execute();
s.close();
} catch (Exception e) {
log.error(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);
}
removeAuthenticationMethodsForTrustedIdP(id);
}
示例6: renewCertifcateAuthorityCredentials
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public synchronized X509Certificate renewCertifcateAuthorityCredentials(Date expirationDate)
throws CertificateAuthorityFault, NoCACredentialsFault {
init();
try {
X509Certificate oldcert = getCACertificate(false);
int size = ((RSAPublicKey) oldcert.getPublicKey()).getModulus().bitLength();
KeyPair pair = KeyUtil.generateRSAKeyPair(getCACredentialsProvider(), size);
X509Certificate cacert = CertUtil.generateCACertificate(getCACredentialsProvider(), new X509Name(oldcert
.getSubjectDN().getName()), new Date(), expirationDate, pair, getSignatureAlgorithm());
deleteCACredentials();
this.setCACredentials(cacert, pair.getPrivate(), properties.getCertificateAuthorityPassword());
return cacert;
} catch (Exception e) {
logError(e.getMessage(), e);
CertificateAuthorityFault fault = new CertificateAuthorityFault();
fault.setFaultString("Unexpected Error, could renew the CA credentials.");
FaultHelper helper = new FaultHelper(fault);
helper.addFaultCause(e);
fault = (CertificateAuthorityFault) helper.getFault();
throw fault;
}
}
示例7: deleteCredentials
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void deleteCredentials(String alias) throws DorianInternalFault {
this.buildDatabase();
Connection c = null;
try {
c = db.getConnection();
PreparedStatement s = c.prepareStatement("delete from " + CREDENTIALS_TABLE + " where ALIAS= ? ");
s.setString(1, alias);
s.execute();
s.close();
} catch (Exception e) {
logError(e.getMessage(), e);
DorianInternalFault fault = new DorianInternalFault();
fault.setFaultString("Unexpected Database Error, Error removing the credentials for the user " + alias
+ "!!!");
FaultHelper helper = new FaultHelper(fault);
helper.addFaultCause(e);
fault = (DorianInternalFault) helper.getFault();
throw fault;
} finally {
db.releaseConnection(c);
}
}
示例8: BaseEracomCertificateAuthority
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public BaseEracomCertificateAuthority(EracomCertificateAuthorityProperties properties)
throws CertificateAuthorityFault {
super(properties);
try {
isInit = false;
int slot = properties.getSlot();
provider = (Provider) Class.forName("au.com.eracom.crypto.provider.slot" + slot + ".ERACOMProvider")
.newInstance();
Security.addProvider(provider);
keyStore = KeyStore.getInstance("CRYPTOKI", provider.getName());
keyStore.load(null, properties.getCertificateAuthorityPassword().toCharArray());
} catch (Exception e) {
logError(e.getMessage(), e);
CertificateAuthorityFault fault = new CertificateAuthorityFault();
fault.setFaultString("Error initializing the Dorian Certificate Authority.");
FaultHelper helper = new FaultHelper(fault);
helper.addFaultCause(e);
fault = (CertificateAuthorityFault) helper.getFault();
throw fault;
}
}
示例9: createDatabaseIfNeeded
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void createDatabaseIfNeeded() throws GridGrouperRuntimeFault {
try {
if (!dbBuilt) {
if (!databaseExists(DB)) {
Query.update(this.root, "create database " + DB);
}
if (core == null) {
core = new ConnectionManager(DB, root.getUrlPrefix(), root.getDriver(), root.getHost(), root
.getPort(), root.getUsername(), root.getPassword());
}
dbBuilt = true;
}
} catch (Exception e) {
e.printStackTrace();
GridGrouperRuntimeFault fault = new GridGrouperRuntimeFault();
fault.setFaultString("An error occured while trying to create the Dorian database (" + DB + ")");
FaultHelper helper = new FaultHelper(fault);
helper.addFaultCause(e);
fault = (GridGrouperRuntimeFault) helper.getFault();
throw fault;
}
}
示例10: clearDatabase
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void clearDatabase() throws DorianInternalFault {
this.buildDatabase();
try {
db.update("drop TABLE " + TABLE);
} 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;
}
}
示例11: clearDatabase
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void clearDatabase() throws DorianInternalFault {
buildDatabase();
try {
db.update("delete from " + CREDENTIALS_TABLE);
} 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;
}
}
示例12: addCertificate
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void addCertificate(String alias, X509Certificate cert) throws DorianInternalFault {
this.buildDatabase();
Connection c = null;
try {
if (!hasCredentials(alias)) {
c = db.getConnection();
long serial = cert.getSerialNumber().longValue();
String keyStr = "";
String certStr = CertUtil.writeCertificate(cert);
PreparedStatement s = c.prepareStatement("INSERT INTO " + CREDENTIALS_TABLE
+ " SET ALIAS= ?, SERIAL_NUMBER= ?, CERTIFICATE= ?, PRIVATE_KEY= ?");
s.setString(1, alias);
s.setLong(2, serial);
s.setString(3, certStr);
s.setString(4, keyStr);
s.execute();
s.close();
}
} catch (Exception e) {
logError(e.getMessage(), e);
DorianInternalFault fault = new DorianInternalFault();
fault.setFaultString("Unexpected Error, could not add certificate to the credentials database.");
FaultHelper helper = new FaultHelper(fault);
helper.addFaultCause(e);
fault = (DorianInternalFault) helper.getFault();
throw fault;
} finally {
db.releaseConnection(c);
}
}
示例13: removeAllTrustedIdPs
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public synchronized void removeAllTrustedIdPs() throws DorianInternalFault {
buildDatabase();
try {
db.update("delete from " + TRUST_MANAGER_TABLE);
db.update("delete from " + AUTH_METHODS_TABLE);
} 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;
}
}
示例14: getActiveCertificates
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public List<BigInteger> getActiveCertificates(String gridIdentity) throws DorianInternalFault {
buildDatabase();
Connection c = null;
List<BigInteger> certs = new ArrayList<BigInteger>();
try {
c = db.getConnection();
PreparedStatement s = c.prepareStatement("select " + SERIAL + " from " + TABLE + " WHERE " + STATUS
+ "= ? AND " + NOT_BEFORE + "<= ? AND " + NOT_AFTER + " >= ? AND " + GID + "= ?");
s.setString(1, UserCertificateStatus.OK.getValue());
Date time = new Date();
s.setLong(2, time.getTime());
s.setLong(3, time.getTime());
s.setString(4, gridIdentity);
ResultSet rs = s.executeQuery();
while (rs.next()) {
certs.add(BigInteger.valueOf(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);
}
return certs;
}
示例15: clearDatabase
import gov.nih.nci.cagrid.common.FaultHelper; //导入方法依赖的package包/类
public void clearDatabase() throws DorianInternalFault {
try {
db.update("DROP TABLE IF EXISTS " + USERS_TABLE);
} 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;
}
this.tm.clearDatabase();
this.dbBuilt = false;
}