FINERACT-821 Made changes to enforce ConstantName Checkstyle (2)
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
910eb1f7a8
commit
73e1fe77e9
+8
-8
@@ -52,7 +52,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class Utils {
|
public class Utils {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(Utils.class);
|
private final static Logger LOG = LoggerFactory.getLogger(Utils.class);
|
||||||
|
|
||||||
public static final String TENANT_PARAM_NAME = "tenantIdentifier";
|
public static final String TENANT_PARAM_NAME = "tenantIdentifier";
|
||||||
public static final String DEFAULT_TENANT = "default";
|
public static final String DEFAULT_TENANT = "default";
|
||||||
@@ -80,15 +80,15 @@ public class Utils {
|
|||||||
response = RestAssured.get(HEALTH_URL);
|
response = RestAssured.get(HEALTH_URL);
|
||||||
int healthHttpStatus = response.statusCode();
|
int healthHttpStatus = response.statusCode();
|
||||||
if (healthHttpStatus == 200) {
|
if (healthHttpStatus == 200) {
|
||||||
logger.info("{} return HTTP 200, application is now ready for integration testing!", HEALTH_URL);
|
LOG.info("{} return HTTP 200, application is now ready for integration testing!", HEALTH_URL);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
logger.info("{} returned HTTP {}, going to wait and retry (attempt {})", HEALTH_URL,
|
LOG.info("{} returned HTTP {}, going to wait and retry (attempt {})", HEALTH_URL,
|
||||||
healthHttpStatus, attempt++);
|
healthHttpStatus, attempt++);
|
||||||
sleep(3);
|
sleep(3);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.info("{} caused {}, going to wait and retry (attempt {})", HEALTH_URL, e.getMessage(),
|
LOG.info("{} caused {}, going to wait and retry (attempt {})", HEALTH_URL, e.getMessage(),
|
||||||
attempt++);
|
attempt++);
|
||||||
lastException = e;
|
lastException = e;
|
||||||
sleep(3);
|
sleep(3);
|
||||||
@@ -96,10 +96,10 @@ public class Utils {
|
|||||||
} while (attempt < max_attempts);
|
} while (attempt < max_attempts);
|
||||||
|
|
||||||
if (lastException != null) {
|
if (lastException != null) {
|
||||||
logger.error("{} still not reachable, giving up", HEALTH_URL, lastException);
|
LOG.error("{} still not reachable, giving up", HEALTH_URL, lastException);
|
||||||
throw new AssertionError(HEALTH_URL + " not reachable", lastException);
|
throw new AssertionError(HEALTH_URL + " not reachable", lastException);
|
||||||
} else {
|
} else {
|
||||||
logger.error("{} still has not returned HTTP 200, giving up (last) body: {}", HEALTH_URL,
|
LOG.error("{} still has not returned HTTP 200, giving up (last) body: {}", HEALTH_URL,
|
||||||
response.prettyPrint());
|
response.prettyPrint());
|
||||||
fail(HEALTH_URL + " returned " + response.prettyPrint());
|
fail(HEALTH_URL + " returned " + response.prettyPrint());
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ public class Utils {
|
|||||||
try {
|
try {
|
||||||
Thread.sleep(seconds * 1000);
|
Thread.sleep(seconds * 1000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.warn("Unexpected InterruptedException", e);
|
LOG.warn("Unexpected InterruptedException", e);
|
||||||
throw new IllegalStateException("Unexpected InterruptedException", e);
|
throw new IllegalStateException("Unexpected InterruptedException", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ public class Utils {
|
|||||||
public static String loginIntoServerAndGetBase64EncodedAuthenticationKey() {
|
public static String loginIntoServerAndGetBase64EncodedAuthenticationKey() {
|
||||||
awaitSpringBootActuatorHealthyUp();
|
awaitSpringBootActuatorHealthyUp();
|
||||||
try {
|
try {
|
||||||
logger.info("Logging in, for integration test...");
|
LOG.info("Logging in, for integration test...");
|
||||||
// system.out.println("-----------------------------------LOGIN-----------------------------------------");
|
// system.out.println("-----------------------------------LOGIN-----------------------------------------");
|
||||||
String json = RestAssured.given().contentType(ContentType.JSON)
|
String json = RestAssured.given().contentType(ContentType.JSON)
|
||||||
.body("{\"username\":\"mifos\", \"password\":\"password\"}").expect().log().ifError().when()
|
.body("{\"username\":\"mifos\", \"password\":\"password\"}").expect().log().ifError().when()
|
||||||
|
|||||||
+5
-5
@@ -47,7 +47,7 @@ import org.springframework.core.io.Resource;
|
|||||||
* @see ServerApplication for the same without the embedded MariaDB4j database
|
* @see ServerApplication for the same without the embedded MariaDB4j database
|
||||||
*/
|
*/
|
||||||
public class ServerWithMariaDB4jApplication {
|
public class ServerWithMariaDB4jApplication {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ServerWithMariaDB4jApplication.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ServerWithMariaDB4jApplication.class);
|
||||||
|
|
||||||
@Import({ MariaDB4jDataSourceConfiguration.class, EmbeddedTomcatWithSSLConfiguration.class })
|
@Import({ MariaDB4jDataSourceConfiguration.class, EmbeddedTomcatWithSSLConfiguration.class })
|
||||||
public static class Configuration extends AbstractApplicationConfiguration { }
|
public static class Configuration extends AbstractApplicationConfiguration { }
|
||||||
@@ -55,7 +55,7 @@ public class ServerWithMariaDB4jApplication {
|
|||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
ConfigurableApplicationContext ctx = SpringApplication.run(Configuration.class, args);
|
ConfigurableApplicationContext ctx = SpringApplication.run(Configuration.class, args);
|
||||||
if (!Desktop.isDesktopSupported()) {
|
if (!Desktop.isDesktopSupported()) {
|
||||||
logger.info("Not going to open UI homepage in local web browser, because !Desktop.isDesktopSupported()");
|
LOG.info("Not going to open UI homepage in local web browser, because !Desktop.isDesktopSupported()");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// apps/community-app/dist/community-app/index.html
|
// apps/community-app/dist/community-app/index.html
|
||||||
@@ -84,7 +84,7 @@ public class ServerWithMariaDB4jApplication {
|
|||||||
} else if (devResource.exists()) {
|
} else if (devResource.exists()) {
|
||||||
openWebBrowser(devURI);
|
openWebBrowser(devURI);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Cannot open Fineract UI in browser; not found: " + distResource.toString());
|
LOG.error("Cannot open Fineract UI in browser; not found: " + distResource.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,10 +95,10 @@ public class ServerWithMariaDB4jApplication {
|
|||||||
|
|
||||||
private static void openWebBrowser(URI uri) {
|
private static void openWebBrowser(URI uri) {
|
||||||
try {
|
try {
|
||||||
logger.info("Opening Fineract UI in browser: " + uri.toString());
|
LOG.info("Opening Fineract UI in browser: " + uri.toString());
|
||||||
Desktop.getDesktop().browse(uri);
|
Desktop.getDesktop().browse(uri);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error("IOException when opening Fineract UI in browser: " + uri.toString(), e);
|
LOG.error("IOException when opening Fineract UI in browser: " + uri.toString(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -47,7 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosureWritePlatformService {
|
public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosureWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(GLClosureWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(GLClosureWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final GLClosureRepository glClosureRepository;
|
private final GLClosureRepository glClosureRepository;
|
||||||
private final OfficeRepositoryWrapper officeRepositoryWrapper;
|
private final OfficeRepositoryWrapper officeRepositoryWrapper;
|
||||||
@@ -144,7 +144,7 @@ public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosure
|
|||||||
command.longValueOfParameterNamed(GLClosureJsonInputParams.OFFICE_ID.getValue()), new LocalDate(
|
command.longValueOfParameterNamed(GLClosureJsonInputParams.OFFICE_ID.getValue()), new LocalDate(
|
||||||
command.DateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue()))); }
|
command.DateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue()))); }
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.glClosure.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.glClosure.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource GL Closure: " + realCause.getMessage());
|
"Unknown data integrity issue with resource GL Closure: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -47,7 +47,7 @@ public class FinancialActivityAccountWritePlatformServiceImpl implements Financi
|
|||||||
private final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepository;
|
private final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepository;
|
||||||
private final FinancialActivityAccountDataValidator fromApiJsonDeserializer;
|
private final FinancialActivityAccountDataValidator fromApiJsonDeserializer;
|
||||||
private final GLAccountRepositoryWrapper glAccountRepositoryWrapper;
|
private final GLAccountRepositoryWrapper glAccountRepositoryWrapper;
|
||||||
private final static Logger logger = LoggerFactory.getLogger(FinancialActivityAccountWritePlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(FinancialActivityAccountWritePlatformServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public FinancialActivityAccountWritePlatformServiceImpl(
|
public FinancialActivityAccountWritePlatformServiceImpl(
|
||||||
@@ -154,7 +154,7 @@ public class FinancialActivityAccountWritePlatformServiceImpl implements Financi
|
|||||||
throw new DuplicateFinancialActivityAccountFoundException(financialActivityId);
|
throw new DuplicateFinancialActivityAccountFoundException(financialActivityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.glAccount.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.glAccount.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource GL Account: " + realCause.getMessage());
|
"Unknown data integrity issue with resource GL Account: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -57,7 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccountWritePlatformService {
|
public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccountWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(GLAccountWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(GLAccountWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final GLAccountRepository glAccountRepository;
|
private final GLAccountRepository glAccountRepository;
|
||||||
private final JournalEntryRepository glJournalEntryRepository;
|
private final JournalEntryRepository glJournalEntryRepository;
|
||||||
@@ -232,7 +232,7 @@ public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccount
|
|||||||
throw new GLAccountDuplicateException(glCode);
|
throw new GLAccountDuplicateException(glCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.glAccount.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.glAccount.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource GL Account: " + realCause.getMessage());
|
"Unknown data integrity issue with resource GL Account: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -53,7 +53,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntryRunningBalanceUpdateService {
|
public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntryRunningBalanceUpdateService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(JournalEntryRunningBalanceUpdateServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(JournalEntryRunningBalanceUpdateServiceImpl.class);
|
||||||
|
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
|
|||||||
Date entityDate = this.jdbcTemplate.queryForObject(dateFinder, Date.class);
|
Date entityDate = this.jdbcTemplate.queryForObject(dateFinder, Date.class);
|
||||||
updateOrganizationRunningBalance(entityDate);
|
updateOrganizationRunningBalance(entityDate);
|
||||||
} catch (EmptyResultDataAccessException e) {
|
} catch (EmptyResultDataAccessException e) {
|
||||||
logger.debug("No results found for updation of running balance ");
|
LOG.debug("No results found for updation of running balance ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
|
|||||||
Date entityDate = this.jdbcTemplate.queryForObject(dateFinder, Date.class, officeId);
|
Date entityDate = this.jdbcTemplate.queryForObject(dateFinder, Date.class, officeId);
|
||||||
updateRunningBalance(officeId, entityDate);
|
updateRunningBalance(officeId, entityDate);
|
||||||
} catch (EmptyResultDataAccessException e) {
|
} catch (EmptyResultDataAccessException e) {
|
||||||
logger.debug("No results found for updation of office running balance with office id: {}", officeId);
|
LOG.debug("No results found for updation of office running balance with office id: {}", officeId);
|
||||||
}
|
}
|
||||||
commandProcessingResultBuilder.withOfficeId(officeId);
|
commandProcessingResultBuilder.withOfficeId(officeId);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -88,7 +88,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
@Service
|
@Service
|
||||||
public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements JournalEntryWritePlatformService {
|
public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements JournalEntryWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(JournalEntryWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(JournalEntryWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final GLClosureRepository glClosureRepository;
|
private final GLClosureRepository glClosureRepository;
|
||||||
private final GLAccountRepository glAccountRepository;
|
private final GLAccountRepository glAccountRepository;
|
||||||
@@ -640,7 +640,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
|
|||||||
|
|
||||||
private PlatformDataIntegrityException handleJournalEntryDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
private PlatformDataIntegrityException handleJournalEntryDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
||||||
final Throwable realCause = dve.getMostSpecificCause();
|
final Throwable realCause = dve.getMostSpecificCause();
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
return new PlatformDataIntegrityException("error.msg.glJournalEntry.unknown.data.integrity.issue",
|
return new PlatformDataIntegrityException("error.msg.glJournalEntry.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource Journal Entry: " + realCause.getMessage());
|
"Unknown data integrity issue with resource Journal Entry: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -57,7 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements AccountingRuleWritePlatformService {
|
public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements AccountingRuleWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AccountingRuleWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AccountingRuleWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final AccountingRuleRepositoryWrapper accountingRuleRepositoryWrapper;
|
private final AccountingRuleRepositoryWrapper accountingRuleRepositoryWrapper;
|
||||||
private final AccountingRuleRepository accountingRuleRepository;
|
private final AccountingRuleRepository accountingRuleRepository;
|
||||||
@@ -89,7 +89,7 @@ public class AccountingRuleWritePlatformServiceJpaRepositoryImpl implements Acco
|
|||||||
throw new AccountingRuleDuplicateException(command.stringValueOfParameterNamed(AccountingRuleJsonInputParams.NAME.getValue()));
|
throw new AccountingRuleDuplicateException(command.stringValueOfParameterNamed(AccountingRuleJsonInputParams.NAME.getValue()));
|
||||||
} else if (realCause.getMessage().contains("UNIQUE_ACCOUNT_RULE_TAGS")) { throw new AccountingRuleDuplicateException(); }
|
} else if (realCause.getMessage().contains("UNIQUE_ACCOUNT_RULE_TAGS")) { throw new AccountingRuleDuplicateException(); }
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.accounting.rule.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.accounting.rule.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource Accounting Rule: " + realCause.getMessage());
|
"Unknown data integrity issue with resource Accounting Rule: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -41,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service(value = "adHocScheduledJobRunnerService")
|
@Service(value = "adHocScheduledJobRunnerService")
|
||||||
public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunnerService {
|
public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunnerService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AdHocScheduledJobRunnerServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AdHocScheduledJobRunnerServiceImpl.class);
|
||||||
private final AdHocReadPlatformService adHocReadPlatformService;
|
private final AdHocReadPlatformService adHocReadPlatformService;
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
@@ -105,17 +105,17 @@ public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunn
|
|||||||
.append(adhoc.getQuery());
|
.append(adhoc.getQuery());
|
||||||
if (insertSqlBuilder.length() > 0) {
|
if (insertSqlBuilder.length() > 0) {
|
||||||
final int result = this.jdbcTemplate.update(insertSqlBuilder.toString());
|
final int result = this.jdbcTemplate.update(insertSqlBuilder.toString());
|
||||||
logger.info("{}: Results affected by inserted: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
LOG.info("{}: Results affected by inserted: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||||
|
|
||||||
this.jdbcTemplate.update("UPDATE m_adhoc SET last_run=? WHERE id=?", new Date(), adhoc.getId());
|
this.jdbcTemplate.update("UPDATE m_adhoc SET last_run=? WHERE id=?", new Date(), adhoc.getId());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info("{}: Skipping execution of {}, scheduled for execution on {}",
|
LOG.info("{}: Skipping execution of {}, scheduled for execution on {}",
|
||||||
new Object[] { ThreadLocalContextUtil.getTenant().getName(), adhoc.getName(), next });
|
new Object[] { ThreadLocalContextUtil.getTenant().getName(), adhoc.getName(), next });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
logger.info("{} Nothing to update", ThreadLocalContextUtil.getTenant().getName());
|
LOG.info("{} Nothing to update", ThreadLocalContextUtil.getTenant().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -37,7 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePlatformService {
|
public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AdHocWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AdHocWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final AdHocRepository adHocRepository;
|
private final AdHocRepository adHocRepository;
|
||||||
private final AdHocDataValidator adHocCommandFromApiJsonDeserializer;
|
private final AdHocDataValidator adHocCommandFromApiJsonDeserializer;
|
||||||
@@ -93,7 +93,7 @@ public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePla
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
+3
-3
@@ -74,7 +74,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AuditReadPlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AuditReadPlatformServiceImpl.class);
|
||||||
private final static Set<String> supportedOrderByValues = new HashSet<>(
|
private final static Set<String> supportedOrderByValues = new HashSet<>(
|
||||||
Arrays.asList("id", "actionName", "entityName", "resourceId", "subresourceId", "madeOnDate", "checkedOnDate", "officeName",
|
Arrays.asList("id", "actionName", "entityName", "resourceId", "subresourceId", "madeOnDate", "checkedOnDate", "officeName",
|
||||||
"groupName", "clientName", "loanAccountNo", "savingsAccountNo", "clientId", "loanId"));
|
"groupName", "clientName", "loanAccountNo", "savingsAccountNo", "clientId", "loanId"));
|
||||||
@@ -214,7 +214,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
|||||||
this.columnValidator.validateSqlInjection(sqlBuilder.toString(), parameters.limitSql());
|
this.columnValidator.validateSqlInjection(sqlBuilder.toString(), parameters.limitSql());
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("sql: {}", sqlBuilder);
|
LOG.info("sql: {}", sqlBuilder);
|
||||||
|
|
||||||
final String sqlCountRows = "SELECT FOUND_ROWS()";
|
final String sqlCountRows = "SELECT FOUND_ROWS()";
|
||||||
return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), extraCriteria.getArguments(), rm);
|
return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), extraCriteria.getArguments(), rm);
|
||||||
@@ -251,7 +251,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
|||||||
}
|
}
|
||||||
sql += extraCriteria.getSQLTemplate();
|
sql += extraCriteria.getSQLTemplate();
|
||||||
sql += groupAndOrderBySQL;
|
sql += groupAndOrderBySQL;
|
||||||
logger.info("sql: {}", sql);
|
LOG.info("sql: {}", sql);
|
||||||
|
|
||||||
return this.jdbcTemplate.query(sql, rm, extraCriteria.getArguments());
|
return this.jdbcTemplate.query(sql, rm, extraCriteria.getArguments());
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -50,7 +50,7 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio
|
|||||||
private final FromJsonHelper fromApiJsonHelper;
|
private final FromJsonHelper fromApiJsonHelper;
|
||||||
private final CommandProcessingService processAndLogCommandService;
|
private final CommandProcessingService processAndLogCommandService;
|
||||||
private final SchedulerJobRunnerReadService schedulerJobRunnerReadService;
|
private final SchedulerJobRunnerReadService schedulerJobRunnerReadService;
|
||||||
private final static Logger logger = LoggerFactory.getLogger(PortfolioCommandSourceWritePlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(PortfolioCommandSourceWritePlatformServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public PortfolioCommandSourceWritePlatformServiceImpl(final PlatformSecurityContext context,
|
public PortfolioCommandSourceWritePlatformServiceImpl(final PlatformSecurityContext context,
|
||||||
@@ -96,13 +96,13 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio
|
|||||||
result = this.processAndLogCommandService.processAndLogCommand(wrapper, command, isApprovedByChecker);
|
result = this.processAndLogCommandService.processAndLogCommand(wrapper, command, isApprovedByChecker);
|
||||||
numberOfRetries = maxNumberOfRetries + 1;
|
numberOfRetries = maxNumberOfRetries + 1;
|
||||||
} catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) {
|
} catch (CannotAcquireLockException | ObjectOptimisticLockingFailureException exception) {
|
||||||
logger.info("The following command {} has been retried {} time(s)", command.json(), numberOfRetries);
|
LOG.info("The following command {} has been retried {} time(s)", command.json(), numberOfRetries);
|
||||||
/***
|
/***
|
||||||
* Fail if the transaction has been retired for
|
* Fail if the transaction has been retired for
|
||||||
* maxNumberOfRetries
|
* maxNumberOfRetries
|
||||||
**/
|
**/
|
||||||
if (numberOfRetries >= maxNumberOfRetries) {
|
if (numberOfRetries >= maxNumberOfRetries) {
|
||||||
logger.warn("The following command {} has been retried for the max allowed attempts of {} and will be rolled back",
|
LOG.warn("The following command {} has been retried for the max allowed attempts of {} and will be rolled back",
|
||||||
command.json(), numberOfRetries);
|
command.json(), numberOfRetries);
|
||||||
throw (exception);
|
throw (exception);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -41,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class AccountNumberFormatWritePlatformServiceJpaRepositoryImpl implements AccountNumberFormatWritePlatformService {
|
public class AccountNumberFormatWritePlatformServiceJpaRepositoryImpl implements AccountNumberFormatWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AccountNumberFormatWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
private final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository;
|
private final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository;
|
||||||
private final AccountNumberFormatDataValidator accountNumberFormatDataValidator;
|
private final AccountNumberFormatDataValidator accountNumberFormatDataValidator;
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ public class AccountNumberFormatWritePlatformServiceJpaRepositoryImpl implements
|
|||||||
"Account Format preferences for Account type `" + entityAccountType.getCode() + "` already exists", "externalId",
|
"Account Format preferences for Account type `" + entityAccountType.getCode() + "` already exists", "externalId",
|
||||||
entityAccountType.getValue(), entityAccountType.getCode());
|
entityAccountType.getValue(), entityAccountType.getCode());
|
||||||
}
|
}
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.account.number.format.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.account.number.format.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -99,7 +99,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampaignWritePlatformService {
|
public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampaignWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(EmailCampaignWritePlatformCommandHandlerImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(EmailCampaignWritePlatformCommandHandlerImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
|
|||||||
LocalDateTime tenantDateNow = tenantDateTime();
|
LocalDateTime tenantDateNow = tenantDateTime();
|
||||||
LocalDateTime nextTriggerDate = emailCampaignData.getNextTriggerDate().toLocalDateTime();
|
LocalDateTime nextTriggerDate = emailCampaignData.getNextTriggerDate().toLocalDateTime();
|
||||||
|
|
||||||
logger.info("tenant time {} trigger time {}", tenantDateNow, nextTriggerDate);
|
LOG.info("tenant time {} trigger time {}", tenantDateNow, nextTriggerDate);
|
||||||
if (nextTriggerDate.isBefore(tenantDateNow)) {
|
if (nextTriggerDate.isBefore(tenantDateNow)) {
|
||||||
insertDirectCampaignIntoEmailOutboundTable(emailCampaignData.getParamValue(), emailCampaignData.getEmailSubject(),
|
insertDirectCampaignIntoEmailOutboundTable(emailCampaignData.getParamValue(), emailCampaignData.getEmailSubject(),
|
||||||
emailCampaignData.getMessage(), emailCampaignData.getCampaignName(), emailCampaignData.getId());
|
emailCampaignData.getMessage(), emailCampaignData.getCampaignName(), emailCampaignData.getId());
|
||||||
|
|||||||
+2
-2
@@ -37,7 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class EmailWritePlatformServiceJpaRepositoryImpl implements EmailWritePlatformService {
|
public class EmailWritePlatformServiceJpaRepositoryImpl implements EmailWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(EmailWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(EmailWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final EmailMessageAssembler assembler;
|
private final EmailMessageAssembler assembler;
|
||||||
private final EmailMessageRepository repository;
|
private final EmailMessageRepository repository;
|
||||||
@@ -126,7 +126,7 @@ public class EmailWritePlatformServiceJpaRepositoryImpl implements EmailWritePla
|
|||||||
if (realCause.getMessage().contains("email_address")) { throw new PlatformDataIntegrityException("error.msg.email.no.email.address.exists",
|
if (realCause.getMessage().contains("email_address")) { throw new PlatformDataIntegrityException("error.msg.email.no.email.address.exists",
|
||||||
"The group, client or staff provided has no email address.", "id"); }
|
"The group, client or staff provided has no email address.", "id"); }
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.email.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.email.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -64,7 +64,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(SmsCampaignDomainServiceImpl.class);
|
private static final Logger LOG = LoggerFactory.getLogger(SmsCampaignDomainServiceImpl.class);
|
||||||
|
|
||||||
//private final static int POOL_SIZE = 5 ;
|
//private final static int POOL_SIZE = 5 ;
|
||||||
|
|
||||||
@@ -235,9 +235,9 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("smsParams does not contain the key: ", e);
|
LOG.error("smsParams does not contain the key: ", e);
|
||||||
} catch (final RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
logger.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
LOG.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,9 +293,9 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
|
|||||||
this.smsMessageScheduledJobService.sendTriggeredMessages(smsDataMap);
|
this.smsMessageScheduledJobService.sendTriggeredMessages(smsDataMap);
|
||||||
}
|
}
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("smsParams does not contain the key: ", e);
|
LOG.error("smsParams does not contain the key: ", e);
|
||||||
} catch (final RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
logger.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
LOG.debug("Client Office Id and SMS Campaign Office id doesn't match ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-11
@@ -94,7 +94,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWritePlatformService {
|
public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(SmsCampaignWritePlatformServiceJpaImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(SmsCampaignWritePlatformServiceJpaImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("Error occured.", e) ;
|
LOG.error("Error occured.", e) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -302,9 +302,9 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("Error occured.", e) ;
|
LOG.error("Error occured.", e) ;
|
||||||
} catch (final RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
logger.error("Error occured.", e) ;
|
LOG.error("Error occured.", e) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,9 +347,9 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("Error occured.", e) ;
|
LOG.error("Error occured.", e) ;
|
||||||
} catch (final RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
logger.error("Error occured.", e) ;
|
LOG.error("Error occured.", e) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,9 +391,9 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("Error occured.", e) ;
|
LOG.error("Error occured.", e) ;
|
||||||
} catch (final RuntimeException e) {
|
} catch (final RuntimeException e) {
|
||||||
logger.error("Error occured.", e) ;
|
LOG.error("Error occured.", e) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -537,7 +537,7 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
|||||||
final String response = this.genericDataService.generateJsonFromGenericResultsetData(results);
|
final String response = this.genericDataService.generateJsonFromGenericResultsetData(results);
|
||||||
resultList = new ObjectMapper().readValue(response, new TypeReference<List<HashMap<String, Object>>>() {});
|
resultList = new ObjectMapper().readValue(response, new TypeReference<List<HashMap<String, Object>>>() {});
|
||||||
} catch (JsonParseException e) {
|
} catch (JsonParseException e) {
|
||||||
logger.info("Conversion of report query results to JSON failed", e);
|
LOG.info("Conversion of report query results to JSON failed", e);
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
// loop changes array date to string date
|
// loop changes array date to string date
|
||||||
@@ -656,7 +656,7 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
|||||||
LocalDateTime tenantDateNow = tenantDateTime();
|
LocalDateTime tenantDateNow = tenantDateTime();
|
||||||
LocalDateTime nextTriggerDate = smsCampaign.getNextTriggerDate();
|
LocalDateTime nextTriggerDate = smsCampaign.getNextTriggerDate();
|
||||||
|
|
||||||
logger.info("tenant time {} trigger time {} {}",
|
LOG.info("tenant time {} trigger time {} {}",
|
||||||
new Object[] { tenantDateNow, nextTriggerDate, JobName.UPDATE_SMS_OUTBOUND_WITH_CAMPAIGN_MESSAGE.name() });
|
new Object[] { tenantDateNow, nextTriggerDate, JobName.UPDATE_SMS_OUTBOUND_WITH_CAMPAIGN_MESSAGE.name() });
|
||||||
if (nextTriggerDate.isBefore(tenantDateNow)) {
|
if (nextTriggerDate.isBefore(tenantDateNow)) {
|
||||||
insertDirectCampaignIntoSmsOutboundTable(smsCampaign);
|
insertDirectCampaignIntoSmsOutboundTable(smsCampaign);
|
||||||
@@ -697,7 +697,7 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// catch (Exception e) {
|
// catch (Exception e) {
|
||||||
// logger.error("Invalid phone number or country calling code, must contain only numbers", e);
|
// LOG.error("Invalid phone number or country calling code, must contain only numbers", e);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return formatedPhoneNumber.toString();
|
// return formatedPhoneNumber.toString();
|
||||||
|
|||||||
+3
-3
@@ -42,7 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValueWritePlatformService {
|
public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValueWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(CodeValueWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(CodeValueWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
||||||
@@ -102,7 +102,7 @@ public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValue
|
|||||||
+ "' already exists", "name", name);
|
+ "' already exists", "name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.code.value.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.code.value.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValue
|
|||||||
.withSubEntityId(codeValueId)//
|
.withSubEntityId(codeValueId)//
|
||||||
.build();
|
.build();
|
||||||
} catch (final DataIntegrityViolationException dve) {
|
} catch (final DataIntegrityViolationException dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
final Throwable realCause = dve.getMostSpecificCause();
|
final Throwable realCause = dve.getMostSpecificCause();
|
||||||
if (realCause.getMessage().contains("code_value")) { throw new PlatformDataIntegrityException("error.msg.codeValue.in.use",
|
if (realCause.getMessage().contains("code_value")) { throw new PlatformDataIntegrityException("error.msg.codeValue.in.use",
|
||||||
"This code value is in use", codeValueId); }
|
"This code value is in use", codeValueId); }
|
||||||
|
|||||||
+2
-2
@@ -42,7 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatformService {
|
public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(CodeWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(CodeWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final CodeRepository codeRepository;
|
private final CodeRepository codeRepository;
|
||||||
@@ -148,7 +148,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf
|
|||||||
"name", name);
|
"name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.cund.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.cund.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class ExternalServiceWritePlatformServiceJpaRepositoryImpl implements ExternalServiceWritePlatformService {
|
public class ExternalServiceWritePlatformServiceJpaRepositoryImpl implements ExternalServiceWritePlatformService {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ExternalServiceWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ExternalServiceWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final ExternalServicesPropertiesRepositoryWrapper repositoryWrapper;
|
private final ExternalServicesPropertiesRepositoryWrapper repositoryWrapper;
|
||||||
|
|||||||
+2
-2
@@ -38,7 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class GlobalConfigurationWritePlatformServiceJpaRepositoryImpl implements GlobalConfigurationWritePlatformService {
|
public class GlobalConfigurationWritePlatformServiceJpaRepositoryImpl implements GlobalConfigurationWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(GlobalConfigurationWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final GlobalConfigurationRepositoryWrapper repository;
|
private final GlobalConfigurationRepositoryWrapper repository;
|
||||||
@@ -107,7 +107,7 @@ public class GlobalConfigurationWritePlatformServiceJpaRepositoryImpl implements
|
|||||||
private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
||||||
|
|
||||||
final Throwable realCause = dve.getMostSpecificCause();
|
final Throwable realCause = dve.getMostSpecificCause();
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.globalConfiguration.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.globalConfiguration.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -31,7 +31,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class AbandonedConnectionCleanupShutdownListener implements ApplicationListener<ContextClosedEvent> {
|
public class AbandonedConnectionCleanupShutdownListener implements ApplicationListener<ContextClosedEvent> {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AbandonedConnectionCleanupShutdownListener.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AbandonedConnectionCleanupShutdownListener.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see JobRegisterServiceImpl#onApplicationEvent(ContextClosedEvent) doc
|
* @see JobRegisterServiceImpl#onApplicationEvent(ContextClosedEvent) doc
|
||||||
@@ -46,9 +46,9 @@ public class AbandonedConnectionCleanupShutdownListener implements ApplicationLi
|
|||||||
/*try {
|
/*try {
|
||||||
|
|
||||||
AbandonedConnectionCleanupThread.shutdown(); tomcat memoroy leak with mysql connector. With Drizzle not required
|
AbandonedConnectionCleanupThread.shutdown(); tomcat memoroy leak with mysql connector. With Drizzle not required
|
||||||
logger.info("Shut-down of AbandonedConnectionCleanupThread successful");
|
LOG.info("Shut-down of AbandonedConnectionCleanupThread successful");
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.error("Exception occurred while shut-down of AbandonedConnectionCleanupThread", t);
|
LOG.error("Exception occurred while shut-down of AbandonedConnectionCleanupThread", t);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// This manually deregisters JDBC driver, which prevents Tomcat 7 from
|
// This manually deregisters JDBC driver, which prevents Tomcat 7 from
|
||||||
@@ -58,15 +58,15 @@ public class AbandonedConnectionCleanupShutdownListener implements ApplicationLi
|
|||||||
Driver driver = drivers.nextElement();
|
Driver driver = drivers.nextElement();
|
||||||
try {
|
try {
|
||||||
java.sql.DriverManager.deregisterDriver(driver);
|
java.sql.DriverManager.deregisterDriver(driver);
|
||||||
logger.info("JDBC driver de-registered successfully");
|
LOG.info("JDBC driver de-registered successfully");
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.error("Exception occured while deristering jdbc driver", t);
|
LOG.error("Exception occured while deristering jdbc driver", t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Thread.sleep(2000L);
|
Thread.sleep(2000L);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Exception Occcured while trying to sleep.", e);
|
LOG.error("Exception Occcured while trying to sleep.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -73,7 +73,7 @@ public class DatatablesApiResource {
|
|||||||
private final ReadWriteNonCoreDataService readWriteNonCoreDataService;
|
private final ReadWriteNonCoreDataService readWriteNonCoreDataService;
|
||||||
private final ToApiJsonSerializer<GenericResultsetData> toApiJsonSerializer;
|
private final ToApiJsonSerializer<GenericResultsetData> toApiJsonSerializer;
|
||||||
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
||||||
private final static org.slf4j.Logger logger = LoggerFactory.getLogger(DatatablesApiResource.class);
|
private final static org.slf4j.Logger LOG = LoggerFactory.getLogger(DatatablesApiResource.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DatatablesApiResource(final PlatformSecurityContext context, final GenericDataService genericDataService,
|
public DatatablesApiResource(final PlatformSecurityContext context, final GenericDataService genericDataService,
|
||||||
@@ -227,7 +227,7 @@ public class DatatablesApiResource {
|
|||||||
public String getDatatableManyEntry(@PathParam("datatable") final String datatable, @PathParam("apptableId") final Long apptableId,
|
public String getDatatableManyEntry(@PathParam("datatable") final String datatable, @PathParam("apptableId") final Long apptableId,
|
||||||
@PathParam("datatableId") final Long datatableId, @QueryParam("order") final String order, @Context final UriInfo uriInfo) {
|
@PathParam("datatableId") final Long datatableId, @QueryParam("order") final String order, @Context final UriInfo uriInfo) {
|
||||||
|
|
||||||
logger.debug("::1 we came in the getDatatbleManyEntry apiRessource method");
|
LOG.debug("::1 we came in the getDatatbleManyEntry apiRessource method");
|
||||||
|
|
||||||
this.context.authenticatedUser().validateHasDatatableReadPermission(datatable);
|
this.context.authenticatedUser().validateHasDatatableReadPermission(datatable);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -71,7 +71,7 @@ public class EntityDatatableChecksApiResource {
|
|||||||
private final EntityDatatableChecksReadService readEntityDatatableChecksService;
|
private final EntityDatatableChecksReadService readEntityDatatableChecksService;
|
||||||
private final ToApiJsonSerializer<GenericResultsetData> toApiJsonSerializer;
|
private final ToApiJsonSerializer<GenericResultsetData> toApiJsonSerializer;
|
||||||
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
||||||
private final static org.slf4j.Logger logger = LoggerFactory.getLogger(EntityDatatableChecksApiResource.class);
|
private final static org.slf4j.Logger LOG = LoggerFactory.getLogger(EntityDatatableChecksApiResource.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public EntityDatatableChecksApiResource(final PlatformSecurityContext context, final GenericDataService genericDataService,
|
public EntityDatatableChecksApiResource(final PlatformSecurityContext context, final GenericDataService genericDataService,
|
||||||
|
|||||||
+5
-5
@@ -56,7 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class EntityDatatableChecksWritePlatformServiceImpl implements EntityDatatableChecksWritePlatformService {
|
public class EntityDatatableChecksWritePlatformServiceImpl implements EntityDatatableChecksWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(EntityDatatableChecksWritePlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(EntityDatatableChecksWritePlatformServiceImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final EntityDatatableChecksDataValidator fromApiJsonDeserializer;
|
private final EntityDatatableChecksDataValidator fromApiJsonDeserializer;
|
||||||
@@ -105,7 +105,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
final String foreignKeyColumnName = EntityTables.getForeignKeyColumnNameOnDatatable(entity);
|
final String foreignKeyColumnName = EntityTables.getForeignKeyColumnNameOnDatatable(entity);
|
||||||
final boolean columnExist = datatableData.hasColumn(foreignKeyColumnName);
|
final boolean columnExist = datatableData.hasColumn(foreignKeyColumnName);
|
||||||
|
|
||||||
logger.info("{} has column {} ? {}", new Object[] { datatableData.getRegisteredTableName(), foreignKeyColumnName, columnExist });
|
LOG.info("{} has column {} ? {}", new Object[] { datatableData.getRegisteredTableName(), foreignKeyColumnName, columnExist });
|
||||||
|
|
||||||
if (!columnExist) { throw new EntityDatatableCheckNotSupportedException(datatableData.getRegisteredTableName(), entity); }
|
if (!columnExist) { throw new EntityDatatableCheckNotSupportedException(datatableData.getRegisteredTableName(), entity); }
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
final String datatableName = t.getDatatableName();
|
final String datatableName = t.getDatatableName();
|
||||||
final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn);
|
final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn);
|
||||||
|
|
||||||
logger.info("The are {} entries in the table {}", countEntries, datatableName);
|
LOG.info("The are {} entries in the table {}", countEntries, datatableName);
|
||||||
if (countEntries.intValue() == 0) {
|
if (countEntries.intValue() == 0) {
|
||||||
reqDatatables.add(datatableName);
|
reqDatatables.add(datatableName);
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
final String datatableName = t.getDatatableName();
|
final String datatableName = t.getDatatableName();
|
||||||
final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn);
|
final Long countEntries = readWriteNonCoreDataService.countDatatableEntries(datatableName, entityId, foreignKeyColumn);
|
||||||
|
|
||||||
logger.info("The are {} entries in the table {}", countEntries, datatableName);
|
LOG.info("The are {} entries in the table {}", countEntries, datatableName);
|
||||||
if (countEntries.intValue() == 0) {
|
if (countEntries.intValue() == 0) {
|
||||||
reqDatatables.add(datatableName);
|
reqDatatables.add(datatableName);
|
||||||
}
|
}
|
||||||
@@ -289,7 +289,7 @@ public class EntityDatatableChecksWritePlatformServiceImpl implements EntityData
|
|||||||
throw new EntityDatatableCheckAlreadyExistsException(entity, status, datatableName, productId);
|
throw new EntityDatatableCheckAlreadyExistsException(entity, status, datatableName, productId);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dae);
|
LOG.error("Error occured.", dae);
|
||||||
throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -44,7 +44,7 @@ public class GenericDataServiceImpl implements GenericDataService {
|
|||||||
|
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
private final DataSource dataSource;
|
private final DataSource dataSource;
|
||||||
private final static Logger logger = LoggerFactory.getLogger(GenericDataServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(GenericDataServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public GenericDataServiceImpl(final RoutingDataSource dataSource) {
|
public GenericDataServiceImpl(final RoutingDataSource dataSource) {
|
||||||
@@ -197,7 +197,7 @@ public class GenericDataServiceImpl implements GenericDataService {
|
|||||||
@Override
|
@Override
|
||||||
public List<ResultsetColumnHeaderData> fillResultsetColumnHeaders(final String datatable) {
|
public List<ResultsetColumnHeaderData> fillResultsetColumnHeaders(final String datatable) {
|
||||||
|
|
||||||
logger.debug("::3 Was inside the fill ResultSetColumnHeader");
|
LOG.debug("::3 Was inside the fill ResultSetColumnHeader");
|
||||||
|
|
||||||
final SqlRowSet columnDefinitions = getDatatableMetaData(datatable);
|
final SqlRowSet columnDefinitions = getDatatableMetaData(datatable);
|
||||||
|
|
||||||
|
|||||||
+13
-13
@@ -67,7 +67,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class ReadReportingServiceImpl implements ReadReportingService {
|
public class ReadReportingServiceImpl implements ReadReportingService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ReadReportingServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ReadReportingServiceImpl.class);
|
||||||
private final static String REPORT_NAME_REGEX_PATTERN = "^[a-zA-Z][a-zA-Z0-9\\-_\\s]{0,48}[a-zA-Z0-9]$";
|
private final static String REPORT_NAME_REGEX_PATTERN = "^[a-zA-Z][a-zA-Z0-9\\-_\\s]{0,48}[a-zA-Z0-9]$";
|
||||||
|
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
@@ -127,7 +127,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
final StringBuilder writer = new StringBuilder();
|
final StringBuilder writer = new StringBuilder();
|
||||||
|
|
||||||
final List<ResultsetColumnHeaderData> columnHeaders = result.getColumnHeaders();
|
final List<ResultsetColumnHeaderData> columnHeaders = result.getColumnHeaders();
|
||||||
logger.info("NO. of Columns: {}", columnHeaders.size());
|
LOG.info("NO. of Columns: {}", columnHeaders.size());
|
||||||
final Integer chSize = columnHeaders.size();
|
final Integer chSize = columnHeaders.size();
|
||||||
for (int i = 0; i < chSize; i++) {
|
for (int i = 0; i < chSize; i++) {
|
||||||
writer.append('"' + columnHeaders.get(i).getColumnName() + '"');
|
writer.append('"' + columnHeaders.get(i).getColumnName() + '"');
|
||||||
@@ -145,7 +145,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
String currVal;
|
String currVal;
|
||||||
final String doubleQuote = "\"";
|
final String doubleQuote = "\"";
|
||||||
final String twoDoubleQuotes = doubleQuote + doubleQuote;
|
final String twoDoubleQuotes = doubleQuote + doubleQuote;
|
||||||
logger.info("NO. of Rows: {}", data.size());
|
LOG.info("NO. of Rows: {}", data.size());
|
||||||
for (int i = 0; i < data.size(); i++) {
|
for (int i = 0; i < data.size(); i++) {
|
||||||
row = data.get(i).getRow();
|
row = data.get(i).getRow();
|
||||||
rSize = row.size();
|
rSize = row.size();
|
||||||
@@ -177,14 +177,14 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
final Map<String, String> queryParams, final boolean isSelfServiceUserReport) {
|
final Map<String, String> queryParams, final boolean isSelfServiceUserReport) {
|
||||||
|
|
||||||
final long startTime = System.currentTimeMillis();
|
final long startTime = System.currentTimeMillis();
|
||||||
logger.info("STARTING REPORT: {} Type: {}", name, type);
|
LOG.info("STARTING REPORT: {} Type: {}", name, type);
|
||||||
|
|
||||||
final String sql = getSQLtoRun(name, type, queryParams, isSelfServiceUserReport);
|
final String sql = getSQLtoRun(name, type, queryParams, isSelfServiceUserReport);
|
||||||
|
|
||||||
final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql);
|
final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql);
|
||||||
|
|
||||||
final long elapsed = System.currentTimeMillis() - startTime;
|
final long elapsed = System.currentTimeMillis() - startTime;
|
||||||
logger.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", new Object[] { name, type, elapsed });
|
LOG.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", new Object[] { name, type, elapsed });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
final Set<String> keys = queryParams.keySet();
|
final Set<String> keys = queryParams.keySet();
|
||||||
for (final String key : keys) {
|
for (final String key : keys) {
|
||||||
final String pValue = queryParams.get(key);
|
final String pValue = queryParams.get(key);
|
||||||
// logger.info("({} : {})", key, pValue);
|
// LOG.info("({} : {})", key, pValue);
|
||||||
sql = this.genericDataService.replace(sql, key, pValue);
|
sql = this.genericDataService.replace(sql, key, pValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
final List<ResultsetRowData> data = result.getData();
|
final List<ResultsetRowData> data = result.getData();
|
||||||
List<String> row;
|
List<String> row;
|
||||||
|
|
||||||
logger.info("NO. of Columns: {}", columnHeaders.size());
|
LOG.info("NO. of Columns: {}", columnHeaders.size());
|
||||||
final Integer chSize = columnHeaders.size();
|
final Integer chSize = columnHeaders.size();
|
||||||
|
|
||||||
final Document document = new Document(PageSize.B0.rotate());
|
final Document document = new Document(PageSize.B0.rotate());
|
||||||
@@ -285,7 +285,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
Integer rSize;
|
Integer rSize;
|
||||||
String currColType;
|
String currColType;
|
||||||
String currVal;
|
String currVal;
|
||||||
logger.info("NO. of Rows: {}", data.size());
|
LOG.info("NO. of Rows: {}", data.size());
|
||||||
for (int i = 0; i < data.size(); i++) {
|
for (int i = 0; i < data.size(); i++) {
|
||||||
row = data.get(i).getRow();
|
row = data.get(i).getRow();
|
||||||
rSize = row.size();
|
rSize = row.size();
|
||||||
@@ -308,7 +308,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
document.close();
|
document.close();
|
||||||
return genaratePdf;
|
return genaratePdf;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
logger.error("error.msg.reporting.error:", e);
|
LOG.error("error.msg.reporting.error:", e);
|
||||||
throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage());
|
throw new PlatformDataIntegrityException("error.msg.exception.error", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -507,14 +507,14 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
@Override
|
@Override
|
||||||
public GenericResultsetData retrieveGenericResultSetForSmsEmailCampaign(String name, String type, Map<String, String> queryParams) {
|
public GenericResultsetData retrieveGenericResultSetForSmsEmailCampaign(String name, String type, Map<String, String> queryParams) {
|
||||||
final long startTime = System.currentTimeMillis();
|
final long startTime = System.currentTimeMillis();
|
||||||
logger.info("STARTING REPORT: {} Type: {}", name, type);
|
LOG.info("STARTING REPORT: {} Type: {}", name, type);
|
||||||
|
|
||||||
final String sql = sqlToRunForSmsEmailCampaign(name, type, queryParams);
|
final String sql = sqlToRunForSmsEmailCampaign(name, type, queryParams);
|
||||||
|
|
||||||
final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql);
|
final GenericResultsetData result = this.genericDataService.fillGenericResultSet(sql);
|
||||||
|
|
||||||
final long elapsed = System.currentTimeMillis() - startTime;
|
final long elapsed = System.currentTimeMillis() - startTime;
|
||||||
logger.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", new Object[] { name, type, elapsed });
|
LOG.info("FINISHING Report/Request Name: {} - {} Elapsed Time: {}", new Object[] { name, type, elapsed });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,7 +525,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
final Set<String> keys = queryParams.keySet();
|
final Set<String> keys = queryParams.keySet();
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
final String pValue = queryParams.get(key);
|
final String pValue = queryParams.get(key);
|
||||||
// logger.info("(" + key + " : " + pValue + ")");
|
// LOG.info("(" + key + " : " + pValue + ")");
|
||||||
key = "${" + key + "}";
|
key = "${" + key + "}";
|
||||||
sql = this.genericDataService.replace(sql, key, pValue);
|
sql = this.genericDataService.replace(sql, key, pValue);
|
||||||
}
|
}
|
||||||
@@ -554,7 +554,7 @@ public class ReadReportingServiceImpl implements ReadReportingService {
|
|||||||
|
|
||||||
final String reportPath = FileSystemContentRepository.FINERACT_BASE_DIR + File.separator + "pentahoReports" + File.separator
|
final String reportPath = FileSystemContentRepository.FINERACT_BASE_DIR + File.separator + "pentahoReports" + File.separator
|
||||||
+ reportName + ".prpt";
|
+ reportName + ".prpt";
|
||||||
logger.info("Report path: {}", reportPath);
|
LOG.info("Report path: {}", reportPath);
|
||||||
|
|
||||||
// load report definition
|
// load report definition
|
||||||
final ResourceManager manager = new ResourceManager();
|
final ResourceManager manager = new ResourceManager();
|
||||||
|
|||||||
+8
-8
@@ -88,7 +88,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
|||||||
|
|
||||||
private final static String CODE_VALUES_TABLE = "m_code_value";
|
private final static String CODE_VALUES_TABLE = "m_code_value";
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ReadWriteNonCoreDataServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ReadWriteNonCoreDataServiceImpl.class);
|
||||||
private final static HashMap<String, String> apiTypeToMySQL = new HashMap<String, String>() {
|
private final static HashMap<String, String> apiTypeToMySQL = new HashMap<String, String>() {
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -206,7 +206,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -751,7 +751,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
|||||||
try {
|
try {
|
||||||
codeId = this.jdbcTemplate.queryForObject(checkColumnCodeMapping.toString(), Integer.class);
|
codeId = this.jdbcTemplate.queryForObject(checkColumnCodeMapping.toString(), Integer.class);
|
||||||
} catch (final EmptyResultDataAccessException e) {
|
} catch (final EmptyResultDataAccessException e) {
|
||||||
logger.info("Error occured.", e);
|
LOG.info("Error occured.", e);
|
||||||
}
|
}
|
||||||
return ObjectUtils.defaultIfNull(codeId, 0);
|
return ObjectUtils.defaultIfNull(codeId, 0);
|
||||||
}
|
}
|
||||||
@@ -1135,13 +1135,13 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
|||||||
pkValue = datatableId;
|
pkValue = datatableId;
|
||||||
}
|
}
|
||||||
final String sql = getUpdateSql(grs.getColumnHeaders(), dataTableName, pkName, pkValue, changes);
|
final String sql = getUpdateSql(grs.getColumnHeaders(), dataTableName, pkName, pkValue, changes);
|
||||||
logger.info("Update sql: {}", sql);
|
LOG.info("Update sql: {}", sql);
|
||||||
if (StringUtils.isNotBlank(sql)) {
|
if (StringUtils.isNotBlank(sql)) {
|
||||||
this.jdbcTemplate.update(sql);
|
this.jdbcTemplate.update(sql);
|
||||||
changes.put("locale", dataParams.get("locale"));
|
changes.put("locale", dataParams.get("locale"));
|
||||||
changes.put("dateFormat", "yyyy-MM-dd");
|
changes.put("dateFormat", "yyyy-MM-dd");
|
||||||
} else {
|
} else {
|
||||||
logger.info("No Changes");
|
LOG.info("No Changes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1242,7 +1242,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
|||||||
private CommandProcessingResult checkMainResourceExistsWithinScope(final String appTable, final Long appTableId) {
|
private CommandProcessingResult checkMainResourceExistsWithinScope(final String appTable, final Long appTableId) {
|
||||||
|
|
||||||
final String sql = dataScopedSQL(appTable, appTableId);
|
final String sql = dataScopedSQL(appTable, appTableId);
|
||||||
logger.info("data scoped sql: {}", sql);
|
LOG.info("data scoped sql: {}", sql);
|
||||||
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
|
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
|
||||||
|
|
||||||
if (!rs.next()) { throw new DatatableNotFoundException(appTable, appTableId); }
|
if (!rs.next()) { throw new DatatableNotFoundException(appTable, appTableId); }
|
||||||
@@ -1434,7 +1434,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
|||||||
addSql = "insert into `" + datatable + "` (`" + fkName + "` " + insertColumns + ")" + " select " + appTableId + " as id"
|
addSql = "insert into `" + datatable + "` (`" + fkName + "` " + insertColumns + ")" + " select " + appTableId + " as id"
|
||||||
+ selectColumns;
|
+ selectColumns;
|
||||||
|
|
||||||
logger.info("{}", addSql);
|
LOG.info("{}", addSql);
|
||||||
|
|
||||||
return addSql;
|
return addSql;
|
||||||
}
|
}
|
||||||
@@ -1485,7 +1485,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
|||||||
+ " as id" + selectColumns + " , ( SELECT SUM( code_score ) FROM m_code_value WHERE m_code_value.id IN (" + scoresId
|
+ " as id" + selectColumns + " , ( SELECT SUM( code_score ) FROM m_code_value WHERE m_code_value.id IN (" + scoresId
|
||||||
+ " ) ) as score";
|
+ " ) ) as score";
|
||||||
|
|
||||||
logger.info("{}", vaddSql);
|
LOG.info("{}", vaddSql);
|
||||||
|
|
||||||
return vaddSql;
|
return vaddSql;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -53,7 +53,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class ReportWritePlatformServiceImpl implements ReportWritePlatformService {
|
public class ReportWritePlatformServiceImpl implements ReportWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ReportWritePlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ReportWritePlatformServiceImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final ReportCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
private final ReportCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
||||||
@@ -185,7 +185,7 @@ public class ReportWritePlatformServiceImpl implements ReportWritePlatformServic
|
|||||||
"name", name);
|
"name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.report.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
public class FileSystemContentRepository implements ContentRepository {
|
public class FileSystemContentRepository implements ContentRepository {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(FileSystemContentRepository.class);
|
private final static Logger LOG = LoggerFactory.getLogger(FileSystemContentRepository.class);
|
||||||
|
|
||||||
public static final String FINERACT_BASE_DIR = System.getProperty("user.home") + File.separator + ".fineract";
|
public static final String FINERACT_BASE_DIR = System.getProperty("user.home") + File.separator + ".fineract";
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ public class FileSystemContentRepository implements ContentRepository {
|
|||||||
} catch (final IOException ioe) {
|
} catch (final IOException ioe) {
|
||||||
throw new ContentManagementException(imageName, ioe.getMessage());
|
throw new ContentManagementException(imageName, ioe.getMessage());
|
||||||
} catch (IllegalArgumentException iae) {
|
} catch (IllegalArgumentException iae) {
|
||||||
logger.error("IllegalArgumentException due to invalid Base64 encoding: {}", base64EncodedImageString, iae);
|
LOG.error("IllegalArgumentException due to invalid Base64 encoding: {}", base64EncodedImageString, iae);
|
||||||
throw iae;
|
throw iae;
|
||||||
}
|
}
|
||||||
return fileLocation;
|
return fileLocation;
|
||||||
@@ -97,7 +97,7 @@ public class FileSystemContentRepository implements ContentRepository {
|
|||||||
final boolean fileDeleted = deleteFile(location);
|
final boolean fileDeleted = deleteFile(location);
|
||||||
if (!fileDeleted) {
|
if (!fileDeleted) {
|
||||||
// no need to throw an Error, simply log a warning
|
// no need to throw an Error, simply log a warning
|
||||||
logger.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
LOG.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ public class FileSystemContentRepository implements ContentRepository {
|
|||||||
out.flush();
|
out.flush();
|
||||||
out.close();
|
out.close();
|
||||||
} catch (final IOException ioException) {
|
} catch (final IOException ioException) {
|
||||||
logger.warn("writeFileToFileSystem() IOException (logged because cause is not propagated in ContentManagementException)", ioException);
|
LOG.warn("writeFileToFileSystem() IOException (logged because cause is not propagated in ContentManagementException)", ioException);
|
||||||
throw new ContentManagementException(fileName, ioException.getMessage());
|
throw new ContentManagementException(fileName, ioException.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
public class S3ContentRepository implements ContentRepository {
|
public class S3ContentRepository implements ContentRepository {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(S3ContentRepository.class);
|
private final static Logger LOG = LoggerFactory.getLogger(S3ContentRepository.class);
|
||||||
|
|
||||||
private final String s3BucketName;
|
private final String s3BucketName;
|
||||||
private final AmazonS3 s3Client;
|
private final AmazonS3 s3Client;
|
||||||
@@ -106,10 +106,10 @@ public class S3ContentRepository implements ContentRepository {
|
|||||||
deleteObjectFromS3(location);
|
deleteObjectFromS3(location);
|
||||||
} catch (final AmazonServiceException ase) {
|
} catch (final AmazonServiceException ase) {
|
||||||
deleteObjectAmazonServiceExceptionMessage(ase);
|
deleteObjectAmazonServiceExceptionMessage(ase);
|
||||||
logger.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
LOG.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
||||||
} catch (final AmazonClientException ace) {
|
} catch (final AmazonClientException ace) {
|
||||||
deleteObjectAmazonClientExceptionMessage(ace);
|
deleteObjectAmazonClientExceptionMessage(ace);
|
||||||
logger.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
LOG.warn("Unable to delete image associated with clients with Id {}", resourceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,11 +123,11 @@ public class S3ContentRepository implements ContentRepository {
|
|||||||
FileData fileData = null;
|
FileData fileData = null;
|
||||||
final String fileName = documentData.fileName();
|
final String fileName = documentData.fileName();
|
||||||
try {
|
try {
|
||||||
logger.info("Downloading an object");
|
LOG.info("Downloading an object");
|
||||||
final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, documentData.fileLocation()));
|
final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, documentData.fileLocation()));
|
||||||
fileData = new FileData(s3object.getObjectContent(), fileName, documentData.contentType());
|
fileData = new FileData(s3object.getObjectContent(), fileName, documentData.contentType());
|
||||||
} catch (final AmazonClientException ace) {
|
} catch (final AmazonClientException ace) {
|
||||||
logger.error("Error occured.", ace);
|
LOG.error("Error occured.", ace);
|
||||||
throw new DocumentNotFoundException(documentData.getParentEntityType(), documentData.getParentEntityId(), documentData.getId());
|
throw new DocumentNotFoundException(documentData.getParentEntityType(), documentData.getParentEntityId(), documentData.getId());
|
||||||
}
|
}
|
||||||
return fileData;
|
return fileData;
|
||||||
@@ -139,21 +139,21 @@ public class S3ContentRepository implements ContentRepository {
|
|||||||
final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, imageData.location()));
|
final S3Object s3object = this.s3Client.getObject(new GetObjectRequest(this.s3BucketName, imageData.location()));
|
||||||
imageData.updateContent(s3object.getObjectContent());
|
imageData.updateContent(s3object.getObjectContent());
|
||||||
}catch(AmazonS3Exception e) {
|
}catch(AmazonS3Exception e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
return imageData;
|
return imageData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteObjectAmazonClientExceptionMessage(final AmazonClientException ace) {
|
private void deleteObjectAmazonClientExceptionMessage(final AmazonClientException ace) {
|
||||||
final String message = "Caught an AmazonClientException." + "Error Message: " + ace.getMessage();
|
final String message = "Caught an AmazonClientException." + "Error Message: " + ace.getMessage();
|
||||||
logger.error("{}", message);
|
LOG.error("{}", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteObjectAmazonServiceExceptionMessage(final AmazonServiceException ase) {
|
private void deleteObjectAmazonServiceExceptionMessage(final AmazonServiceException ase) {
|
||||||
final String message = "Caught an AmazonServiceException." + "Error Message: " + ase.getMessage() + "HTTP Status Code: "
|
final String message = "Caught an AmazonServiceException." + "Error Message: " + ase.getMessage() + "HTTP Status Code: "
|
||||||
+ ase.getStatusCode() + "AWS Error Code: " + ase.getErrorCode() + "Error Type: " + ase.getErrorType()
|
+ ase.getStatusCode() + "AWS Error Code: " + ase.getErrorCode() + "Error Type: " + ase.getErrorType()
|
||||||
+ "Request ID: " + ase.getRequestId();
|
+ "Request ID: " + ase.getRequestId();
|
||||||
logger.error("{}", message);
|
LOG.error("{}", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String generateFileParentDirectory(final String entityType, final Long entityId) {
|
private String generateFileParentDirectory(final String entityType, final Long entityId) {
|
||||||
@@ -172,7 +172,7 @@ public class S3ContentRepository implements ContentRepository {
|
|||||||
private void uploadDocument(final String filename, final InputStream inputStream, final String s3UploadLocation)
|
private void uploadDocument(final String filename, final InputStream inputStream, final String s3UploadLocation)
|
||||||
throws ContentManagementException {
|
throws ContentManagementException {
|
||||||
try {
|
try {
|
||||||
logger.info("Uploading a new object to S3 from a file to {}", s3UploadLocation);
|
LOG.info("Uploading a new object to S3 from a file to {}", s3UploadLocation);
|
||||||
this.s3Client.putObject(new PutObjectRequest(this.s3BucketName, s3UploadLocation, inputStream, new ObjectMetadata()));
|
this.s3Client.putObject(new PutObjectRequest(this.s3BucketName, s3UploadLocation, inputStream, new ObjectMetadata()));
|
||||||
} catch (final AmazonClientException ace) {
|
} catch (final AmazonClientException ace) {
|
||||||
final String message = ace.getMessage();
|
final String message = ace.getMessage();
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
public class FileData {
|
public class FileData {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(FileData.class);
|
private static final Logger LOG = LoggerFactory.getLogger(FileData.class);
|
||||||
|
|
||||||
private final File file;
|
private final File file;
|
||||||
private final String fileName;
|
private final String fileName;
|
||||||
@@ -61,7 +61,7 @@ public class FileData {
|
|||||||
if (this.inputStream == null) { return new FileInputStream(this.file); }
|
if (this.inputStream == null) { return new FileInputStream(this.file); }
|
||||||
return this.inputStream;
|
return this.inputStream;
|
||||||
} catch (final FileNotFoundException e) {
|
} catch (final FileNotFoundException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
public class ImageData {
|
public class ImageData {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ImageData.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ImageData.class);
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final Long imageId;
|
private final Long imageId;
|
||||||
@@ -67,7 +67,7 @@ public class ImageData {
|
|||||||
return IOUtils.toByteArray(fileInputStream);
|
return IOUtils.toByteArray(fileInputStream);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class ImageData {
|
|||||||
out = resizeImage(this.inputStream, maxWidth != null ? maxWidth : Integer.MAX_VALUE,
|
out = resizeImage(this.inputStream, maxWidth != null ? maxWidth : Integer.MAX_VALUE,
|
||||||
maxHeight != null ? maxHeight : Integer.MAX_VALUE);
|
maxHeight != null ? maxHeight : Integer.MAX_VALUE);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
} else if (this.storageType.equals(StorageType.FILE_SYSTEM.getValue()) && this.file != null) {
|
} else if (this.storageType.equals(StorageType.FILE_SYSTEM.getValue()) && this.file != null) {
|
||||||
FileInputStream fis = null;
|
FileInputStream fis = null;
|
||||||
@@ -120,13 +120,13 @@ public class ImageData {
|
|||||||
fis = new FileInputStream(this.file);
|
fis = new FileInputStream(this.file);
|
||||||
out = resizeImage(fis, maxWidth != null ? maxWidth : Integer.MAX_VALUE, maxHeight != null ? maxHeight : Integer.MAX_VALUE);
|
out = resizeImage(fis, maxWidth != null ? maxWidth : Integer.MAX_VALUE, maxHeight != null ? maxHeight : Integer.MAX_VALUE);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.error("Error occured.", ex);
|
LOG.error("Error occured.", ex);
|
||||||
} finally {
|
} finally {
|
||||||
if (fis != null) {
|
if (fis != null) {
|
||||||
try {
|
try {
|
||||||
fis.close();
|
fis.close();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.error("Error occured.", ex);
|
LOG.error("Error occured.", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ public class ImageData {
|
|||||||
try {
|
try {
|
||||||
available = this.inputStream.available();
|
available = this.inputStream.available();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
} else if (this.storageType.equals(StorageType.FILE_SYSTEM.getValue()) && this.file != null) {
|
} else if (this.storageType.equals(StorageType.FILE_SYSTEM.getValue()) && this.file != null) {
|
||||||
FileInputStream fileInputStream = null;
|
FileInputStream fileInputStream = null;
|
||||||
@@ -190,15 +190,15 @@ public class ImageData {
|
|||||||
available = fileInputStream.available();
|
available = fileInputStream.available();
|
||||||
fileInputStream.close();
|
fileInputStream.close();
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
} finally {
|
} finally {
|
||||||
if (fileInputStream != null) {
|
if (fileInputStream != null) {
|
||||||
try {
|
try {
|
||||||
fileInputStream.close();
|
fileInputStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.error("Problem occurred in available function",e);
|
LOG.error("Problem occurred in available function",e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -42,7 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWritePlatformService {
|
public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(DocumentWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(DocumentWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final DocumentRepository documentRepository;
|
private final DocumentRepository documentRepository;
|
||||||
@@ -80,7 +80,7 @@ public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWr
|
|||||||
|
|
||||||
return document.getId();
|
return document.getId();
|
||||||
} catch (final DataIntegrityViolationException dve) {
|
} catch (final DataIntegrityViolationException dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
@@ -136,11 +136,11 @@ public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWr
|
|||||||
|
|
||||||
return new CommandProcessingResult(documentForUpdate.getId());
|
return new CommandProcessingResult(documentForUpdate.getId());
|
||||||
} catch (final DataIntegrityViolationException dve) {
|
} catch (final DataIntegrityViolationException dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
} catch (final ContentManagementException cme) {
|
} catch (final ContentManagementException cme) {
|
||||||
logger.error("Error occured.", cme);
|
LOG.error("Error occured.", cme);
|
||||||
throw new ContentManagementException(documentCommand.getName(), cme.getMessage());
|
throw new ContentManagementException(documentCommand.getName(), cme.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -46,7 +46,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
|||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
private final static Logger logger = LoggerFactory.getLogger(FineractEntityAccessReadServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(FineractEntityAccessReadServiceImpl.class);
|
||||||
private final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepository;
|
private final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepository;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -106,7 +106,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
|||||||
if (accessListCSVStrBuf != null) {
|
if (accessListCSVStrBuf != null) {
|
||||||
returnIdListStr = accessListCSVStrBuf.toString();
|
returnIdListStr = accessListCSVStrBuf.toString();
|
||||||
}
|
}
|
||||||
logger.debug("List of IDs applicable: {}", returnIdListStr);
|
LOG.debug("List of IDs applicable: {}", returnIdListStr);
|
||||||
return returnIdListStr;
|
return returnIdListStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
|
|||||||
str.append("from m_entity_to_entity_mapping eem ");
|
str.append("from m_entity_to_entity_mapping eem ");
|
||||||
str.append("where eem.rel_id = ? ");
|
str.append("where eem.rel_id = ? ");
|
||||||
str.append("and eem.from_id = ? ");
|
str.append("and eem.from_id = ? ");
|
||||||
logger.debug("{}", str);
|
LOG.debug("{}", str);
|
||||||
return str.toString();
|
return str.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -89,7 +89,7 @@ public class Sender {
|
|||||||
protected static final int MAX_BACKOFF_DELAY = 1024000;
|
protected static final int MAX_BACKOFF_DELAY = 1024000;
|
||||||
|
|
||||||
protected final Random random = new Random();
|
protected final Random random = new Random();
|
||||||
protected static final Logger logger = Logger.getLogger(Sender.class
|
protected static final Logger LOG = Logger.getLogger(Sender.class
|
||||||
.getName());
|
.getName());
|
||||||
|
|
||||||
private final String key;
|
private final String key;
|
||||||
@@ -179,8 +179,8 @@ public class Sender {
|
|||||||
boolean tryAgain;
|
boolean tryAgain;
|
||||||
do {
|
do {
|
||||||
attempt++;
|
attempt++;
|
||||||
if (logger.isLoggable(Level.FINE)) {
|
if (LOG.isLoggable(Level.FINE)) {
|
||||||
logger.fine("Attempt #" + attempt + " to send message "
|
LOG.fine("Attempt #" + attempt + " to send message "
|
||||||
+ message + " to regIds " + to);
|
+ message + " to regIds " + to);
|
||||||
}
|
}
|
||||||
result = sendNoRetry(message, to);
|
result = sendNoRetry(message, to);
|
||||||
@@ -265,7 +265,7 @@ public class Sender {
|
|||||||
.status(status)
|
.status(status)
|
||||||
.errorCode(error);
|
.errorCode(error);
|
||||||
} else {
|
} else {
|
||||||
logger.log(Level.WARNING,
|
LOG.log(Level.WARNING,
|
||||||
"Found null or " + jsonResults.size()
|
"Found null or " + jsonResults.size()
|
||||||
+ " results, expected one");
|
+ " results, expected one");
|
||||||
return null;
|
return null;
|
||||||
@@ -280,7 +280,7 @@ public class Sender {
|
|||||||
String error = jsonResponse.get(JSON_ERROR).getAsString();
|
String error = jsonResponse.get(JSON_ERROR).getAsString();
|
||||||
resultBuilder.errorCode(error);
|
resultBuilder.errorCode(error);
|
||||||
} else {
|
} else {
|
||||||
logger.log(Level.WARNING, "Expected " + JSON_MESSAGE_ID
|
LOG.log(Level.WARNING, "Expected " + JSON_MESSAGE_ID
|
||||||
+ " or " + JSON_ERROR + " found: " + responseBody);
|
+ " or " + JSON_ERROR + " found: " + responseBody);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ public class Sender {
|
|||||||
resultBuilder.success(success).failure(failure)
|
resultBuilder.success(success).failure(failure)
|
||||||
.failedRegistrationIds(failedIds);
|
.failedRegistrationIds(failedIds);
|
||||||
} else {
|
} else {
|
||||||
logger.warning("Unrecognized response: " + responseBody);
|
LOG.warning("Unrecognized response: " + responseBody);
|
||||||
throw newIoException(responseBody, new Exception(
|
throw newIoException(responseBody, new Exception(
|
||||||
"Unrecognized response."));
|
"Unrecognized response."));
|
||||||
}
|
}
|
||||||
@@ -351,19 +351,19 @@ public class Sender {
|
|||||||
do {
|
do {
|
||||||
multicastResult = null;
|
multicastResult = null;
|
||||||
attempt++;
|
attempt++;
|
||||||
if (logger.isLoggable(Level.FINE)) {
|
if (LOG.isLoggable(Level.FINE)) {
|
||||||
logger.fine("Attempt #" + attempt + " to send message "
|
LOG.fine("Attempt #" + attempt + " to send message "
|
||||||
+ message + " to regIds " + unsentRegIds);
|
+ message + " to regIds " + unsentRegIds);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
multicastResult = sendNoRetry(message, unsentRegIds);
|
multicastResult = sendNoRetry(message, unsentRegIds);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// no need for WARNING since exception might be already logged
|
// no need for WARNING since exception might be already logged
|
||||||
logger.log(Level.FINEST, "IOException on attempt " + attempt, e);
|
LOG.log(Level.FINEST, "IOException on attempt " + attempt, e);
|
||||||
}
|
}
|
||||||
if (multicastResult != null) {
|
if (multicastResult != null) {
|
||||||
long multicastId = multicastResult.getMulticastId();
|
long multicastId = multicastResult.getMulticastId();
|
||||||
logger.fine("multicast_id on attempt # " + attempt + ": "
|
LOG.fine("multicast_id on attempt # " + attempt + ": "
|
||||||
+ multicastId);
|
+ multicastId);
|
||||||
multicastIds.add(multicastId);
|
multicastIds.add(multicastId);
|
||||||
unsentRegIds = updateStatus(unsentRegIds, results,
|
unsentRegIds = updateStatus(unsentRegIds, results,
|
||||||
@@ -516,37 +516,37 @@ public class Sender {
|
|||||||
private Map<String , Object> makeGcmHttpRequest(Map<Object, Object> jsonRequest)
|
private Map<String , Object> makeGcmHttpRequest(Map<Object, Object> jsonRequest)
|
||||||
throws InvalidRequestException {
|
throws InvalidRequestException {
|
||||||
String requestBody = new Gson().toJson(jsonRequest);
|
String requestBody = new Gson().toJson(jsonRequest);
|
||||||
logger.finest("JSON request: " + requestBody);
|
LOG.finest("JSON request: " + requestBody);
|
||||||
HttpURLConnection conn;
|
HttpURLConnection conn;
|
||||||
int status;
|
int status;
|
||||||
try {
|
try {
|
||||||
conn = post(getEndpoint(), "application/json", requestBody);
|
conn = post(getEndpoint(), "application/json", requestBody);
|
||||||
status = conn.getResponseCode();
|
status = conn.getResponseCode();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.log(Level.FINE, "IOException posting to GCM", e);
|
LOG.log(Level.FINE, "IOException posting to GCM", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String responseBody;
|
String responseBody;
|
||||||
if (status != 200) {
|
if (status != 200) {
|
||||||
try {
|
try {
|
||||||
responseBody = getAndClose(conn.getErrorStream());
|
responseBody = getAndClose(conn.getErrorStream());
|
||||||
logger.finest("JSON error response: " + responseBody);
|
LOG.finest("JSON error response: " + responseBody);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// ignore the exception since it will thrown an
|
// ignore the exception since it will thrown an
|
||||||
// InvalidRequestException
|
// InvalidRequestException
|
||||||
// anyways
|
// anyways
|
||||||
responseBody = "N/A";
|
responseBody = "N/A";
|
||||||
logger.log(Level.FINE, "Exception reading response: ", e);
|
LOG.log(Level.FINE, "Exception reading response: ", e);
|
||||||
}
|
}
|
||||||
throw new InvalidRequestException(status, responseBody);
|
throw new InvalidRequestException(status, responseBody);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
responseBody = getAndClose(conn.getInputStream());
|
responseBody = getAndClose(conn.getInputStream());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.log(Level.WARNING, "IOException reading response", e);
|
LOG.log(Level.WARNING, "IOException reading response", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
logger.finest("JSON response: " + responseBody);
|
LOG.finest("JSON response: " + responseBody);
|
||||||
Map<String , Object> map = new HashMap<>();
|
Map<String , Object> map = new HashMap<>();
|
||||||
map.put("responseBody", responseBody);
|
map.put("responseBody", responseBody);
|
||||||
map.put("status", status);
|
map.put("status", status);
|
||||||
@@ -612,7 +612,7 @@ public class Sender {
|
|||||||
// cause
|
// cause
|
||||||
// is only available on Java 6
|
// is only available on Java 6
|
||||||
String msg = "Error parsing JSON response (" + responseBody + ")";
|
String msg = "Error parsing JSON response (" + responseBody + ")";
|
||||||
logger.log(Level.WARNING, msg, e);
|
LOG.log(Level.WARNING, msg, e);
|
||||||
return new IOException(msg + ":" + e);
|
return new IOException(msg + ":" + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -622,7 +622,7 @@ public class Sender {
|
|||||||
closeable.close();
|
closeable.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// ignore error
|
// ignore error
|
||||||
logger.log(Level.FINEST, "IOException closing stream", e);
|
LOG.log(Level.FINEST, "IOException closing stream", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -692,10 +692,10 @@ public class Sender {
|
|||||||
throw new IllegalArgumentException("arguments cannot be null");
|
throw new IllegalArgumentException("arguments cannot be null");
|
||||||
}
|
}
|
||||||
if (!url.startsWith("https://")) {
|
if (!url.startsWith("https://")) {
|
||||||
logger.warning("URL does not use https: " + url);
|
LOG.warning("URL does not use https: " + url);
|
||||||
}
|
}
|
||||||
logger.fine("Sending POST to " + url);
|
LOG.fine("Sending POST to " + url);
|
||||||
logger.finest("POST body: " + body);
|
LOG.finest("POST body: " + body);
|
||||||
byte[] bytes = body.getBytes(StandardCharsets.UTF_8);
|
byte[] bytes = body.getBytes(StandardCharsets.UTF_8);
|
||||||
HttpURLConnection conn = getConnection(url);
|
HttpURLConnection conn = getConnection(url);
|
||||||
conn.setDoOutput(true);
|
conn.setDoOutput(true);
|
||||||
|
|||||||
+3
-3
@@ -38,7 +38,7 @@ import retrofit.client.Response;
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class ProcessorHelper {
|
public class ProcessorHelper {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory
|
private final static Logger LOG = LoggerFactory
|
||||||
.getLogger(ProcessorHelper.class);
|
.getLogger(ProcessorHelper.class);
|
||||||
|
|
||||||
@SuppressWarnings("null")
|
@SuppressWarnings("null")
|
||||||
@@ -95,12 +95,12 @@ public class ProcessorHelper {
|
|||||||
return new Callback() {
|
return new Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void success(final Object o, final Response response) {
|
public void success(final Object o, final Response response) {
|
||||||
logger.info("URL: {}\tStatus: {}", url, response.getStatus());
|
LOG.info("URL: {}\tStatus: {}", url, response.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void failure(final RetrofitError retrofitError) {
|
public void failure(final RetrofitError retrofitError) {
|
||||||
logger.info("Error occured.", retrofitError);
|
LOG.info("Error occured.", retrofitError);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -66,7 +66,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class JobRegisterServiceImpl implements JobRegisterService, ApplicationListener<ContextClosedEvent> {
|
public class JobRegisterServiceImpl implements JobRegisterService, ApplicationListener<ContextClosedEvent> {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(JobRegisterServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(JobRegisterServiceImpl.class);
|
||||||
|
|
||||||
// MIFOSX-1184: This class cannot use constructor injection, because one of
|
// MIFOSX-1184: This class cannot use constructor injection, because one of
|
||||||
// its dependencies (SchedulerStopListener) has a circular dependency to
|
// its dependencies (SchedulerStopListener) has a circular dependency to
|
||||||
@@ -164,7 +164,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
|
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
final String msg = "Job execution failed for job with id:" + scheduledJobDetail.getId();
|
final String msg = "Job execution failed for job with id:" + scheduledJobDetail.getId();
|
||||||
logger.error("{}", msg, e);
|
LOG.error("{}", msg, e);
|
||||||
throw new PlatformInternalServerException("error.msg.sheduler.job.execution.failed", msg, scheduledJobDetail.getId());
|
throw new PlatformInternalServerException("error.msg.sheduler.job.execution.failed", msg, scheduledJobDetail.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (final SchedulerException e) {
|
} catch (final SchedulerException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jobDetail.updateTriggerMisfired(false);
|
jobDetail.updateTriggerMisfired(false);
|
||||||
@@ -281,7 +281,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
scheduledJobDetails.updateNextRunTime(null);
|
scheduledJobDetails.updateNextRunTime(null);
|
||||||
final String stackTrace = getStackTraceAsString(throwable);
|
final String stackTrace = getStackTraceAsString(throwable);
|
||||||
scheduledJobDetails.updateErrorLog(stackTrace);
|
scheduledJobDetails.updateErrorLog(stackTrace);
|
||||||
logger.error("Could not schedule job: {}", scheduledJobDetails.getJobName(), throwable);
|
LOG.error("Could not schedule job: {}", scheduledJobDetails.getJobName(), throwable);
|
||||||
}
|
}
|
||||||
scheduledJobDetails.updateCurrentlyRunningStatus(false);
|
scheduledJobDetails.updateCurrentlyRunningStatus(false);
|
||||||
}
|
}
|
||||||
@@ -292,7 +292,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
try {
|
try {
|
||||||
scheduler.shutdown();
|
scheduler.shutdown();
|
||||||
} catch (final SchedulerException e) {
|
} catch (final SchedulerException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,7 +317,7 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
try {
|
try {
|
||||||
scheduler.shutdown();
|
scheduler.shutdown();
|
||||||
} catch (final SchedulerException e) {
|
} catch (final SchedulerException e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -35,7 +35,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Component
|
@Component
|
||||||
public class SchedulerTriggerListener implements TriggerListener {
|
public class SchedulerTriggerListener implements TriggerListener {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(SchedulerTriggerListener.class);
|
private final static Logger LOG = LoggerFactory.getLogger(SchedulerTriggerListener.class);
|
||||||
|
|
||||||
private final SchedularWritePlatformService schedularService;
|
private final SchedularWritePlatformService schedularService;
|
||||||
private final TenantDetailsService tenantDetailsService;
|
private final TenantDetailsService tenantDetailsService;
|
||||||
@@ -54,7 +54,7 @@ public class SchedulerTriggerListener implements TriggerListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void triggerFired(Trigger trigger, JobExecutionContext context) {
|
public void triggerFired(Trigger trigger, JobExecutionContext context) {
|
||||||
logger.debug("triggerFired() trigger={}, context={}", trigger, context);
|
LOG.debug("triggerFired() trigger={}, context={}", trigger, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -77,7 +77,7 @@ public class SchedulerTriggerListener implements TriggerListener {
|
|||||||
vetoJob = this.schedularService.processJobDetailForExecution(jobKey, triggerType);
|
vetoJob = this.schedularService.processJobDetailForExecution(jobKey, triggerType);
|
||||||
numberOfRetries = maxNumberOfRetries + 1;
|
numberOfRetries = maxNumberOfRetries + 1;
|
||||||
} catch (Exception exception) { // Adding generic exception as it depends on JPA provider
|
} catch (Exception exception) { // Adding generic exception as it depends on JPA provider
|
||||||
logger.warn("vetoJobExecution() not able to acquire the lock to update job running status at retry {} (of {}) for JobKey: {}",
|
LOG.warn("vetoJobExecution() not able to acquire the lock to update job running status at retry {} (of {}) for JobKey: {}",
|
||||||
numberOfRetries, maxNumberOfRetries, jobKey, exception);
|
numberOfRetries, maxNumberOfRetries, jobKey, exception);
|
||||||
try {
|
try {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
@@ -85,12 +85,12 @@ public class SchedulerTriggerListener implements TriggerListener {
|
|||||||
Thread.sleep(1000 + (randomNum * 1000));
|
Thread.sleep(1000 + (randomNum * 1000));
|
||||||
numberOfRetries = numberOfRetries + 1;
|
numberOfRetries = numberOfRetries + 1;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.error("vetoJobExecution() caught an InterruptedException", e);
|
LOG.error("vetoJobExecution() caught an InterruptedException", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (vetoJob) {
|
if (vetoJob) {
|
||||||
logger.warn("vetoJobExecution() WILL veto the execution (returning vetoJob == true; the job's execute method will NOT be called); "
|
LOG.warn("vetoJobExecution() WILL veto the execution (returning vetoJob == true; the job's execute method will NOT be called); "
|
||||||
+ "maxNumberOfRetries={}, tenant={}, jobKey={}, triggerType={}, trigger={}, context={}",
|
+ "maxNumberOfRetries={}, tenant={}, jobKey={}, triggerType={}, trigger={}, context={}",
|
||||||
maxNumberOfRetries, tenantIdentifier, jobKey, triggerType, trigger, context);
|
maxNumberOfRetries, tenantIdentifier, jobKey, triggerType, trigger, context);
|
||||||
}
|
}
|
||||||
@@ -99,11 +99,11 @@ public class SchedulerTriggerListener implements TriggerListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void triggerMisfired(final Trigger trigger) {
|
public void triggerMisfired(final Trigger trigger) {
|
||||||
logger.error("triggerMisfired() trigger={}", trigger);
|
LOG.error("triggerMisfired() trigger={}", trigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void triggerComplete(Trigger trigger, JobExecutionContext context, CompletedExecutionInstruction triggerInstructionCode) {
|
public void triggerComplete(Trigger trigger, JobExecutionContext context, CompletedExecutionInstruction triggerInstructionCode) {
|
||||||
logger.debug("triggerComplete() trigger={}, context={}, completedExecutionInstruction={}", trigger, context, triggerInstructionCode);
|
LOG.debug("triggerComplete() trigger={}, context={}, completedExecutionInstruction={}", trigger, context, triggerInstructionCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -35,7 +35,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ReportMailingJobEmailServiceImpl implements ReportMailingJobEmailService {
|
public class ReportMailingJobEmailServiceImpl implements ReportMailingJobEmailService {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ReportMailingJobEmailServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ReportMailingJobEmailServiceImpl.class);
|
||||||
private final ReportMailingJobConfigurationReadPlatformService reportMailingJobConfigurationReadPlatformService;
|
private final ReportMailingJobConfigurationReadPlatformService reportMailingJobConfigurationReadPlatformService;
|
||||||
private Collection<ReportMailingJobConfigurationData> reportMailingJobConfigurationDataCollection;
|
private Collection<ReportMailingJobConfigurationData> reportMailingJobConfigurationDataCollection;
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ public class ReportMailingJobEmailServiceImpl implements ReportMailingJobEmailSe
|
|||||||
|
|
||||||
catch (MessagingException e) {
|
catch (MessagingException e) {
|
||||||
// handle the exception
|
// handle the exception
|
||||||
logger.error("Problem occurred in sendEmailWithAttachment function",e);
|
LOG.error("Problem occurred in sendEmailWithAttachment function",e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -73,7 +73,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class ReportMailingJobWritePlatformServiceImpl implements ReportMailingJobWritePlatformService {
|
public class ReportMailingJobWritePlatformServiceImpl implements ReportMailingJobWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ReportMailingJobWritePlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ReportMailingJobWritePlatformServiceImpl.class);
|
||||||
private final ReportRepositoryWrapper reportRepositoryWrapper;
|
private final ReportRepositoryWrapper reportRepositoryWrapper;
|
||||||
private final ReportMailingJobValidator reportMailingJobValidator;
|
private final ReportMailingJobValidator reportMailingJobValidator;
|
||||||
private final ReportMailingJobRepositoryWrapper reportMailingJobRepositoryWrapper;
|
private final ReportMailingJobRepositoryWrapper reportMailingJobRepositoryWrapper;
|
||||||
@@ -399,7 +399,7 @@ public class ReportMailingJobWritePlatformServiceImpl implements ReportMailingJo
|
|||||||
ReportMailingJobConstants.NAME_PARAM_NAME, name);
|
ReportMailingJobConstants.NAME_PARAM_NAME, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
|
|
||||||
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
|
|||||||
+2
-2
@@ -67,7 +67,7 @@ import org.springframework.stereotype.Service;
|
|||||||
public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFilter {
|
public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFilter {
|
||||||
|
|
||||||
private static boolean firstRequestProcessed = false;
|
private static boolean firstRequestProcessed = false;
|
||||||
private final static Logger logger = LoggerFactory.getLogger(TenantAwareBasicAuthenticationFilter.class);
|
private final static Logger LOG = LoggerFactory.getLogger(TenantAwareBasicAuthenticationFilter.class);
|
||||||
|
|
||||||
private final BasicAuthTenantDetailsService basicAuthTenantDetailsService;
|
private final BasicAuthTenantDetailsService basicAuthTenantDetailsService;
|
||||||
private final ToApiJsonSerializer<PlatformRequestLog> toApiJsonSerializer;
|
private final ToApiJsonSerializer<PlatformRequestLog> toApiJsonSerializer;
|
||||||
@@ -152,7 +152,7 @@ public class TenantAwareBasicAuthenticationFilter extends BasicAuthenticationFil
|
|||||||
} finally {
|
} finally {
|
||||||
task.stop();
|
task.stop();
|
||||||
final PlatformRequestLog log = PlatformRequestLog.from(task, request);
|
final PlatformRequestLog log = PlatformRequestLog.from(task, request);
|
||||||
logger.debug("{}", this.toApiJsonSerializer.serialize(log));
|
LOG.debug("{}", this.toApiJsonSerializer.serialize(log));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -61,7 +61,7 @@ import org.springframework.web.filter.GenericFilterBean;
|
|||||||
public class TenantAwareTenantIdentifierFilter extends GenericFilterBean {
|
public class TenantAwareTenantIdentifierFilter extends GenericFilterBean {
|
||||||
|
|
||||||
private static boolean firstRequestProcessed = false;
|
private static boolean firstRequestProcessed = false;
|
||||||
private final static Logger logger = LoggerFactory.getLogger(TenantAwareTenantIdentifierFilter.class);
|
private final static Logger LOG = LoggerFactory.getLogger(TenantAwareTenantIdentifierFilter.class);
|
||||||
|
|
||||||
private final BasicAuthTenantDetailsService basicAuthTenantDetailsService;
|
private final BasicAuthTenantDetailsService basicAuthTenantDetailsService;
|
||||||
private final ToApiJsonSerializer<PlatformRequestLog> toApiJsonSerializer;
|
private final ToApiJsonSerializer<PlatformRequestLog> toApiJsonSerializer;
|
||||||
@@ -152,7 +152,7 @@ public class TenantAwareTenantIdentifierFilter extends GenericFilterBean {
|
|||||||
} finally {
|
} finally {
|
||||||
task.stop();
|
task.stop();
|
||||||
final PlatformRequestLog log = PlatformRequestLog.from(task, request);
|
final PlatformRequestLog log = PlatformRequestLog.from(task, request);
|
||||||
logger.info("{}", this.toApiJsonSerializer.serialize(log));
|
LOG.info("{}", this.toApiJsonSerializer.serialize(log));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -35,7 +35,7 @@ import org.springframework.util.Assert;
|
|||||||
|
|
||||||
public class CustomAuthenticationFailureHandler implements AuthenticationFailureHandler {
|
public class CustomAuthenticationFailureHandler implements AuthenticationFailureHandler {
|
||||||
|
|
||||||
protected final Logger logger = LoggerFactory.getLogger(getClass());
|
protected final Logger LOG = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private String defaultFailureUrl;
|
private String defaultFailureUrl;
|
||||||
private boolean forwardToDestination = false;
|
private boolean forwardToDestination = false;
|
||||||
@@ -56,18 +56,18 @@ public class CustomAuthenticationFailureHandler implements AuthenticationFailure
|
|||||||
final AuthenticationException exception) throws IOException, ServletException {
|
final AuthenticationException exception) throws IOException, ServletException {
|
||||||
|
|
||||||
if (this.defaultFailureUrl == null) {
|
if (this.defaultFailureUrl == null) {
|
||||||
this.logger.debug("No failure URL set, sending 401 Unauthorized error");
|
this.LOG.debug("No failure URL set, sending 401 Unauthorized error");
|
||||||
|
|
||||||
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authentication Failed: " + exception.getMessage());
|
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authentication Failed: " + exception.getMessage());
|
||||||
} else {
|
} else {
|
||||||
saveException(request, exception);
|
saveException(request, exception);
|
||||||
|
|
||||||
if (this.forwardToDestination) {
|
if (this.forwardToDestination) {
|
||||||
this.logger.debug("Forwarding to {}", this.defaultFailureUrl);
|
this.LOG.debug("Forwarding to {}", this.defaultFailureUrl);
|
||||||
|
|
||||||
request.getRequestDispatcher(this.defaultFailureUrl).forward(request, response);
|
request.getRequestDispatcher(this.defaultFailureUrl).forward(request, response);
|
||||||
} else {
|
} else {
|
||||||
this.logger.debug("Redirecting to {}", this.defaultFailureUrl);
|
this.LOG.debug("Redirecting to {}", this.defaultFailureUrl);
|
||||||
|
|
||||||
final String oauthToken = request.getParameter("oauth_token");
|
final String oauthToken = request.getParameter("oauth_token");
|
||||||
request.setAttribute("oauth_token", oauthToken);
|
request.setAttribute("oauth_token", oauthToken);
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class SpringSecurityPlatformSecurityContext implements PlatformSecurityContext {
|
public class SpringSecurityPlatformSecurityContext implements PlatformSecurityContext {
|
||||||
|
|
||||||
// private final static Logger logger =
|
// private final static Logger LOG =
|
||||||
// LoggerFactory.getLogger(SpringSecurityPlatformSecurityContext.class);
|
// LoggerFactory.getLogger(SpringSecurityPlatformSecurityContext.class);
|
||||||
|
|
||||||
private final ConfigurationDomainService configurationDomainService;
|
private final ConfigurationDomainService configurationDomainService;
|
||||||
|
|||||||
+9
-9
@@ -69,7 +69,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
|||||||
|
|
||||||
private final SmsMessageRepository smsMessageRepository;
|
private final SmsMessageRepository smsMessageRepository;
|
||||||
private final SmsReadPlatformService smsReadPlatformService;
|
private final SmsReadPlatformService smsReadPlatformService;
|
||||||
private static final Logger logger = LoggerFactory.getLogger(SmsMessageScheduledJobServiceImpl.class);
|
private static final Logger LOG = LoggerFactory.getLogger(SmsMessageScheduledJobServiceImpl.class);
|
||||||
private final RestTemplate restTemplate = new RestTemplate();
|
private final RestTemplate restTemplate = new RestTemplate();
|
||||||
private ExecutorService genericExecutorService ;
|
private ExecutorService genericExecutorService ;
|
||||||
private ExecutorService triggeredExecutorService ;
|
private ExecutorService triggeredExecutorService ;
|
||||||
@@ -168,7 +168,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
|||||||
@Override
|
@Override
|
||||||
public void onApplicationEvent(ContextClosedEvent event) {
|
public void onApplicationEvent(ContextClosedEvent event) {
|
||||||
genericExecutorService.shutdown();
|
genericExecutorService.shutdown();
|
||||||
logger.info("Shutting down the ExecutorService");
|
LOG.info("Shutting down the ExecutorService");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
|||||||
if (responseOne != null) {
|
if (responseOne != null) {
|
||||||
// String smsResponse = responseOne.getBody();
|
// String smsResponse = responseOne.getBody();
|
||||||
if (!responseOne.getStatusCode().equals(HttpStatus.ACCEPTED)) {
|
if (!responseOne.getStatusCode().equals(HttpStatus.ACCEPTED)) {
|
||||||
logger.debug("{}", responseOne.getStatusCode().name());
|
LOG.debug("{}", responseOne.getStatusCode().name());
|
||||||
throw new ConnectionFailureException(SmsCampaignConstants.SMS);
|
throw new ConnectionFailureException(SmsCampaignConstants.SMS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,11 +242,11 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
|||||||
}
|
}
|
||||||
this.smsMessageRepository.saveAll(smsMessages);
|
this.smsMessageRepository.saveAll(smsMessages);
|
||||||
request.append(SmsMessageApiQueueResourceData.toJsonString(apiQueueResourceDatas));
|
request.append(SmsMessageApiQueueResourceData.toJsonString(apiQueueResourceDatas));
|
||||||
logger.info("Sending triggered SMS to specific provider with request - {}", request);
|
LOG.info("Sending triggered SMS to specific provider with request - {}", request);
|
||||||
this.triggeredExecutorService.execute(new SmsTask(ThreadLocalContextUtil.getTenant(),
|
this.triggeredExecutorService.execute(new SmsTask(ThreadLocalContextUtil.getTenant(),
|
||||||
apiQueueResourceDatas));
|
apiQueueResourceDatas));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,19 +320,19 @@ public class SmsMessageScheduledJobServiceImpl implements SmsMessageScheduledJob
|
|||||||
this.smsMessageRepository.save(smsMessage);
|
this.smsMessageRepository.save(smsMessage);
|
||||||
|
|
||||||
if (statusChanged) {
|
if (statusChanged) {
|
||||||
logger.info("Status of SMS message id: {} successfully changed to {}", smsMessage.getId(), statusType);
|
LOG.info("Status of SMS message id: {} successfully changed to {}", smsMessage.getId(), statusType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (smsMessageDeliveryReportDatas.size() > 0) {
|
if (smsMessageDeliveryReportDatas.size() > 0) {
|
||||||
logger.info("{} delivery report(s) successfully received from the intermediate gateway - sms", smsMessageDeliveryReportDatas.size());
|
LOG.info("{} delivery report(s) successfully received from the intermediate gateway - sms", smsMessageDeliveryReportDatas.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.error("Error occured.", e);
|
LOG.error("Error occured.", e);
|
||||||
}
|
}
|
||||||
page ++;
|
page ++;
|
||||||
totalRecords = smsMessageInternalIds.getTotalFilteredRecords();
|
totalRecords = smsMessageInternalIds.getTotalFilteredRecords();
|
||||||
|
|||||||
+2
-2
@@ -37,7 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class SmsWritePlatformServiceJpaRepositoryImpl implements SmsWritePlatformService {
|
public class SmsWritePlatformServiceJpaRepositoryImpl implements SmsWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(SmsWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(SmsWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final SmsMessageAssembler assembler;
|
private final SmsMessageAssembler assembler;
|
||||||
private final SmsMessageRepository repository;
|
private final SmsMessageRepository repository;
|
||||||
@@ -126,7 +126,7 @@ public class SmsWritePlatformServiceJpaRepositoryImpl implements SmsWritePlatfor
|
|||||||
if (realCause.getMessage().contains("mobile_no")) { throw new PlatformDataIntegrityException("error.msg.sms.no.mobile.no.exists",
|
if (realCause.getMessage().contains("mobile_no")) { throw new PlatformDataIntegrityException("error.msg.sms.no.mobile.no.exists",
|
||||||
"The group, client or staff provided has no mobile no.", "id"); }
|
"The group, client or staff provided has no mobile no.", "id"); }
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.sms.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.sms.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -39,7 +39,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class WriteLikelihoodServiceImpl implements WriteLikelihoodService {
|
public class WriteLikelihoodServiceImpl implements WriteLikelihoodService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(WriteLikelihoodServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(WriteLikelihoodServiceImpl.class);
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final LikelihoodDataValidator likelihoodDataValidator;
|
private final LikelihoodDataValidator likelihoodDataValidator;
|
||||||
private final LikelihoodRepository repository;
|
private final LikelihoodRepository repository;
|
||||||
@@ -95,7 +95,7 @@ public class WriteLikelihoodServiceImpl implements WriteLikelihoodService {
|
|||||||
private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
private void handleDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
||||||
|
|
||||||
final Throwable realCause = dve.getMostSpecificCause();
|
final Throwable realCause = dve.getMostSpecificCause();
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.likelihood.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.likelihood.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -54,7 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class HolidayWritePlatformServiceJpaRepositoryImpl implements HolidayWritePlatformService {
|
public class HolidayWritePlatformServiceJpaRepositoryImpl implements HolidayWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(HolidayWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(HolidayWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final HolidayDataValidator fromApiJsonDeserializer;
|
private final HolidayDataValidator fromApiJsonDeserializer;
|
||||||
private final HolidayRepositoryWrapper holidayRepository;
|
private final HolidayRepositoryWrapper holidayRepository;
|
||||||
@@ -183,7 +183,7 @@ public class HolidayWritePlatformServiceJpaRepositoryImpl implements HolidayWrit
|
|||||||
"name", name);
|
"name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.office.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.office.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -51,7 +51,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWritePlatformService {
|
public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(OfficeWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(OfficeWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final OfficeCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
private final OfficeCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
||||||
@@ -239,7 +239,7 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP
|
|||||||
"name", name);
|
"name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.office.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.office.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -41,7 +41,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implements ProvisioningCategoryWritePlatformService {
|
public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implements ProvisioningCategoryWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final ProvisioningCategoryRepository provisioningCategoryRepository;
|
private final ProvisioningCategoryRepository provisioningCategoryRepository;
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implement
|
|||||||
throw new PlatformDataIntegrityException("error.msg.provisioning.duplicate.categoryname", "Provisioning Cateory with name `"
|
throw new PlatformDataIntegrityException("error.msg.provisioning.duplicate.categoryname", "Provisioning Cateory with name `"
|
||||||
+ name + "` already exists", "category name", name);
|
+ name + "` already exists", "category name", name);
|
||||||
}
|
}
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -53,7 +53,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl implements ProvisioningCriteriaWritePlatformService {
|
public class ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl implements ProvisioningCriteriaWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final ProvisioningCriteriaDefinitionJsonDeserializer fromApiJsonDeserializer;
|
private final ProvisioningCriteriaDefinitionJsonDeserializer fromApiJsonDeserializer;
|
||||||
private final ProvisioningCriteriaAssembler provisioningCriteriaAssembler;
|
private final ProvisioningCriteriaAssembler provisioningCriteriaAssembler;
|
||||||
@@ -169,7 +169,7 @@ public class ProvisioningCriteriaWritePlatformServiceJpaRepositoryImpl implement
|
|||||||
"error.msg.provisioning.product.id(s).already.associated.existing.criteria",
|
"error.msg.provisioning.product.id(s).already.associated.existing.criteria",
|
||||||
"The selected products already associated with another Provisioning Criteria");
|
"The selected products already associated with another Provisioning Criteria");
|
||||||
}
|
}
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.provisioning.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.provisioning.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -42,7 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class StaffWritePlatformServiceJpaRepositoryImpl implements StaffWritePlatformService {
|
public class StaffWritePlatformServiceJpaRepositoryImpl implements StaffWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(StaffWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(StaffWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final StaffCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
private final StaffCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
||||||
private final StaffRepository staffRepository;
|
private final StaffRepository staffRepository;
|
||||||
@@ -139,7 +139,7 @@ public class StaffWritePlatformServiceJpaRepositoryImpl implements StaffWritePla
|
|||||||
+ displayName + "' already exists", "displayName", displayName);
|
+ displayName + "' already exists", "displayName", displayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.staff.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.staff.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -63,7 +63,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformService {
|
public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(TellerWritePlatformServiceJpaImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(TellerWritePlatformServiceJpaImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final TellerCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
private final TellerCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
||||||
@@ -211,7 +211,7 @@ public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformSer
|
|||||||
"name", name);
|
"name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.teller.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.teller.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -41,7 +41,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class AccountAssociationsReadPlatformServiceImpl implements AccountAssociationsReadPlatformService {
|
public class AccountAssociationsReadPlatformServiceImpl implements AccountAssociationsReadPlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AccountAssociationsReadPlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AccountAssociationsReadPlatformServiceImpl.class);
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -61,7 +61,7 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
|
|||||||
linkedAccount = accountAssociationsData.linkedAccount();
|
linkedAccount = accountAssociationsData.linkedAccount();
|
||||||
}
|
}
|
||||||
} catch (final EmptyResultDataAccessException e) {
|
} catch (final EmptyResultDataAccessException e) {
|
||||||
logger.debug("Linking account is not configured");
|
LOG.debug("Linking account is not configured");
|
||||||
}
|
}
|
||||||
return linkedAccount;
|
return linkedAccount;
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
|
|||||||
linkedAccount = accountAssociationsData.linkedAccount();
|
linkedAccount = accountAssociationsData.linkedAccount();
|
||||||
}
|
}
|
||||||
} catch (final EmptyResultDataAccessException e) {
|
} catch (final EmptyResultDataAccessException e) {
|
||||||
logger.debug("Linking account is not configured");
|
LOG.debug("Linking account is not configured");
|
||||||
}
|
}
|
||||||
return linkedAccount;
|
return linkedAccount;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -71,7 +71,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class StandingInstructionWritePlatformServiceImpl implements StandingInstructionWritePlatformService {
|
public class StandingInstructionWritePlatformServiceImpl implements StandingInstructionWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(StandingInstructionWritePlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(StandingInstructionWritePlatformServiceImpl.class);
|
||||||
|
|
||||||
private final StandingInstructionDataValidator standingInstructionDataValidator;
|
private final StandingInstructionDataValidator standingInstructionDataValidator;
|
||||||
private final StandingInstructionAssembler standingInstructionAssembler;
|
private final StandingInstructionAssembler standingInstructionAssembler;
|
||||||
@@ -146,7 +146,7 @@ public class StandingInstructionWritePlatformServiceImpl implements StandingInst
|
|||||||
throw new PlatformDataIntegrityException("error.msg.standinginstruction.duplicate.name", "Standinginstruction with name `"
|
throw new PlatformDataIntegrityException("error.msg.standinginstruction.duplicate.name", "Standinginstruction with name `"
|
||||||
+ name + "` already exists", "name", name);
|
+ name + "` already exists", "name", name);
|
||||||
}
|
}
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -56,7 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWritePlatformService {
|
public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ChargeWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ChargeWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final ChargeDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
private final ChargeDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
@@ -233,7 +233,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
|||||||
"name", name);
|
"name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.charge.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -65,7 +65,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements ClientChargeWritePlatformService {
|
public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements ClientChargeWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ClientChargeWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ClientChargeWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final ChargeRepositoryWrapper chargeRepository;
|
private final ChargeRepositoryWrapper chargeRepository;
|
||||||
@@ -438,7 +438,7 @@ public class ClientChargeWritePlatformServiceJpaRepositoryImpl implements Client
|
|||||||
"Client charge with id `" + clientChargeId + "` cannot be deleted as transactions have been made on the same",
|
"Client charge with id `" + clientChargeId + "` cannot be deleted as transactions have been made on the same",
|
||||||
"clientChargeId", clientChargeId); }
|
"clientChargeId", clientChargeId); }
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.client.charges.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.client.charges.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -47,7 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class ClientIdentifierWritePlatformServiceJpaRepositoryImpl implements ClientIdentifierWritePlatformService {
|
public class ClientIdentifierWritePlatformServiceJpaRepositoryImpl implements ClientIdentifierWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ClientIdentifierWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ClientIdentifierWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final ClientRepositoryWrapper clientRepository;
|
private final ClientRepositoryWrapper clientRepository;
|
||||||
@@ -200,6 +200,6 @@ public class ClientIdentifierWritePlatformServiceJpaRepositoryImpl implements Cl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -96,7 +96,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWritePlatformService {
|
public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ClientWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ClientWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final ClientRepositoryWrapper clientRepository;
|
private final ClientRepositoryWrapper clientRepository;
|
||||||
@@ -184,7 +184,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
|||||||
.build();
|
.build();
|
||||||
} catch (DataIntegrityViolationException dve) {
|
} catch (DataIntegrityViolationException dve) {
|
||||||
Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()) ;
|
Throwable throwable = ExceptionUtils.getRootCause(dve.getCause()) ;
|
||||||
logger.error("Error occured.", throwable);
|
LOG.error("Error occured.", throwable);
|
||||||
throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.client.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
@@ -619,7 +619,7 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
+2
-2
@@ -51,7 +51,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class CollateralWritePlatformServiceJpaRepositoryImpl implements CollateralWritePlatformService {
|
public class CollateralWritePlatformServiceJpaRepositoryImpl implements CollateralWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(CollateralWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(CollateralWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final LoanRepositoryWrapper loanRepositoryWrapper;
|
private final LoanRepositoryWrapper loanRepositoryWrapper;
|
||||||
@@ -177,7 +177,7 @@ public class CollateralWritePlatformServiceJpaRepositoryImpl implements Collater
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -41,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class FloatingRateWritePlatformServiceImpl implements
|
public class FloatingRateWritePlatformServiceImpl implements
|
||||||
FloatingRateWritePlatformService {
|
FloatingRateWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory
|
private final static Logger LOG = LoggerFactory
|
||||||
.getLogger(FloatingRateWritePlatformServiceImpl.class);
|
.getLogger(FloatingRateWritePlatformServiceImpl.class);
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final FloatingRateDataValidator fromApiJsonDeserializer;
|
private final FloatingRateDataValidator fromApiJsonDeserializer;
|
||||||
@@ -138,7 +138,7 @@ public class FloatingRateWritePlatformServiceImpl implements
|
|||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(
|
private void logAsErrorUnexpectedDataIntegrityException(
|
||||||
Exception dve) {
|
Exception dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -41,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatformService {
|
public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(FundWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(FundWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final FundCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
private final FundCommandFromApiJsonDeserializer fromApiJsonDeserializer;
|
||||||
@@ -124,7 +124,7 @@ public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatf
|
|||||||
"name", name);
|
"name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -44,7 +44,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class GroupRolesWritePlatformServiceJpaRepositoryImpl implements GroupRolesWritePlatformService {
|
public class GroupRolesWritePlatformServiceJpaRepositoryImpl implements GroupRolesWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(GroupRolesWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(GroupRolesWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final GroupRepositoryWrapper groupRepository;
|
private final GroupRepositoryWrapper groupRepository;
|
||||||
@@ -106,7 +106,7 @@ public class GroupRolesWritePlatformServiceJpaRepositoryImpl implements GroupRol
|
|||||||
GroupingTypesApiConstants.clientIdParamName, roleId, clientId, command.getGroupId());
|
GroupingTypesApiConstants.clientIdParamName, roleId, clientId, command.getGroupId());
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -96,7 +96,7 @@ import org.springframework.util.ObjectUtils;
|
|||||||
@Service
|
@Service
|
||||||
public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements GroupingTypesWritePlatformService {
|
public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements GroupingTypesWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(GroupingTypesWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(GroupingTypesWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final GroupRepositoryWrapper groupRepository;
|
private final GroupRepositoryWrapper groupRepository;
|
||||||
@@ -603,7 +603,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
|||||||
.build();
|
.build();
|
||||||
} catch (DataIntegrityViolationException dve) {
|
} catch (DataIntegrityViolationException dve) {
|
||||||
Throwable throwable = ExceptionUtils.getRootCause(dve.getCause());
|
Throwable throwable = ExceptionUtils.getRootCause(dve.getCause());
|
||||||
logger.error("Error occured.", throwable);
|
LOG.error("Error occured.", throwable);
|
||||||
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
@@ -798,7 +798,7 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
|||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.group.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl implements InterestRateChartSlabWritePlatformService {
|
public class InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl implements InterestRateChartSlabWritePlatformService {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final static Logger logger = LoggerFactory.getLogger(InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(InterestRateChartSlabWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final InterestRateChartSlabDataValidator interestRateChartSlabDataValidator;
|
private final InterestRateChartSlabDataValidator interestRateChartSlabDataValidator;
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class InterestRateChartWritePlatformServiceJpaRepositoryImpl implements InterestRateChartWritePlatformService {
|
public class InterestRateChartWritePlatformServiceJpaRepositoryImpl implements InterestRateChartWritePlatformService {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final static Logger logger = LoggerFactory.getLogger(InterestRateChartWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(InterestRateChartWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final InterestRateChartDataValidator interestRateChartDataValidator;
|
private final InterestRateChartDataValidator interestRateChartDataValidator;
|
||||||
|
|||||||
+2
-2
@@ -64,7 +64,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class GuarantorWritePlatformServiceJpaRepositoryIImpl implements GuarantorWritePlatformService {
|
public class GuarantorWritePlatformServiceJpaRepositoryIImpl implements GuarantorWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(GuarantorWritePlatformServiceJpaRepositoryIImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(GuarantorWritePlatformServiceJpaRepositoryIImpl.class);
|
||||||
|
|
||||||
private final ClientRepositoryWrapper clientRepositoryWrapper;
|
private final ClientRepositoryWrapper clientRepositoryWrapper;
|
||||||
private final StaffRepositoryWrapper staffRepositoryWrapper;
|
private final StaffRepositoryWrapper staffRepositoryWrapper;
|
||||||
@@ -334,7 +334,7 @@ public class GuarantorWritePlatformServiceJpaRepositoryIImpl implements Guaranto
|
|||||||
|
|
||||||
private void handleGuarantorDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
private void handleGuarantorDataIntegrityIssues(final DataIntegrityViolationException dve) {
|
||||||
final Throwable realCause = dve.getMostSpecificCause();
|
final Throwable realCause = dve.getMostSpecificCause();
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.guarantor.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.guarantor.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource Guarantor: " + realCause.getMessage());
|
"Unknown data integrity issue with resource Guarantor: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -92,7 +92,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanRescheduleRequestWritePlatformService {
|
public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanRescheduleRequestWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(LoanRescheduleRequestWritePlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(LoanRescheduleRequestWritePlatformServiceImpl.class);
|
||||||
|
|
||||||
private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
||||||
private final PlatformSecurityContext platformSecurityContext;
|
private final PlatformSecurityContext platformSecurityContext;
|
||||||
@@ -606,7 +606,7 @@ public class LoanRescheduleRequestWritePlatformServiceImpl implements LoanResche
|
|||||||
**/
|
**/
|
||||||
private void handleDataIntegrityViolation(final DataIntegrityViolationException dve) {
|
private void handleDataIntegrityViolation(final DataIntegrityViolationException dve) {
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
|
|
||||||
throw new PlatformDataIntegrityException("error.msg.loan.reschedule.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.loan.reschedule.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
|
|||||||
+2
-2
@@ -151,7 +151,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
@Service
|
@Service
|
||||||
public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements LoanApplicationWritePlatformService {
|
public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements LoanApplicationWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(LoanApplicationWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(LoanApplicationWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final FromJsonHelper fromJsonHelper;
|
private final FromJsonHelper fromJsonHelper;
|
||||||
@@ -1246,7 +1246,7 @@ public void checkForProductMixRestrictions(final Loan loan) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
+2
-2
@@ -56,7 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, BusinessEventListner {
|
public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, BusinessEventListner {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(LoanArrearsAgingServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(LoanArrearsAgingServiceImpl.class);
|
||||||
private final BusinessEventNotifierService businessEventNotifierService;
|
private final BusinessEventNotifierService businessEventNotifierService;
|
||||||
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
@@ -125,7 +125,7 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, Bus
|
|||||||
result += i;
|
result += i;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+16
-16
@@ -54,7 +54,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
@Service
|
@Service
|
||||||
public class LoanSchedularServiceImpl implements LoanSchedularService {
|
public class LoanSchedularServiceImpl implements LoanSchedularService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(LoanSchedularServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(LoanSchedularServiceImpl.class);
|
||||||
|
|
||||||
private final ConfigurationDomainService configurationDomainService;
|
private final ConfigurationDomainService configurationDomainService;
|
||||||
private final LoanReadPlatformService loanReadPlatformService;
|
private final LoanReadPlatformService loanReadPlatformService;
|
||||||
@@ -103,14 +103,14 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
|||||||
} catch (final PlatformApiDataValidationException e) {
|
} catch (final PlatformApiDataValidationException e) {
|
||||||
final List<ApiParameterError> errors = e.getErrors();
|
final List<ApiParameterError> errors = e.getErrors();
|
||||||
for (final ApiParameterError error : errors) {
|
for (final ApiParameterError error : errors) {
|
||||||
logger.error("Apply Charges due for overdue loans failed for account {} with message: {}", loanId, error.getDeveloperMessage(), e);
|
LOG.error("Apply Charges due for overdue loans failed for account {} with message: {}", loanId, error.getDeveloperMessage(), e);
|
||||||
}
|
}
|
||||||
exceptions.add(e);
|
exceptions.add(e);
|
||||||
} catch (final AbstractPlatformDomainRuleException e) {
|
} catch (final AbstractPlatformDomainRuleException e) {
|
||||||
logger.error("Apply Charges due for overdue loans failed for account {} with message: {}", loanId, e.getDefaultUserMessage(), e);
|
LOG.error("Apply Charges due for overdue loans failed for account {} with message: {}", loanId, e.getDefaultUserMessage(), e);
|
||||||
exceptions.add(e);
|
exceptions.add(e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Apply Charges due for overdue loans failed for account {}", loanId, e);
|
LOG.error("Apply Charges due for overdue loans failed for account {}", loanId, e);
|
||||||
exceptions.add(e);
|
exceptions.add(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
|||||||
if (!loanIds.isEmpty()) {
|
if (!loanIds.isEmpty()) {
|
||||||
List<Throwable> errors = new ArrayList<>();
|
List<Throwable> errors = new ArrayList<>();
|
||||||
for (Long loanId : loanIds) {
|
for (Long loanId : loanIds) {
|
||||||
logger.info("recalculateInterest: Loan ID = {}", loanId);
|
LOG.info("recalculateInterest: Loan ID = {}", loanId);
|
||||||
Integer numberOfRetries = 0;
|
Integer numberOfRetries = 0;
|
||||||
while (numberOfRetries <= maxNumberOfRetries) {
|
while (numberOfRetries <= maxNumberOfRetries) {
|
||||||
try {
|
try {
|
||||||
@@ -139,10 +139,10 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
|||||||
numberOfRetries = maxNumberOfRetries + 1;
|
numberOfRetries = maxNumberOfRetries + 1;
|
||||||
} catch (CannotAcquireLockException
|
} catch (CannotAcquireLockException
|
||||||
| ObjectOptimisticLockingFailureException exception) {
|
| ObjectOptimisticLockingFailureException exception) {
|
||||||
logger.info("Recalulate interest job has been retried {} time(s)", numberOfRetries);
|
LOG.info("Recalulate interest job has been retried {} time(s)", numberOfRetries);
|
||||||
// Fail if the transaction has been retried for maxNumberOfRetries
|
// Fail if the transaction has been retried for maxNumberOfRetries
|
||||||
if (numberOfRetries >= maxNumberOfRetries) {
|
if (numberOfRetries >= maxNumberOfRetries) {
|
||||||
logger.error("Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back", numberOfRetries);
|
LOG.error("Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back", numberOfRetries);
|
||||||
errors.add(exception);
|
errors.add(exception);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -153,18 +153,18 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
|||||||
Thread.sleep(1000 + (randomNum * 1000));
|
Thread.sleep(1000 + (randomNum * 1000));
|
||||||
numberOfRetries = numberOfRetries + 1;
|
numberOfRetries = numberOfRetries + 1;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.error("Interest recalculation for loans retry failed due to InterruptedException", e) ;
|
LOG.error("Interest recalculation for loans retry failed due to InterruptedException", e) ;
|
||||||
errors.add(e);
|
errors.add(e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Interest recalculation for loans failed for account {}", loanId, e);
|
LOG.error("Interest recalculation for loans failed for account {}", loanId, e);
|
||||||
numberOfRetries = maxNumberOfRetries + 1;
|
numberOfRetries = maxNumberOfRetries + 1;
|
||||||
errors.add(e);
|
errors.add(e);
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
logger.info("recalculateInterest: Loans count {}", i);
|
LOG.info("recalculateInterest: Loans count {}", i);
|
||||||
}
|
}
|
||||||
if (!errors.isEmpty()) { throw new JobExecutionException(errors); }
|
if (!errors.isEmpty()) { throw new JobExecutionException(errors); }
|
||||||
}
|
}
|
||||||
@@ -176,7 +176,7 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
|||||||
public void recalculateInterest(Map<String, String> jobParameters) {
|
public void recalculateInterest(Map<String, String> jobParameters) {
|
||||||
// gets the officeId
|
// gets the officeId
|
||||||
final String officeId = jobParameters.get("officeId");
|
final String officeId = jobParameters.get("officeId");
|
||||||
logger.info("recalculateInterest: officeId={}", officeId);
|
LOG.info("recalculateInterest: officeId={}", officeId);
|
||||||
Long officeIdLong = Long.valueOf(officeId);
|
Long officeIdLong = Long.valueOf(officeId);
|
||||||
|
|
||||||
// gets the Office object
|
// gets the Office object
|
||||||
@@ -206,7 +206,7 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
|||||||
// gets the loanIds data set iteratively and call addAccuruals for that paginated dataset
|
// gets the loanIds data set iteratively and call addAccuruals for that paginated dataset
|
||||||
do {
|
do {
|
||||||
int totalFilteredRecords = loanIds.size();
|
int totalFilteredRecords = loanIds.size();
|
||||||
logger.info("Starting accrual - total filtered records - {}", totalFilteredRecords);
|
LOG.info("Starting accrual - total filtered records - {}", totalFilteredRecords);
|
||||||
recalculateInterest(loanIds, threadPoolSize, batchSize, executorService);
|
recalculateInterest(loanIds, threadPoolSize, batchSize, executorService);
|
||||||
maxLoanIdInList+= pageSize+1;
|
maxLoanIdInList+= pageSize+1;
|
||||||
loanIds = Collections.synchronizedList(this.loanReadPlatformService
|
loanIds = Collections.synchronizedList(this.loanReadPlatformService
|
||||||
@@ -262,7 +262,7 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
|||||||
List<Future<Void>> responses = executorService.invokeAll(posters);
|
List<Future<Void>> responses = executorService.invokeAll(posters);
|
||||||
checkCompletion(responses);
|
checkCompletion(responses);
|
||||||
} catch (InterruptedException e1) {
|
} catch (InterruptedException e1) {
|
||||||
logger.error("Interrupted while recalculateInterest", e1);
|
LOG.error("Interrupted while recalculateInterest", e1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,12 +294,12 @@ public class LoanSchedularServiceImpl implements LoanSchedularService {
|
|||||||
}
|
}
|
||||||
allThreadsExecuted = noOfThreadsExecuted == responses.size();
|
allThreadsExecuted = noOfThreadsExecuted == responses.size();
|
||||||
if(!allThreadsExecuted) {
|
if(!allThreadsExecuted) {
|
||||||
logger.error("All threads could not execute.");
|
LOG.error("All threads could not execute.");
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e1) {
|
} catch (InterruptedException e1) {
|
||||||
logger.error("Interrupted while posting IR entries", e1);
|
LOG.error("Interrupted while posting IR entries", e1);
|
||||||
} catch (ExecutionException e2) {
|
} catch (ExecutionException e2) {
|
||||||
logger.error("Execution exception while posting IR entries", e2);
|
LOG.error("Execution exception while posting IR entries", e2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+7
-7
@@ -36,7 +36,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class RecalculateInterestPoster implements Callable<Void> {
|
public class RecalculateInterestPoster implements Callable<Void> {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(RecalculateInterestPoster.class);
|
private final static Logger LOG = LoggerFactory.getLogger(RecalculateInterestPoster.class);
|
||||||
|
|
||||||
private Collection<Long> loanIds;
|
private Collection<Long> loanIds;
|
||||||
private LoanWritePlatformService loanWritePlatformService;
|
private LoanWritePlatformService loanWritePlatformService;
|
||||||
@@ -60,7 +60,7 @@ public class RecalculateInterestPoster implements Callable<Void> {
|
|||||||
if (!loanIds.isEmpty()) {
|
if (!loanIds.isEmpty()) {
|
||||||
List<Throwable> errors = new ArrayList<>();
|
List<Throwable> errors = new ArrayList<>();
|
||||||
for (Long loanId : loanIds) {
|
for (Long loanId : loanIds) {
|
||||||
logger.info("Loan ID {}", loanId);
|
LOG.info("Loan ID {}", loanId);
|
||||||
Integer numberOfRetries = 0;
|
Integer numberOfRetries = 0;
|
||||||
while (numberOfRetries <= maxNumberOfRetries) {
|
while (numberOfRetries <= maxNumberOfRetries) {
|
||||||
try {
|
try {
|
||||||
@@ -68,10 +68,10 @@ public class RecalculateInterestPoster implements Callable<Void> {
|
|||||||
numberOfRetries = maxNumberOfRetries + 1;
|
numberOfRetries = maxNumberOfRetries + 1;
|
||||||
} catch (CannotAcquireLockException
|
} catch (CannotAcquireLockException
|
||||||
| ObjectOptimisticLockingFailureException exception) {
|
| ObjectOptimisticLockingFailureException exception) {
|
||||||
logger.info("Recalulate interest job has been retried {} time(s)", numberOfRetries);
|
LOG.info("Recalulate interest job has been retried {} time(s)", numberOfRetries);
|
||||||
// Fail if the transaction has been retired for maxNumberOfRetries
|
// Fail if the transaction has been retired for maxNumberOfRetries
|
||||||
if (numberOfRetries >= maxNumberOfRetries) {
|
if (numberOfRetries >= maxNumberOfRetries) {
|
||||||
logger.error("Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back", numberOfRetries);
|
LOG.error("Recalulate interest job has been retried for the max allowed attempts of {} and will be rolled back", numberOfRetries);
|
||||||
errors.add(exception);
|
errors.add(exception);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -82,18 +82,18 @@ public class RecalculateInterestPoster implements Callable<Void> {
|
|||||||
Thread.sleep(1000 + (randomNum * 1000));
|
Thread.sleep(1000 + (randomNum * 1000));
|
||||||
numberOfRetries = numberOfRetries + 1;
|
numberOfRetries = numberOfRetries + 1;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.error("Interest recalculation for loans retry failed due to InterruptedException", e) ;
|
LOG.error("Interest recalculation for loans retry failed due to InterruptedException", e) ;
|
||||||
errors.add(e);
|
errors.add(e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Interest recalculation for loans failed for account {}", loanId, e);
|
LOG.error("Interest recalculation for loans failed for account {}", loanId, e);
|
||||||
numberOfRetries = maxNumberOfRetries + 1;
|
numberOfRetries = maxNumberOfRetries + 1;
|
||||||
errors.add(e);
|
errors.add(e);
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
logger.info("Loans count {}", i);
|
LOG.info("Loans count {}", i);
|
||||||
}
|
}
|
||||||
if (!errors.isEmpty()) { throw new JobExecutionException(errors); }
|
if (!errors.isEmpty()) { throw new JobExecutionException(errors); }
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -49,7 +49,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
@Service
|
@Service
|
||||||
public class ProductMixWritePlatformServiceJpaRepositoryImpl implements ProductMixWritePlatformService {
|
public class ProductMixWritePlatformServiceJpaRepositoryImpl implements ProductMixWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ProductMixWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ProductMixWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final ProductMixDataValidator fromApiJsonDeserializer;
|
private final ProductMixDataValidator fromApiJsonDeserializer;
|
||||||
private final ProductMixRepository productMixRepository;
|
private final ProductMixRepository productMixRepository;
|
||||||
@@ -194,7 +194,7 @@ public class ProductMixWritePlatformServiceJpaRepositoryImpl implements ProductM
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final DataIntegrityViolationException dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ProductMix> updateRestrictedIds(final Set<String> restrictedIds, final List<ProductMix> existedProductMixes) {
|
private List<ProductMix> updateRestrictedIds(final Set<String> restrictedIds, final List<ProductMix> existedProductMixes) {
|
||||||
|
|||||||
+2
-2
@@ -71,7 +71,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanProductWritePlatformService {
|
public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanProductWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(LoanProductWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(LoanProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final LoanProductDataValidator fromApiJsonDeserializer;
|
private final LoanProductDataValidator fromApiJsonDeserializer;
|
||||||
private final LoanProductRepository loanProductRepository;
|
private final LoanProductRepository loanProductRepository;
|
||||||
@@ -377,7 +377,7 @@ public class LoanProductWritePlatformServiceJpaRepositoryImpl implements LoanPro
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<BusinessEventNotificationConstants.BusinessEntity, Object> constructEntityMap(final BusinessEventNotificationConstants.BusinessEntity entityEvent, Object entity) {
|
private Map<BusinessEventNotificationConstants.BusinessEntity, Object> constructEntityMap(final BusinessEventNotificationConstants.BusinessEntity entityEvent, Object entity) {
|
||||||
|
|||||||
+2
-2
@@ -48,7 +48,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class RateWriteServiceImpl implements RateWriteService {
|
public class RateWriteServiceImpl implements RateWriteService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(RateWriteServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(RateWriteServiceImpl.class);
|
||||||
|
|
||||||
private final RateRepository rateRepository;
|
private final RateRepository rateRepository;
|
||||||
private final AppUserRepository appUserRepository;
|
private final AppUserRepository appUserRepository;
|
||||||
@@ -146,7 +146,7 @@ public class RateWriteServiceImpl implements RateWriteService {
|
|||||||
+ "' already exists", "name", name);
|
+ "' already exists", "name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error due to Exception", dve);
|
LOG.error("Error due to Exception", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.fund.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
"Unknown data integrity issue with resource: " + realCause.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -104,7 +104,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl implements DepositApplicationProcessWritePlatformService {
|
public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl implements DepositApplicationProcessWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final SavingsAccountRepositoryWrapper savingAccountRepository;
|
private final SavingsAccountRepositoryWrapper savingAccountRepository;
|
||||||
@@ -187,7 +187,7 @@ public class DepositApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
errorCodeBuilder.append(".unknown.data.integrity.issue");
|
errorCodeBuilder.append(".unknown.data.integrity.issue");
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account.");
|
throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -57,7 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements FixedDepositProductWritePlatformService {
|
public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements FixedDepositProductWritePlatformService {
|
||||||
|
|
||||||
private final Logger logger;
|
private final Logger LOG;
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final FixedDepositProductRepository fixedDepositProductRepository;
|
private final FixedDepositProductRepository fixedDepositProductRepository;
|
||||||
private final DepositProductDataValidator fromApiJsonDataValidator;
|
private final DepositProductDataValidator fromApiJsonDataValidator;
|
||||||
@@ -75,7 +75,7 @@ public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements
|
|||||||
this.fixedDepositProductRepository = fixedDepositProductRepository;
|
this.fixedDepositProductRepository = fixedDepositProductRepository;
|
||||||
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
||||||
this.depositProductAssembler = depositProductAssembler;
|
this.depositProductAssembler = depositProductAssembler;
|
||||||
this.logger = LoggerFactory.getLogger(FixedDepositProductWritePlatformServiceJpaRepositoryImpl.class);
|
this.LOG = LoggerFactory.getLogger(FixedDepositProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
||||||
this.chartAssembler = chartAssembler;
|
this.chartAssembler = chartAssembler;
|
||||||
}
|
}
|
||||||
@@ -207,6 +207,6 @@ public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||||
this.logger.error("Error occured.", dae);
|
this.LOG.error("Error occured.", dae);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -57,7 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implements RecurringDepositProductWritePlatformService {
|
public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implements RecurringDepositProductWritePlatformService {
|
||||||
|
|
||||||
private final Logger logger;
|
private final Logger LOG;
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final RecurringDepositProductRepository recurringDepositProductRepository;
|
private final RecurringDepositProductRepository recurringDepositProductRepository;
|
||||||
private final DepositProductDataValidator fromApiJsonDataValidator;
|
private final DepositProductDataValidator fromApiJsonDataValidator;
|
||||||
@@ -75,7 +75,7 @@ public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implem
|
|||||||
this.recurringDepositProductRepository = recurringDepositProductRepository;
|
this.recurringDepositProductRepository = recurringDepositProductRepository;
|
||||||
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
||||||
this.depositProductAssembler = depositProductAssembler;
|
this.depositProductAssembler = depositProductAssembler;
|
||||||
this.logger = LoggerFactory.getLogger(RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.class);
|
this.LOG = LoggerFactory.getLogger(RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
||||||
this.chartAssembler = chartAssembler;
|
this.chartAssembler = chartAssembler;
|
||||||
}
|
}
|
||||||
@@ -207,6 +207,6 @@ public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implem
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||||
this.logger.error("Error occured.", dae);
|
this.LOG.error("Error occured.", dae);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -205,7 +205,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
this.gsimRepository=gsimRepository;
|
this.gsimRepository=gsimRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(SavingsAccountWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(SavingsAccountWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult gsimActivate(final Long gsimId, final JsonCommand command) {
|
public CommandProcessingResult gsimActivate(final Long gsimId, final JsonCommand command) {
|
||||||
@@ -330,7 +330,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
if (this.savingAccountRepositoryWrapper.findOneWithNotFoundDetection(savingsId).getGsim() != null) {
|
if (this.savingAccountRepositoryWrapper.findOneWithNotFoundDetection(savingsId).getGsim() != null) {
|
||||||
isGsim = true;
|
isGsim = true;
|
||||||
logger.info("is gsim");
|
LOG.info("is gsim");
|
||||||
}
|
}
|
||||||
|
|
||||||
final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId);
|
final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId);
|
||||||
@@ -350,16 +350,16 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
if (isGsim && (deposit.getId() != null)) {
|
if (isGsim && (deposit.getId() != null)) {
|
||||||
|
|
||||||
logger.debug("Deposit account has been created: {} ", deposit);
|
LOG.debug("Deposit account has been created: {} ", deposit);
|
||||||
|
|
||||||
GroupSavingsIndividualMonitoring gsim = gsimRepository.findById(account.getGsim().getId()).get();
|
GroupSavingsIndividualMonitoring gsim = gsimRepository.findById(account.getGsim().getId()).get();
|
||||||
logger.info("parent deposit : {} ", gsim.getParentDeposit());
|
LOG.info("parent deposit : {} ", gsim.getParentDeposit());
|
||||||
logger.info("child account : {} ", savingsId);
|
LOG.info("child account : {} ", savingsId);
|
||||||
BigDecimal currentBalance = gsim.getParentDeposit();
|
BigDecimal currentBalance = gsim.getParentDeposit();
|
||||||
BigDecimal newBalance = currentBalance.add(transactionAmount);
|
BigDecimal newBalance = currentBalance.add(transactionAmount);
|
||||||
gsim.setParentDeposit(newBalance);
|
gsim.setParentDeposit(newBalance);
|
||||||
gsimRepository.save(gsim);
|
gsimRepository.save(gsim);
|
||||||
logger.info("balance after making deposit : {} ", gsimRepository.findById(account.getGsim().getId()).get().getParentDeposit());
|
LOG.info("balance after making deposit : {} ", gsimRepository.findById(account.getGsim().getId()).get().getParentDeposit());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -95,7 +95,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl implements SavingsApplicationProcessWritePlatformService {
|
public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl implements SavingsApplicationProcessWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final SavingsAccountRepositoryWrapper savingAccountRepository;
|
private final SavingsAccountRepositoryWrapper savingAccountRepository;
|
||||||
@@ -181,7 +181,7 @@ public class SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
errorCodeBuilder.append(".unknown.data.integrity.issue");
|
errorCodeBuilder.append(".unknown.data.integrity.issue");
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account.");
|
throw new PlatformDataIntegrityException(errorCodeBuilder.toString(), "Unknown data integrity issue with savings account.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -58,7 +58,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements SavingsProductWritePlatformService {
|
public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements SavingsProductWritePlatformService {
|
||||||
|
|
||||||
private final Logger logger;
|
private final Logger LOG;
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final SavingsProductRepository savingProductRepository;
|
private final SavingsProductRepository savingProductRepository;
|
||||||
private final SavingsProductDataValidator fromApiJsonDataValidator;
|
private final SavingsProductDataValidator fromApiJsonDataValidator;
|
||||||
@@ -76,7 +76,7 @@ public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
this.savingProductRepository = savingProductRepository;
|
this.savingProductRepository = savingProductRepository;
|
||||||
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
||||||
this.savingsProductAssembler = savingsProductAssembler;
|
this.savingsProductAssembler = savingsProductAssembler;
|
||||||
this.logger = LoggerFactory.getLogger(SavingsProductWritePlatformServiceJpaRepositoryImpl.class);
|
this.LOG = LoggerFactory.getLogger(SavingsProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
||||||
this.fineractEntityAccessUtil = fineractEntityAccessUtil;
|
this.fineractEntityAccessUtil = fineractEntityAccessUtil;
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||||
this.logger.error("Error occured.", dae);
|
this.LOG.error("Error occured.", dae);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
+3
-3
@@ -53,7 +53,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class SelfBeneficiariesTPTWritePlatformServiceImpl implements
|
public class SelfBeneficiariesTPTWritePlatformServiceImpl implements
|
||||||
SelfBeneficiariesTPTWritePlatformService {
|
SelfBeneficiariesTPTWritePlatformService {
|
||||||
|
|
||||||
private final Logger logger;
|
private final Logger LOG;
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final SelfBeneficiariesTPTRepository repository;
|
private final SelfBeneficiariesTPTRepository repository;
|
||||||
private final SelfBeneficiariesTPTDataValidator validator;
|
private final SelfBeneficiariesTPTDataValidator validator;
|
||||||
@@ -72,7 +72,7 @@ public class SelfBeneficiariesTPTWritePlatformServiceImpl implements
|
|||||||
this.validator = validator;
|
this.validator = validator;
|
||||||
this.loanRepositoryWrapper = loanRepositoryWrapper;
|
this.loanRepositoryWrapper = loanRepositoryWrapper;
|
||||||
this.savingRepositoryWrapper = savingRepositoryWrapper;
|
this.savingRepositoryWrapper = savingRepositoryWrapper;
|
||||||
this.logger = LoggerFactory
|
this.LOG = LoggerFactory
|
||||||
.getLogger(SelfBeneficiariesTPTWritePlatformServiceImpl.class);
|
.getLogger(SelfBeneficiariesTPTWritePlatformServiceImpl.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ public class SelfBeneficiariesTPTWritePlatformServiceImpl implements
|
|||||||
NAME_PARAM_NAME, name);
|
NAME_PARAM_NAME, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.error("Error occured.", dae);
|
this.LOG.error("Error occured.", dae);
|
||||||
throw new PlatformDataIntegrityException(
|
throw new PlatformDataIntegrityException(
|
||||||
"error.msg.beneficiary.unknown.data.integrity.issue",
|
"error.msg.beneficiary.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
|
|||||||
+13
-13
@@ -62,7 +62,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
@Service(value = "scheduledJobRunnerService")
|
@Service(value = "scheduledJobRunnerService")
|
||||||
public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService {
|
public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ScheduledJobRunnerServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(ScheduledJobRunnerServiceImpl.class);
|
||||||
|
|
||||||
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
||||||
private final DateTimeFormatter formatterWithTime = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
|
private final DateTimeFormatter formatterWithTime = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
@@ -174,7 +174,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
|
|
||||||
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
||||||
|
|
||||||
logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -209,7 +209,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
|
|
||||||
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
||||||
|
|
||||||
logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -226,14 +226,14 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
} catch (final PlatformApiDataValidationException e) {
|
} catch (final PlatformApiDataValidationException e) {
|
||||||
final List<ApiParameterError> errors = e.getErrors();
|
final List<ApiParameterError> errors = e.getErrors();
|
||||||
for (final ApiParameterError error : errors) {
|
for (final ApiParameterError error : errors) {
|
||||||
logger.error("Apply annual fee failed for account: {} with message {}", savingsAccountReference.getAccountNo(), error);
|
LOG.error("Apply annual fee failed for account: {} with message {}", savingsAccountReference.getAccountNo(), error);
|
||||||
}
|
}
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
// need to handle this scenario
|
// need to handle this scenario
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), annualFeeData.size());
|
LOG.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), annualFeeData.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -248,11 +248,11 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
exceptions.add(e);
|
exceptions.add(e);
|
||||||
final List<ApiParameterError> errors = e.getErrors();
|
final List<ApiParameterError> errors = e.getErrors();
|
||||||
for (final ApiParameterError error : errors) {
|
for (final ApiParameterError error : errors) {
|
||||||
logger.error("Apply Charges due for savings failed for account {} with message: {}", savingsAccountReference.getAccountNo(), error.getDeveloperMessage(), e);
|
LOG.error("Apply Charges due for savings failed for account {} with message: {}", savingsAccountReference.getAccountNo(), error.getDeveloperMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), chargesDueData.size());
|
LOG.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), chargesDueData.size());
|
||||||
if (!exceptions.isEmpty()) { throw new JobExecutionException(exceptions); }
|
if (!exceptions.isEmpty()) { throw new JobExecutionException(exceptions); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
|
|
||||||
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
|
||||||
|
|
||||||
logger.info("{} : Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
LOG.info("{} : Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -304,14 +304,14 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
} catch (final PlatformApiDataValidationException e) {
|
} catch (final PlatformApiDataValidationException e) {
|
||||||
final List<ApiParameterError> errors = e.getErrors();
|
final List<ApiParameterError> errors = e.getErrors();
|
||||||
for (final ApiParameterError error : errors) {
|
for (final ApiParameterError error : errors) {
|
||||||
logger.error("Update maturity details failed for account: {} with message {}", depositAccount.accountNo(), error.getDeveloperMessage());
|
LOG.error("Update maturity details failed for account: {} with message {}", depositAccount.accountNo(), error.getDeveloperMessage());
|
||||||
}
|
}
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
// need to handle this scenario
|
// need to handle this scenario
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("{}: Deposit accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), depositAccounts.size());
|
LOG.info("{}: Deposit accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), depositAccounts.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -392,12 +392,12 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
exceptions.add(e);
|
exceptions.add(e);
|
||||||
final List<ApiParameterError> errors = e.getErrors();
|
final List<ApiParameterError> errors = e.getErrors();
|
||||||
for (final ApiParameterError error : errors) {
|
for (final ApiParameterError error : errors) {
|
||||||
logger.error(
|
LOG.error(
|
||||||
"Post Dividends to savings failed due to ApiParameterError for Divident detail Id: {} and savings Id: {} with message: {}",
|
"Post Dividends to savings failed due to ApiParameterError for Divident detail Id: {} and savings Id: {} with message: {}",
|
||||||
id, savingsId, error.getDeveloperMessage(), e);
|
id, savingsId, error.getDeveloperMessage(), e);
|
||||||
}
|
}
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
logger.error("Post Dividends to savings failed for Divident detail Id: {} and savings Id: {}", id, savingsId, e);
|
LOG.error("Post Dividends to savings failed for Divident detail Id: {} and savings Id: {}", id, savingsId, e);
|
||||||
exceptions.add(e);
|
exceptions.add(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -431,7 +431,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
.append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)");
|
.append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)");
|
||||||
|
|
||||||
final int result = jdbcTemplate.update(sqlBuilder.toString(), formattedDate);
|
final int result = jdbcTemplate.update(sqlBuilder.toString(), formattedDate);
|
||||||
logger.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updating closing balance
|
// Updating closing balance
|
||||||
|
|||||||
+5
-5
@@ -48,7 +48,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class TemplateMergeService {
|
public class TemplateMergeService {
|
||||||
private final static Logger logger = LoggerFactory.getLogger(TemplateMergeService.class);
|
private final static Logger LOG = LoggerFactory.getLogger(TemplateMergeService.class);
|
||||||
|
|
||||||
|
|
||||||
// private final FromJsonHelper fromApiJsonHelper;
|
// private final FromJsonHelper fromApiJsonHelper;
|
||||||
@@ -95,7 +95,7 @@ public class TemplateMergeService {
|
|||||||
try {
|
try {
|
||||||
this.scopes.put(entry.getKey(), getMapFromUrl(url));
|
this.scopes.put(entry.getKey(), getMapFromUrl(url));
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("getCompiledMapFromMappers() failed", e);
|
LOG.error("getCompiledMapFromMappers() failed", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ public class TemplateMergeService {
|
|||||||
connection.setDoInput(true);
|
connection.setDoInput(true);
|
||||||
|
|
||||||
} catch (IOException | KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) {
|
} catch (IOException | KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) {
|
||||||
logger.error("getConnection() failed, return null", e);
|
LOG.error("getConnection() failed, return null", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return connection;
|
return connection;
|
||||||
@@ -160,13 +160,13 @@ public class TemplateMergeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("getStringFromInputStream() failed", e);
|
LOG.error("getStringFromInputStream() failed", e);
|
||||||
} finally {
|
} finally {
|
||||||
if (br != null) {
|
if (br != null) {
|
||||||
try {
|
try {
|
||||||
br.close();
|
br.close();
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
logger.error("Problem occurred in getStringFromInputStream function",e);
|
LOG.error("Problem occurred in getStringFromInputStream function",e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -61,7 +61,7 @@ import org.springframework.security.core.userdetails.User;
|
|||||||
@Table(name = "m_appuser", uniqueConstraints = @UniqueConstraint(columnNames = { "username" }, name = "username_org"))
|
@Table(name = "m_appuser", uniqueConstraints = @UniqueConstraint(columnNames = { "username" }, name = "username_org"))
|
||||||
public class AppUser extends AbstractPersistableCustom implements PlatformUser {
|
public class AppUser extends AbstractPersistableCustom implements PlatformUser {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AppUser.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AppUser.class);
|
||||||
|
|
||||||
@Column(name = "email", nullable = false, length = 100)
|
@Column(name = "email", nullable = false, length = 100)
|
||||||
private String email;
|
private String email;
|
||||||
@@ -575,7 +575,7 @@ public class AppUser extends AbstractPersistableCustom implements PlatformUser {
|
|||||||
public void validateHasPermissionTo(final String function) {
|
public void validateHasPermissionTo(final String function) {
|
||||||
if (hasNotPermissionTo(function)) {
|
if (hasNotPermissionTo(function)) {
|
||||||
final String authorizationMessage = "User has no authority to: " + function;
|
final String authorizationMessage = "User has no authority to: " + function;
|
||||||
logger.info("Unauthorized access: userId: {} action: {} allowed: {}", getId(), function, getAuthorities());
|
LOG.info("Unauthorized access: userId: {} action: {} allowed: {}", getId(), function, getAuthorities());
|
||||||
throw new NoAuthorizationException(authorizationMessage);
|
throw new NoAuthorizationException(authorizationMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -73,7 +73,7 @@ import org.springframework.util.ObjectUtils;
|
|||||||
@Service
|
@Service
|
||||||
public class AppUserWritePlatformServiceJpaRepositoryImpl implements AppUserWritePlatformService {
|
public class AppUserWritePlatformServiceJpaRepositoryImpl implements AppUserWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AppUserWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(AppUserWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final UserDomainService userDomainService;
|
private final UserDomainService userDomainService;
|
||||||
@@ -351,7 +351,7 @@ public class AppUserWritePlatformServiceJpaRepositoryImpl implements AppUserWrit
|
|||||||
throw new PlatformDataIntegrityException("error.msg.user.self.service.user.already.exist", "Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user.");
|
throw new PlatformDataIntegrityException("error.msg.user.self.service.user.already.exist", "Self Service User Id is already created. Go to Admin->Users to edit or delete the self-service user.");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", "Unknown data integrity issue with resource.");
|
throw new PlatformDataIntegrityException("error.msg.unknown.data.integrity.issue", "Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -40,7 +40,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class PasswordPreferencesWritePlatformServiceJpaRepositoryImpl implements PasswordPreferencesWritePlatformService {
|
public class PasswordPreferencesWritePlatformServiceJpaRepositoryImpl implements PasswordPreferencesWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(PasswordPreferencesWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
private final PasswordValidationPolicyRepository validationRepository;
|
private final PasswordValidationPolicyRepository validationRepository;
|
||||||
private final PasswordPreferencesDataValidator dataValidator;
|
private final PasswordPreferencesDataValidator dataValidator;
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ public class PasswordPreferencesWritePlatformServiceJpaRepositoryImpl implements
|
|||||||
.with(changes) //
|
.with(changes) //
|
||||||
.build();
|
.build();
|
||||||
} catch (final DataIntegrityViolationException dve) {
|
} catch (final DataIntegrityViolationException dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
throw new PlatformDataIntegrityException("error.msg.password.validation.policy.unknown.data.integrity.issue",
|
throw new PlatformDataIntegrityException("error.msg.password.validation.policy.unknown.data.integrity.issue",
|
||||||
"Unknown data integrity issue with resource.");
|
"Unknown data integrity issue with resource.");
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -34,7 +34,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class PermissionReadPlatformServiceImpl implements PermissionReadPlatformService {
|
public class PermissionReadPlatformServiceImpl implements PermissionReadPlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(PermissionReadPlatformServiceImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(PermissionReadPlatformServiceImpl.class);
|
||||||
|
|
||||||
private final JdbcTemplate jdbcTemplate;
|
private final JdbcTemplate jdbcTemplate;
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
@@ -52,7 +52,7 @@ public class PermissionReadPlatformServiceImpl implements PermissionReadPlatform
|
|||||||
|
|
||||||
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
||||||
final String sql = mapper.permissionSchema();
|
final String sql = mapper.permissionSchema();
|
||||||
logger.info("retrieveAllPermissions: {}", sql);
|
LOG.info("retrieveAllPermissions: {}", sql);
|
||||||
return this.jdbcTemplate.query(sql, mapper, new Object[] {});
|
return this.jdbcTemplate.query(sql, mapper, new Object[] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ public class PermissionReadPlatformServiceImpl implements PermissionReadPlatform
|
|||||||
|
|
||||||
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
||||||
final String sql = mapper.makerCheckerablePermissionSchema();
|
final String sql = mapper.makerCheckerablePermissionSchema();
|
||||||
logger.info("retrieveAllMakerCheckerablePermissions: {}", sql);
|
LOG.info("retrieveAllMakerCheckerablePermissions: {}", sql);
|
||||||
|
|
||||||
return this.jdbcTemplate.query(sql, mapper, new Object[] {});
|
return this.jdbcTemplate.query(sql, mapper, new Object[] {});
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ public class PermissionReadPlatformServiceImpl implements PermissionReadPlatform
|
|||||||
|
|
||||||
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
final PermissionUsageDataMapper mapper = new PermissionUsageDataMapper();
|
||||||
final String sql = mapper.rolePermissionSchema();
|
final String sql = mapper.rolePermissionSchema();
|
||||||
logger.info("retrieveAllRolePermissions: {}", sql);
|
LOG.info("retrieveAllRolePermissions: {}", sql);
|
||||||
|
|
||||||
return this.jdbcTemplate.query(sql, mapper, new Object[] { roleId });
|
return this.jdbcTemplate.query(sql, mapper, new Object[] { roleId });
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -50,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Service
|
@Service
|
||||||
public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatformService {
|
public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatformService {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(RoleWritePlatformServiceJpaRepositoryImpl.class);
|
private final static Logger LOG = LoggerFactory.getLogger(RoleWritePlatformServiceJpaRepositoryImpl.class);
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final RoleRepository roleRepository;
|
private final RoleRepository roleRepository;
|
||||||
private final PermissionRepository permissionRepository;
|
private final PermissionRepository permissionRepository;
|
||||||
@@ -118,7 +118,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
private void logAsErrorUnexpectedDataIntegrityException(final Exception dve) {
|
||||||
logger.error("Error occured.", dve);
|
LOG.error("Error occured.", dve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Caching(evict = { @CacheEvict(value = "users", allEntries = true), @CacheEvict(value = "usersByUsername", allEntries = true) })
|
@Caching(evict = { @CacheEvict(value = "users", allEntries = true), @CacheEvict(value = "usersByUsername", allEntries = true) })
|
||||||
|
|||||||
+2
-2
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
class MultiExceptionTest {
|
class MultiExceptionTest {
|
||||||
|
|
||||||
Logger logger = LoggerFactory.getLogger(MultiExceptionTest.class);
|
Logger LOG = LoggerFactory.getLogger(MultiExceptionTest.class);
|
||||||
|
|
||||||
@Test()
|
@Test()
|
||||||
void testEmpty() throws MultiException {
|
void testEmpty() throws MultiException {
|
||||||
@@ -39,7 +39,7 @@ class MultiExceptionTest {
|
|||||||
void test() throws MultiException {
|
void test() throws MultiException {
|
||||||
List<Throwable> causes = List.of(new IllegalArgumentException(), new IllegalStateException());
|
List<Throwable> causes = List.of(new IllegalArgumentException(), new IllegalStateException());
|
||||||
MultiException e = new MultiException(causes);
|
MultiException e = new MultiException(causes);
|
||||||
logger.warn("Biep, bieb", e);
|
LOG.warn("Biep, bieb", e);
|
||||||
// Uncomment to see JUnit UI:
|
// Uncomment to see JUnit UI:
|
||||||
// throw e;
|
// throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user