Search in sources :

Example 1 with DB_SCHEMA_COLUMN_NAME_ID

use of org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_ID in project carbon-identity-framework by wso2.

the class SecretDAOImpl method isExistingSecret.

@Override
public boolean isExistingSecret(String secretId, int tenantId) throws SecretManagementException {
    NamedJdbcTemplate jdbcTemplate = getNewTemplate();
    String secretName;
    try {
        secretName = jdbcTemplate.fetchSingleRecord(GET_SECRET_NAME_BY_ID, (resultSet, rowNumber) -> resultSet.getString(DB_SCHEMA_COLUMN_NAME_SECRET_NAME), preparedStatement -> {
            preparedStatement.setString(DB_SCHEMA_COLUMN_NAME_ID, secretId);
            preparedStatement.setInt(DB_SCHEMA_COLUMN_NAME_TENANT_ID, tenantId);
        });
        return StringUtils.isNotEmpty(secretName);
    } catch (DataAccessException e) {
        throw handleServerException(ERROR_CODE_GET_SECRET, "id = " + secretId, e);
    }
}
Also used : DB_SCHEMA_COLUMN_NAME_CREATED_TIME(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_CREATED_TIME) DB_SCHEMA_COLUMN_NAME_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_TYPE) StringUtils(org.apache.commons.lang.StringUtils) GET_SECRET_BY_ID(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_BY_ID) IdentityDatabaseUtil(org.wso2.carbon.identity.core.util.IdentityDatabaseUtil) UPDATE_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET_TYPE) Date(java.util.Date) GET_SECRET_BY_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_BY_NAME) DB_SCHEMA_COLUMN_NAME_SECRET_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_SECRET_NAME) SecretUtils.handleServerException(org.wso2.carbon.identity.secret.mgt.core.util.SecretUtils.handleServerException) ERROR_CODE_ADD_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_ADD_SECRET_TYPE) UPDATE_SECRET_DESCRIPTION(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET_DESCRIPTION) ERROR_CODE_UPDATE_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_UPDATE_SECRET_TYPE) ERROR_CODE_SECRETS_DOES_NOT_EXISTS(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_SECRETS_DOES_NOT_EXISTS) ERROR_CODE_DELETE_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_DELETE_SECRET) SecretType(org.wso2.carbon.identity.secret.mgt.core.model.SecretType) LambdaExceptionUtils(org.wso2.carbon.identity.core.util.LambdaExceptionUtils) TimeZone(java.util.TimeZone) Timestamp(java.sql.Timestamp) GET_SECRET_NAME_BY_ID(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_NAME_BY_ID) UPDATE_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET) Secret(org.wso2.carbon.identity.secret.mgt.core.model.Secret) DB_SCHEMA_COLUMN_NAME_LAST_MODIFIED(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_LAST_MODIFIED) List(java.util.List) ERROR_CODE_UPDATE_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_UPDATE_SECRET) DataAccessException(org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException) UTC(java.time.ZoneOffset.UTC) LogFactory(org.apache.commons.logging.LogFactory) ERROR_CODE_GET_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_GET_SECRET) SecretManagementException(org.wso2.carbon.identity.secret.mgt.core.exception.SecretManagementException) INSERT_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.INSERT_SECRET) PrivilegedCarbonContext(org.wso2.carbon.context.PrivilegedCarbonContext) SQLIntegrityConstraintViolationException(java.sql.SQLIntegrityConstraintViolationException) NamedJdbcTemplate(org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate) DB_SCHEMA_COLUMN_NAME_SECRET_VALUE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_SECRET_VALUE) GET_SECRET_TYPE_BY_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_TYPE_BY_NAME) Calendar(java.util.Calendar) DB_SCHEMA_COLUMN_NAME_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_NAME) SQLConstants(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants) SecretDAO(org.wso2.carbon.identity.secret.mgt.core.dao.SecretDAO) GET_SECRETS(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRETS) TransactionException(org.wso2.carbon.database.utils.jdbc.exceptions.TransactionException) IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil) ERROR_CODE_ADD_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_ADD_SECRET) CryptoException(org.wso2.carbon.core.util.CryptoException) ERROR_CODE_SECRET_ALREADY_EXISTS(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_SECRET_ALREADY_EXISTS) ERROR_CODE_REPLACE_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_REPLACE_SECRET) GET_SECRET_CREATED_TIME_BY_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_CREATED_TIME_BY_NAME) NamedTemplate(org.wso2.carbon.database.utils.jdbc.NamedTemplate) UPDATE_SECRET_VALUE(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET_VALUE) ERROR_CODE_DELETE_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_DELETE_SECRET_TYPE) SecretUtils.handleClientException(org.wso2.carbon.identity.secret.mgt.core.util.SecretUtils.handleClientException) DB_SCHEMA_COLUMN_NAME_ID(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_ID) DB_SCHEMA_COLUMN_NAME_TENANT_ID(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_TENANT_ID) Log(org.apache.commons.logging.Log) DB_SCHEMA_COLUMN_NAME_DESCRIPTION(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_DESCRIPTION) ERROR_CODE_RETRIEVE_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_RETRIEVE_SECRET_TYPE) NamedJdbcTemplate(org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate) DataAccessException(org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException)

Example 2 with DB_SCHEMA_COLUMN_NAME_ID

use of org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_ID in project carbon-identity-framework by wso2.

the class SecretDAOImpl method getSecretTypeByName.

@Override
public SecretType getSecretTypeByName(String secretTypeName) throws SecretManagementException {
    NamedJdbcTemplate jdbcTemplate = getNewTemplate();
    SecretType secretTypeResponse;
    try {
        secretTypeResponse = jdbcTemplate.fetchSingleRecord(GET_SECRET_TYPE_BY_NAME, (resultSet, rowNumber) -> {
            SecretType secretType = new SecretType();
            secretType.setId(resultSet.getString(DB_SCHEMA_COLUMN_NAME_ID));
            secretType.setName(resultSet.getString(DB_SCHEMA_COLUMN_NAME_NAME));
            secretType.setDescription(resultSet.getString(DB_SCHEMA_COLUMN_NAME_DESCRIPTION));
            return secretType;
        }, preparedStatement -> preparedStatement.setString(DB_SCHEMA_COLUMN_NAME_NAME, secretTypeName));
        return secretTypeResponse;
    } catch (DataAccessException e) {
        throw handleServerException(ERROR_CODE_RETRIEVE_SECRET_TYPE, secretTypeName, e);
    }
}
Also used : DB_SCHEMA_COLUMN_NAME_CREATED_TIME(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_CREATED_TIME) DB_SCHEMA_COLUMN_NAME_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_TYPE) StringUtils(org.apache.commons.lang.StringUtils) GET_SECRET_BY_ID(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_BY_ID) IdentityDatabaseUtil(org.wso2.carbon.identity.core.util.IdentityDatabaseUtil) UPDATE_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET_TYPE) Date(java.util.Date) GET_SECRET_BY_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_BY_NAME) DB_SCHEMA_COLUMN_NAME_SECRET_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_SECRET_NAME) SecretUtils.handleServerException(org.wso2.carbon.identity.secret.mgt.core.util.SecretUtils.handleServerException) ERROR_CODE_ADD_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_ADD_SECRET_TYPE) UPDATE_SECRET_DESCRIPTION(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET_DESCRIPTION) ERROR_CODE_UPDATE_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_UPDATE_SECRET_TYPE) ERROR_CODE_SECRETS_DOES_NOT_EXISTS(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_SECRETS_DOES_NOT_EXISTS) ERROR_CODE_DELETE_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_DELETE_SECRET) SecretType(org.wso2.carbon.identity.secret.mgt.core.model.SecretType) LambdaExceptionUtils(org.wso2.carbon.identity.core.util.LambdaExceptionUtils) TimeZone(java.util.TimeZone) Timestamp(java.sql.Timestamp) GET_SECRET_NAME_BY_ID(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_NAME_BY_ID) UPDATE_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET) Secret(org.wso2.carbon.identity.secret.mgt.core.model.Secret) DB_SCHEMA_COLUMN_NAME_LAST_MODIFIED(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_LAST_MODIFIED) List(java.util.List) ERROR_CODE_UPDATE_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_UPDATE_SECRET) DataAccessException(org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException) UTC(java.time.ZoneOffset.UTC) LogFactory(org.apache.commons.logging.LogFactory) ERROR_CODE_GET_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_GET_SECRET) SecretManagementException(org.wso2.carbon.identity.secret.mgt.core.exception.SecretManagementException) INSERT_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.INSERT_SECRET) PrivilegedCarbonContext(org.wso2.carbon.context.PrivilegedCarbonContext) SQLIntegrityConstraintViolationException(java.sql.SQLIntegrityConstraintViolationException) NamedJdbcTemplate(org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate) DB_SCHEMA_COLUMN_NAME_SECRET_VALUE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_SECRET_VALUE) GET_SECRET_TYPE_BY_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_TYPE_BY_NAME) Calendar(java.util.Calendar) DB_SCHEMA_COLUMN_NAME_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_NAME) SQLConstants(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants) SecretDAO(org.wso2.carbon.identity.secret.mgt.core.dao.SecretDAO) GET_SECRETS(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRETS) TransactionException(org.wso2.carbon.database.utils.jdbc.exceptions.TransactionException) IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil) ERROR_CODE_ADD_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_ADD_SECRET) CryptoException(org.wso2.carbon.core.util.CryptoException) ERROR_CODE_SECRET_ALREADY_EXISTS(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_SECRET_ALREADY_EXISTS) ERROR_CODE_REPLACE_SECRET(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_REPLACE_SECRET) GET_SECRET_CREATED_TIME_BY_NAME(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.GET_SECRET_CREATED_TIME_BY_NAME) NamedTemplate(org.wso2.carbon.database.utils.jdbc.NamedTemplate) UPDATE_SECRET_VALUE(org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET_VALUE) ERROR_CODE_DELETE_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_DELETE_SECRET_TYPE) SecretUtils.handleClientException(org.wso2.carbon.identity.secret.mgt.core.util.SecretUtils.handleClientException) DB_SCHEMA_COLUMN_NAME_ID(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_ID) DB_SCHEMA_COLUMN_NAME_TENANT_ID(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_TENANT_ID) Log(org.apache.commons.logging.Log) DB_SCHEMA_COLUMN_NAME_DESCRIPTION(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_DESCRIPTION) ERROR_CODE_RETRIEVE_SECRET_TYPE(org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.ErrorMessages.ERROR_CODE_RETRIEVE_SECRET_TYPE) SecretType(org.wso2.carbon.identity.secret.mgt.core.model.SecretType) NamedJdbcTemplate(org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate) DataAccessException(org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException)

Example 3 with DB_SCHEMA_COLUMN_NAME_ID

use of org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_ID in project carbon-identity-framework by wso2.

the class SecretDAOImpl method addSecretType.

@Override
public void addSecretType(SecretType secretType) throws SecretManagementException {
    NamedJdbcTemplate jdbcTemplate = getNewTemplate();
    try {
        jdbcTemplate.executeInsert(SQLConstants.INSERT_SECRET_TYPE, preparedStatement -> {
            preparedStatement.setString(DB_SCHEMA_COLUMN_NAME_ID, secretType.getId());
            preparedStatement.setString(DB_SCHEMA_COLUMN_NAME_NAME, secretType.getName());
            preparedStatement.setString(DB_SCHEMA_COLUMN_NAME_DESCRIPTION, secretType.getDescription());
        }, secretType, false);
    } catch (DataAccessException e) {
        throw handleServerException(ERROR_CODE_ADD_SECRET_TYPE, secretType.getName(), e);
    }
}
Also used : NamedJdbcTemplate(org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate) DataAccessException(org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException)

Example 4 with DB_SCHEMA_COLUMN_NAME_ID

use of org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_ID in project carbon-identity-framework by wso2.

the class ConfigurationDAOImpl method getAttributeByKey.

/**
 * {@inheritDoc}
 */
@Override
public Attribute getAttributeByKey(String resourceId, String attributeKey) throws ConfigurationManagementException {
    JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();
    try {
        return jdbcTemplate.fetchSingleRecord(SQLConstants.GET_ATTRIBUTE_SQL, (resultSet, rowNumber) -> new Attribute(resultSet.getString(DB_SCHEMA_COLUMN_NAME_ATTRIBUTE_KEY), resultSet.getString(DB_SCHEMA_COLUMN_NAME_ATTRIBUTE_VALUE), resultSet.getString(DB_SCHEMA_COLUMN_NAME_ID)), preparedStatement -> {
            int initialParameterIndex = 1;
            preparedStatement.setString(initialParameterIndex, attributeKey);
            preparedStatement.setString(++initialParameterIndex, resourceId);
        });
    } catch (DataAccessException e) {
        throw handleServerException(ERROR_CODE_GET_ATTRIBUTE, attributeKey, e);
    }
}
Also used : Attribute(org.wso2.carbon.identity.configuration.mgt.core.model.Attribute) JdbcTemplate(org.wso2.carbon.database.utils.jdbc.JdbcTemplate) DataAccessException(org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException)

Example 5 with DB_SCHEMA_COLUMN_NAME_ID

use of org.wso2.carbon.identity.secret.mgt.core.constant.SecretConstants.DB_SCHEMA_COLUMN_NAME_ID in project carbon-identity-framework by wso2.

the class ConfigurationDAOImpl method isResourceExists.

private boolean isResourceExists(Resource resource, String resourceTypeId) throws TransactionException {
    JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();
    String resourceId = jdbcTemplate.withTransaction(template -> template.fetchSingleRecord(GET_RESOURCE_ID_BY_NAME_SQL, (resultSet, rowNumber) -> resultSet.getString(DB_SCHEMA_COLUMN_NAME_ID), preparedStatement -> {
        int initialParameterIndex = 1;
        preparedStatement.setString(initialParameterIndex, resource.getResourceName());
        preparedStatement.setInt(++initialParameterIndex, PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
        preparedStatement.setString(++initialParameterIndex, resourceTypeId);
    }));
    return resourceId != null;
}
Also used : INSERT_OR_UPDATE_RESOURCE_POSTGRESQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_POSTGRESQL) MAX_QUERY_LENGTH_IN_BYTES_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.MAX_QUERY_LENGTH_IN_BYTES_SQL) DELETE_FILES_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.DELETE_FILES_SQL) StringUtils(org.apache.commons.lang.StringUtils) DB_SCHEMA_COLUMN_NAME_LAST_MODIFIED(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_LAST_MODIFIED) ResourceType(org.wso2.carbon.identity.configuration.mgt.core.model.ResourceType) INSERT_OR_UPDATE_ATTRIBUTE_MYSQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTE_MYSQL) DB_SCHEMA_COLUMN_NAME_HAS_ATTRIBUTE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_HAS_ATTRIBUTE) DB_SCHEMA_COLUMN_NAME_CREATED_TIME(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_CREATED_TIME) ConfigurationManagementException(org.wso2.carbon.identity.configuration.mgt.core.exception.ConfigurationManagementException) INSERT_RESOURCE_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_RESOURCE_SQL) ERROR_CODE_INSERT_FILE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_INSERT_FILE) ERROR_CODE_GET_FILE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_GET_FILE) Map(java.util.Map) Condition(org.wso2.carbon.identity.configuration.mgt.core.search.Condition) ERROR_CODE_REPLACE_ATTRIBUTE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_REPLACE_ATTRIBUTE) ERROR_CODE_RESOURCE_ALREADY_EXISTS(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_RESOURCE_ALREADY_EXISTS) INSERT_OR_UPDATE_RESOURCE_MSSQL_OR_DB2(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_MSSQL_OR_DB2) INSERT_OR_UPDATE_ATTRIBUTES_POSTGRESQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTES_POSTGRESQL) DB_SCHEMA_COLUMN_NAME_ATTRIBUTE_VALUE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_ATTRIBUTE_VALUE) INSERT_OR_UPDATE_ATTRIBUTES_MSSQL_OR_DB2(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTES_MSSQL_OR_DB2) LambdaExceptionUtils(org.wso2.carbon.identity.core.util.LambdaExceptionUtils) ConfigurationUtils.getMaximumQueryLengthInBytes(org.wso2.carbon.identity.configuration.mgt.core.util.ConfigurationUtils.getMaximumQueryLengthInBytes) Set(java.util.Set) GET_RESOURCE_BY_ID_MYSQL_WITHOUT_CREATED_TIME(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_BY_ID_MYSQL_WITHOUT_CREATED_TIME) PreparedStatement(java.sql.PreparedStatement) SQLConstants(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants) JdbcUtils.isOracleDB(org.wso2.carbon.identity.core.util.JdbcUtils.isOracleDB) ERROR_CODE_UPDATE_ATTRIBUTE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_UPDATE_ATTRIBUTE) ConfigurationManagementClientException(org.wso2.carbon.identity.configuration.mgt.core.exception.ConfigurationManagementClientException) INSERT_OR_UPDATE_ATTRIBUTE_MSSQL_OR_DB2(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTE_MSSQL_OR_DB2) GET_RESOURCE_TYPE_ID_BY_NAME_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_TYPE_ID_BY_NAME_SQL) LogFactory(org.apache.commons.logging.LogFactory) ERROR_CODE_INSERT_ATTRIBUTE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_INSERT_ATTRIBUTE) ERROR_CODE_DELETE_FILE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_DELETE_FILE) ERROR_CODE_SEARCH_QUERY_SQL_PROPERTY_PARSE_ERROR(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_SEARCH_QUERY_SQL_PROPERTY_PARSE_ERROR) GET_FILES_BY_RESOURCE_TYPE_ID_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_FILES_BY_RESOURCE_TYPE_ID_SQL) JdbcTemplate(org.wso2.carbon.database.utils.jdbc.JdbcTemplate) ERROR_CODE_ADD_RESOURCE_TYPE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_ADD_RESOURCE_TYPE) ERROR_CODE_ADD_RESOURCE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_ADD_RESOURCE) ResourceFile(org.wso2.carbon.identity.configuration.mgt.core.model.ResourceFile) SQLIntegrityConstraintViolationException(java.sql.SQLIntegrityConstraintViolationException) INSERT_OR_UPDATE_RESOURCE_ORACLE(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_ORACLE) INSERT_OR_UPDATE_RESOURCE_TYPE_H2(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_TYPE_H2) ArrayList(java.util.ArrayList) SQLException(java.sql.SQLException) Calendar(java.util.Calendar) INSERT_OR_UPDATE_RESOURCE_TYPE_MSSQL_OR_DB2(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_TYPE_MSSQL_OR_DB2) DB_SCHEMA_COLUMN_NAME_RESOURCE_TYPE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_RESOURCE_TYPE) IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil) ERROR_CODE_QUERY_LENGTH_EXCEEDED(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_QUERY_LENGTH_EXCEEDED) DB_SCHEMA_COLUMN_NAME_DESCRIPTTION(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_DESCRIPTTION) INSERT_OR_UPDATE_ATTRIBUTE_H2(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTE_H2) GET_TENANT_RESOURCES_SELECT_COLUMNS_MSSQL_OR_ORACLE(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_TENANT_RESOURCES_SELECT_COLUMNS_MSSQL_OR_ORACLE) UPDATE_HAS_FILE_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.UPDATE_HAS_FILE_SQL) JdbcUtils.isMSSqlDB(org.wso2.carbon.identity.core.util.JdbcUtils.isMSSqlDB) DB_SCHEMA_COLUMN_NAME_ATTRIBUTE_ID(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_ATTRIBUTE_ID) ERROR_CODE_DELETE_RESOURCE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_DELETE_RESOURCE) ERROR_CODE_REPLACE_RESOURCE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_REPLACE_RESOURCE) GET_RESOURCE_CREATED_TIME_BY_NAME_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_CREATED_TIME_BY_NAME_SQL) GET_RESOURCE_BY_ID_MSSQL_OR_ORACLE(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_BY_ID_MSSQL_OR_ORACLE) DB_SCHEMA_COLUMN_NAME_HAS_FILE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_HAS_FILE) GET_FILES_BY_RESOURCE_ID_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_FILES_BY_RESOURCE_ID_SQL) ERROR_CODE_DELETE_ATTRIBUTE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_DELETE_ATTRIBUTE) ERROR_CODE_CHECK_DB_METADATA(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_CHECK_DB_METADATA) GET_RESOURCE_BY_NAME_MSSQL_OR_ORACLE(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_BY_NAME_MSSQL_OR_ORACLE) ERROR_CODE_UPDATE_RESOURCE_TYPE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_UPDATE_RESOURCE_TYPE) Resources(org.wso2.carbon.identity.configuration.mgt.core.model.Resources) DB_SCHEMA_COLUMN_NAME_ID(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_ID) UPDATE_RESOURCE_H2(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.UPDATE_RESOURCE_H2) INSERT_OR_UPDATE_ATTRIBUTES_MYSQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTES_MYSQL) ConfigurationUtils.handleClientException(org.wso2.carbon.identity.configuration.mgt.core.util.ConfigurationUtils.handleClientException) DB_SCHEMA_COLUMN_NAME_RESOURCE_NAME(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_RESOURCE_NAME) Date(java.util.Date) Template(org.wso2.carbon.database.utils.jdbc.Template) DB_SCHEMA_COLUMN_NAME_FILE_NAME(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_FILE_NAME) ERROR_CODE_GET_ATTRIBUTE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_GET_ATTRIBUTE) DB_SCHEMA_COLUMN_NAME_RESOURCE_TYPE_NAME(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_RESOURCE_TYPE_NAME) GET_RESOURCE_NAME_BY_ID(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_NAME_BY_ID) DB_SCHEMA_COLUMN_NAME_VALUE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_VALUE) Resource(org.wso2.carbon.identity.configuration.mgt.core.model.Resource) ERROR_CODE_RESOURCES_DOES_NOT_EXISTS(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_RESOURCES_DOES_NOT_EXISTS) GET_RESOURCES_BY_RESOURCE_TYPE_ID_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCES_BY_RESOURCE_TYPE_ID_SQL) DB_SCHEMA_COLUMN_NAME_FILE_ID(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_FILE_ID) INSERT_OR_UPDATE_ATTRIBUTE_ORACLE(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTE_ORACLE) ERROR_CODE_GET_FILES(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_GET_FILES) TimeZone(java.util.TimeZone) Timestamp(java.sql.Timestamp) PrimitiveConditionValidator(org.wso2.carbon.identity.configuration.mgt.core.search.PrimitiveConditionValidator) DELETE_ATTRIBUTE_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.DELETE_ATTRIBUTE_SQL) ERROR_CODE_RETRIEVE_RESOURCE_TYPE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_RETRIEVE_RESOURCE_TYPE) JdbcUtils.isMariaDB(org.wso2.carbon.identity.core.util.JdbcUtils.isMariaDB) ERROR_CODE_DELETE_FILES(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_DELETE_FILES) INSERT_OR_UPDATE_ATTRIBUTE_POSTGRESQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTE_POSTGRESQL) ConfigurationManagementServerException(org.wso2.carbon.identity.configuration.mgt.core.exception.ConfigurationManagementServerException) List(java.util.List) DELETE_RESOURCE_ATTRIBUTES_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.DELETE_RESOURCE_ATTRIBUTES_SQL) JdbcUtils.isH2DB(org.wso2.carbon.identity.core.util.JdbcUtils.isH2DB) ConfigurationUtils.handleServerException(org.wso2.carbon.identity.configuration.mgt.core.util.ConfigurationUtils.handleServerException) DataAccessException(org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException) UTC(java.time.ZoneOffset.UTC) GET_TENANT_RESOURCES_SELECT_COLUMNS_MYSQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_TENANT_RESOURCES_SELECT_COLUMNS_MYSQL) GET_RESOURCE_ID_TENANT_ID_BY_TYPE_ID_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_ID_TENANT_ID_BY_TYPE_ID_SQL) ERROR_CODE_GET_FILES_BY_TYPE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_GET_FILES_BY_TYPE) PrivilegedCarbonContext(org.wso2.carbon.context.PrivilegedCarbonContext) HashMap(java.util.HashMap) ConfigurationDAO(org.wso2.carbon.identity.configuration.mgt.core.dao.ConfigurationDAO) HashSet(java.util.HashSet) DB_SCHEMA_COLUMN_NAME_ATTRIBUTE_KEY(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_ATTRIBUTE_KEY) PrimitiveConditionValidationException(org.wso2.carbon.identity.configuration.mgt.core.search.exception.PrimitiveConditionValidationException) GET_RESOURCE_BY_ID_MYSQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_BY_ID_MYSQL) INSERT_OR_UPDATE_ATTRIBUTES_ORACLE(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_ATTRIBUTES_ORACLE) INSERT_RESOURCE_SQL_WITHOUT_CREATED_TIME(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_RESOURCE_SQL_WITHOUT_CREATED_TIME) TransactionException(org.wso2.carbon.database.utils.jdbc.exceptions.TransactionException) GET_RESOURCE_BY_NAME_MYSQL_WITHOUT_CREATED_TIME(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_BY_NAME_MYSQL_WITHOUT_CREATED_TIME) INSERT_OR_UPDATE_RESOURCE_TYPE_POSTGRESQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_TYPE_POSTGRESQL) INSERT_OR_UPDATE_RESOURCE_MYSQL_WITHOUT_CREATED_TIME(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_MYSQL_WITHOUT_CREATED_TIME) GET_RESOURCE_BY_NAME_MYSQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_BY_NAME_MYSQL) UPDATE_LAST_MODIFIED_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.UPDATE_LAST_MODIFIED_SQL) ERROR_CODE_SEARCH_TENANT_RESOURCES(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_SEARCH_TENANT_RESOURCES) PlaceholderSQL(org.wso2.carbon.identity.configuration.mgt.core.search.PlaceholderSQL) JdbcUtils(org.wso2.carbon.identity.core.util.JdbcUtils) GET_TENANT_RESOURCES_SELECT_COLUMNS_MYSQL_WITHOUT_CREATED_TIME(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_TENANT_RESOURCES_SELECT_COLUMNS_MYSQL_WITHOUT_CREATED_TIME) ConfigurationUtils.generateUniqueID(org.wso2.carbon.identity.configuration.mgt.core.util.ConfigurationUtils.generateUniqueID) GET_RESOURCE_ID_BY_NAME_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_RESOURCE_ID_BY_NAME_SQL) DB_SCHEMA_COLUMN_NAME_NAME(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_NAME) GET_ATTRIBUTES_BY_RESOURCE_ID_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.GET_ATTRIBUTES_BY_RESOURCE_ID_SQL) DB_SCHEMA_COLUMN_NAME_TENANT_ID(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_TENANT_ID) DB_SCHEMA_COLUMN_NAME_RESOURCE_ID(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.DB_SCHEMA_COLUMN_NAME_RESOURCE_ID) JdbcUtils.isMySQLDB(org.wso2.carbon.identity.core.util.JdbcUtils.isMySQLDB) Attribute(org.wso2.carbon.identity.configuration.mgt.core.model.Attribute) ConfigurationUtils.useCreatedTimeField(org.wso2.carbon.identity.configuration.mgt.core.util.ConfigurationUtils.useCreatedTimeField) INSERT_OR_UPDATE_RESOURCE_TYPE_ORACLE(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_TYPE_ORACLE) UPDATE_RESOURCE(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.UPDATE_RESOURCE) ResourceSearchBean(org.wso2.carbon.identity.configuration.mgt.core.model.ResourceSearchBean) ERROR_CODE_DELETE_RESOURCE_TYPE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_DELETE_RESOURCE_TYPE) DELETE_FILE_SQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.DELETE_FILE_SQL) JdbcUtils.isPostgreSQLDB(org.wso2.carbon.identity.core.util.JdbcUtils.isPostgreSQLDB) INSERT_OR_UPDATE_RESOURCE_MYSQL(org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.INSERT_OR_UPDATE_RESOURCE_MYSQL) Log(org.apache.commons.logging.Log) Blob(java.sql.Blob) ConfigurationUtils.getFilePath(org.wso2.carbon.identity.configuration.mgt.core.util.ConfigurationUtils.getFilePath) ERROR_CODE_GET_RESOURCE(org.wso2.carbon.identity.configuration.mgt.core.constant.ConfigurationConstants.ErrorMessages.ERROR_CODE_GET_RESOURCE) JdbcUtils.isDB2DB(org.wso2.carbon.identity.core.util.JdbcUtils.isDB2DB) InputStream(java.io.InputStream) JdbcTemplate(org.wso2.carbon.database.utils.jdbc.JdbcTemplate)

Aggregations

DataAccessException (org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException)21 Timestamp (java.sql.Timestamp)16 Date (java.util.Date)16 TransactionException (org.wso2.carbon.database.utils.jdbc.exceptions.TransactionException)14 SQLIntegrityConstraintViolationException (java.sql.SQLIntegrityConstraintViolationException)13 UTC (java.time.ZoneOffset.UTC)13 Calendar (java.util.Calendar)13 List (java.util.List)13 TimeZone (java.util.TimeZone)13 StringUtils (org.apache.commons.lang.StringUtils)13 Log (org.apache.commons.logging.Log)13 LogFactory (org.apache.commons.logging.LogFactory)13 PrivilegedCarbonContext (org.wso2.carbon.context.PrivilegedCarbonContext)13 IdentityTenantUtil (org.wso2.carbon.identity.core.util.IdentityTenantUtil)13 LambdaExceptionUtils (org.wso2.carbon.identity.core.util.LambdaExceptionUtils)13 JdbcTemplate (org.wso2.carbon.database.utils.jdbc.JdbcTemplate)11 NamedJdbcTemplate (org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate)11 InputStream (java.io.InputStream)8 Blob (java.sql.Blob)8 PreparedStatement (java.sql.PreparedStatement)8