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
|
||||
@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() {
|
||||
context.authenticatedUser();
|
||||
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class CodeValueReadPlatformServiceImpl implements CodeValueReadPlatformSe
|
||||
}
|
||||
|
||||
@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) {
|
||||
|
||||
context.authenticatedUser();
|
||||
|
||||
+3
-3
@@ -44,7 +44,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
|
||||
try {
|
||||
@@ -64,7 +64,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
|
||||
try {
|
||||
@@ -92,7 +92,7 @@ public class CodeWritePlatformServiceJpaRepositoryImpl implements CodeWritePlatf
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
|
||||
context.authenticatedUser();
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class TenantAwareJpaPlatformUserDetailsService implements PlatformUserDet
|
||||
private PlatformUserRepository platformUserRepository;
|
||||
|
||||
@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 {
|
||||
|
||||
final PlatformUser appUser = this.platformUserRepository.findByUsername(username);
|
||||
|
||||
+2
-2
@@ -127,7 +127,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
|
||||
}
|
||||
|
||||
@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() {
|
||||
|
||||
AppUser currentUser = context.authenticatedUser();
|
||||
@@ -142,7 +142,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
|
||||
}
|
||||
|
||||
@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() {
|
||||
final AppUser currentUser = context.authenticatedUser();
|
||||
|
||||
|
||||
+4
-4
@@ -63,8 +63,8 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP
|
||||
@Transactional
|
||||
@Override
|
||||
@Caching(evict = {
|
||||
@CacheEvict(value = "offices", 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())") })
|
||||
@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()+'oft')") })
|
||||
public CommandProcessingResult createOffice(final JsonCommand command) {
|
||||
|
||||
try {
|
||||
@@ -101,8 +101,8 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP
|
||||
@Transactional
|
||||
@Override
|
||||
@Caching(evict = {
|
||||
@CacheEvict(value = "offices", 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())") })
|
||||
@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()+'oft')") })
|
||||
public CommandProcessingResult updateOffice(final Long officeId, final JsonCommand command) {
|
||||
|
||||
try {
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService
|
||||
}
|
||||
|
||||
@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() {
|
||||
this.context.authenticatedUser();
|
||||
|
||||
|
||||
+3
-3
@@ -57,7 +57,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
try {
|
||||
this.context.authenticatedUser();
|
||||
@@ -76,7 +76,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
|
||||
try {
|
||||
@@ -102,7 +102,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
|
||||
this.context.authenticatedUser();
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class FundReadPlatformServiceImpl implements FundReadPlatformService {
|
||||
}
|
||||
|
||||
@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() {
|
||||
|
||||
context.authenticatedUser();
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatf
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
|
||||
try {
|
||||
@@ -64,7 +64,7 @@ public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatf
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
|
||||
try {
|
||||
|
||||
+2
-1
@@ -5,12 +5,13 @@
|
||||
*/
|
||||
package org.mifosplatform.useradministration.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Immutable data object for role data.
|
||||
*/
|
||||
public class RoleData {
|
||||
public class RoleData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
private final String name;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||
|
||||
@Entity
|
||||
@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)
|
||||
private String name;
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class RoleReadPlatformServiceImpl implements RoleReadPlatformService {
|
||||
}
|
||||
|
||||
@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() {
|
||||
final String sql = "select " + roleRowMapper.schema() + " order by r.id";
|
||||
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
|
||||
try {
|
||||
@@ -99,7 +99,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
try {
|
||||
context.authenticatedUser();
|
||||
@@ -129,7 +129,7 @@ public class RoleWritePlatformServiceJpaRepositoryImpl implements RoleWritePlatf
|
||||
|
||||
@Transactional
|
||||
@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) {
|
||||
context.authenticatedUser();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user