introduce cache zone identifier to keys
This commit is contained in:
committed by
Keith Woodlock
parent
0410ab14ea
commit
72ceb5340f
+1
-1
@@ -50,7 +50,7 @@ public class CodeReadPlatformServiceImpl implements CodeReadPlatformService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = "codes", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@Cacheable(value = "codes", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('CD')")
|
||||||
public Collection<CodeData> retrieveAllCodes() {
|
public Collection<CodeData> retrieveAllCodes() {
|
||||||
context.authenticatedUser();
|
context.authenticatedUser();
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ public class CodeValueReadPlatformServiceImpl implements CodeValueReadPlatformSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = "code_values", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#codeId)")
|
@Cacheable(value = "code_values", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#codeId+'cv')")
|
||||||
public Collection<CodeValueData> retrieveAllCodeValues(Long codeId) {
|
public Collection<CodeValueData> retrieveAllCodeValues(Long codeId) {
|
||||||
|
|
||||||
context.authenticatedUser();
|
context.authenticatedUser();
|
||||||
|
|||||||
+3
-3
@@ -44,7 +44,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "codes", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "codes", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('cv')")
|
||||||
public CommandProcessingResult createCode(final JsonCommand command) {
|
public CommandProcessingResult createCode(final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -64,7 +64,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "codes", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "codes", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('cv')")
|
||||||
public CommandProcessingResult updateCode(final Long codeId, final JsonCommand command) {
|
public CommandProcessingResult updateCode(final Long codeId, final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -92,7 +92,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "codes", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "codes", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('cv')")
|
||||||
public CommandProcessingResult deleteCode(final Long codeId) {
|
public CommandProcessingResult deleteCode(final Long codeId) {
|
||||||
|
|
||||||
context.authenticatedUser();
|
context.authenticatedUser();
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ public class TenantAwareJpaPlatformUserDetailsService implements PlatformUserDet
|
|||||||
private PlatformUserRepository platformUserRepository;
|
private PlatformUserRepository platformUserRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = "users", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#username)")
|
@Cacheable(value = "users", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#username+'un')")
|
||||||
public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException, DataAccessException {
|
public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException, DataAccessException {
|
||||||
|
|
||||||
final PlatformUser appUser = this.platformUserRepository.findByUsername(username);
|
final PlatformUser appUser = this.platformUserRepository.findByUsername(username);
|
||||||
|
|||||||
+2
-2
@@ -127,7 +127,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = "offices", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy())")
|
@Cacheable(value = "offices", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy()+'of')")
|
||||||
public Collection<OfficeData> retrieveAllOffices() {
|
public Collection<OfficeData> retrieveAllOffices() {
|
||||||
|
|
||||||
AppUser currentUser = context.authenticatedUser();
|
AppUser currentUser = context.authenticatedUser();
|
||||||
@@ -142,7 +142,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = "office_template", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy())")
|
@Cacheable(value = "office_template", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy()+'oft')")
|
||||||
public Collection<OfficeData> retrieveAllOfficesForDropdown() {
|
public Collection<OfficeData> retrieveAllOfficesForDropdown() {
|
||||||
final AppUser currentUser = context.authenticatedUser();
|
final AppUser currentUser = context.authenticatedUser();
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -63,8 +63,8 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@Caching(evict = {
|
@Caching(evict = {
|
||||||
@CacheEvict(value = "offices", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy())"),
|
@CacheEvict(value = "offices", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy()+'of')"),
|
||||||
@CacheEvict(value = "office_template", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy())") })
|
@CacheEvict(value = "office_template", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy()+'oft')") })
|
||||||
public CommandProcessingResult createOffice(final JsonCommand command) {
|
public CommandProcessingResult createOffice(final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -101,8 +101,8 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@Caching(evict = {
|
@Caching(evict = {
|
||||||
@CacheEvict(value = "offices", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy())"),
|
@CacheEvict(value = "offices", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy()+'of')"),
|
||||||
@CacheEvict(value = "office_template", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy())") })
|
@CacheEvict(value = "office_template", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat(#root.target.context.authenticatedUser().getOffice().getHierarchy()+'oft')") })
|
||||||
public CommandProcessingResult updateOffice(final Long officeId, final JsonCommand command) {
|
public CommandProcessingResult updateOffice(final Long officeId, final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = "charges", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@Cacheable(value = "charges", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('ch')")
|
||||||
public Collection<ChargeData> retrieveAllCharges() {
|
public Collection<ChargeData> retrieveAllCharges() {
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -57,7 +57,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "charges", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "charges", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('ch')")
|
||||||
public CommandProcessingResult createCharge(final JsonCommand command) {
|
public CommandProcessingResult createCharge(final JsonCommand command) {
|
||||||
try {
|
try {
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
@@ -76,7 +76,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "charges", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "charges", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('c')")
|
||||||
public CommandProcessingResult updateCharge(final Long chargeId, final JsonCommand command) {
|
public CommandProcessingResult updateCharge(final Long chargeId, final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -102,7 +102,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "charges", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "charges", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('ch')")
|
||||||
public CommandProcessingResult deleteCharge(final Long chargeId) {
|
public CommandProcessingResult deleteCharge(final Long chargeId) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ public class FundReadPlatformServiceImpl implements FundReadPlatformService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = "funds", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@Cacheable(value = "funds", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('fn')")
|
||||||
public Collection<FundData> retrieveAllFunds() {
|
public Collection<FundData> retrieveAllFunds() {
|
||||||
|
|
||||||
context.authenticatedUser();
|
context.authenticatedUser();
|
||||||
|
|||||||
+2
-2
@@ -43,7 +43,7 @@ public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "fund", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "funds", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('fn')")
|
||||||
public CommandProcessingResult createFund(final JsonCommand command) {
|
public CommandProcessingResult createFund(final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -64,7 +64,7 @@ public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "fund", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "funds", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('fn')")
|
||||||
public CommandProcessingResult updateFund(final Long fundId, final JsonCommand command) {
|
public CommandProcessingResult updateFund(final Long fundId, final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
+2
-1
@@ -5,12 +5,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.mifosplatform.useradministration.data;
|
package org.mifosplatform.useradministration.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable data object for role data.
|
* Immutable data object for role data.
|
||||||
*/
|
*/
|
||||||
public class RoleData {
|
public class RoleData implements Serializable {
|
||||||
|
|
||||||
private final Long id;
|
private final Long id;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_role", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "unq_name")})
|
@Table(name = "m_role", uniqueConstraints = { @UniqueConstraint(columnNames = { "name" }, name = "unq_name")})
|
||||||
public class Role extends AbstractPersistable<Long> implements Serializable {
|
public class Role extends AbstractPersistable<Long> {
|
||||||
|
|
||||||
@Column(name = "name", unique = true, nullable = false, length = 100)
|
@Column(name = "name", unique = true, nullable = false, length = 100)
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ public class RoleReadPlatformServiceImpl implements RoleReadPlatformService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = "roles", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@Cacheable(value = "roles", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('rl')")
|
||||||
public Collection<RoleData> retrieveAll() {
|
public Collection<RoleData> retrieveAll() {
|
||||||
final String sql = "select " + roleRowMapper.schema() + " order by r.id";
|
final String sql = "select " + roleRowMapper.schema() + " order by r.id";
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -53,7 +53,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "roles", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "roles", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('rl')")
|
||||||
public CommandProcessingResult createRole(final JsonCommand command) {
|
public CommandProcessingResult createRole(final JsonCommand command) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -99,7 +99,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "roles", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "roles", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('rl')")
|
||||||
public CommandProcessingResult updateRole(final Long roleId, final JsonCommand command) {
|
public CommandProcessingResult updateRole(final Long roleId, final JsonCommand command) {
|
||||||
try {
|
try {
|
||||||
context.authenticatedUser();
|
context.authenticatedUser();
|
||||||
@@ -129,7 +129,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = "roles", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()")
|
@CacheEvict(value = "roles", key = "T(org.mifosplatform.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier().concat('rl')")
|
||||||
public CommandProcessingResult updateRolePermissions(final Long roleId, final JsonCommand command) {
|
public CommandProcessingResult updateRolePermissions(final Long roleId, final JsonCommand command) {
|
||||||
context.authenticatedUser();
|
context.authenticatedUser();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user