package com.pollex.pam.aop.logging.audit.strategy;
|
|
import com.pollex.pam.aop.logging.audit.AuditLoggingType;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
import java.util.List;
|
|
@Component
|
public class AuditLoggingFactory {
|
|
@Autowired
|
List<AuditLoggingStrategy> strategies;
|
|
@Autowired
|
DoNothingStrategy doNothingStrategy;
|
|
public AuditLoggingStrategy getAuditLoggingStrategy(AuditLoggingType type) {
|
for(AuditLoggingStrategy strategy : strategies) {
|
if(strategy.getType() == type) {
|
return strategy;
|
}
|
}
|
|
return doNothingStrategy;
|
}
|
|
}
|