use of org.wso2.carbon.identity.openidconnect.model.Constants.STATE in project carbon-identity-framework by wso2.
the class WorkflowRequestAssociationDAO method updateStatusOfRelationshipsOfPendingRequest.
/**
* Update state of workflow of a request
*
* @param requestId requestId to update relationships of.
* @throws InternalWorkflowException
*/
public void updateStatusOfRelationshipsOfPendingRequest(String requestId, String status) throws InternalWorkflowException {
Connection connection = IdentityDatabaseUtil.getDBConnection();
PreparedStatement prepStmt = null;
String query = SQLConstants.UPDATE_STATUS_OF_RELATIONSHIPS_OF_REQUEST;
try {
Timestamp updatedDateStamp = new Timestamp(System.currentTimeMillis());
prepStmt = connection.prepareStatement(query);
prepStmt.setString(1, status);
prepStmt.setTimestamp(2, updatedDateStamp);
prepStmt.setString(3, requestId);
prepStmt.setString(4, WFConstant.HT_STATE_PENDING);
prepStmt.execute();
IdentityDatabaseUtil.commitTransaction(connection);
} catch (SQLException e) {
IdentityDatabaseUtil.rollbackTransaction(connection);
throw new InternalWorkflowException("Error when executing the sql query:" + query, e);
} finally {
IdentityDatabaseUtil.closeAllConnections(connection, null, prepStmt);
}
}
use of org.wso2.carbon.identity.openidconnect.model.Constants.STATE in project carbon-identity-framework by wso2.
the class CarbonBasedTestListener method callInternalMethod.
private void callInternalMethod(Object target, String method, Class[] types, Object... values) {
Class c = target.getClass();
try {
Method m = c.getDeclaredMethod(method, types);
m.setAccessible(true);
m.invoke(target, values);
} catch (Exception e) {
throw new RuntimeException("Unable to set internal state on a private field.", e);
}
}
use of org.wso2.carbon.identity.openidconnect.model.Constants.STATE in project carbon-identity-framework by wso2.
the class CarbonBasedTestListener method setInternalState.
public static void setInternalState(Class c, String field, Object value) {
try {
Field f = c.getDeclaredField(field);
f.setAccessible(true);
f.set(null, value);
} catch (Exception e) {
throw new RuntimeException("Unable to set internal state on a private field.", e);
}
}
use of org.wso2.carbon.identity.openidconnect.model.Constants.STATE in project carbon-identity-framework by wso2.
the class CarbonBasedTestListener method setInternalState.
public static void setInternalState(Object target, String field, Object value) {
Class c = target.getClass();
try {
Field f = c.getDeclaredField(field);
f.setAccessible(true);
f.set(target, value);
} catch (Exception e) {
throw new RuntimeException("Unable to set internal state on a private field.", e);
}
}
use of org.wso2.carbon.identity.openidconnect.model.Constants.STATE in project carbon-identity-framework by wso2.
the class UserStoreConfigAdminService method changeUserStoreState.
/**
* Update a domain to be disabled/enabled in file repository.
*
* @param domain Name of the domain to be updated
* @param isDisable Whether to disable/enable domain(true/false)
* @throws IdentityUserStoreMgtException If error occurs during domain validation
* @throws TransformerConfigurationException If error occurs during configuration transformation
*/
public void changeUserStoreState(String domain, Boolean isDisable) throws IdentityUserStoreMgtException, TransformerConfigurationException {
validateDomain(domain, isDisable);
try {
triggerListenersOnUserStorePreStateChange(domain, isDisable);
} catch (UserStoreException e) {
throw new IdentityUserStoreMgtException("Error occurred while triggering the user store pre state change" + " listeners.");
}
UserStoreDTO userStoreDTO = getUserStoreDTO(domain, isDisable, null);
updateStateInFileRepository(userStoreDTO);
}
Aggregations