@Component(value="core_InMemoryUserSubstitutionProvider") public class InMemoryUserSubstitutionProvider extends java.lang.Object implements UserSubstitutionProvider
UserSubstitutionProvider
that stores UserSubstitution
in memory.Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationEventPublisher |
eventPublisher |
protected com.google.common.collect.Multimap<java.lang.String,UserSubstitution> |
userSubstitutions |
Constructor and Description |
---|
InMemoryUserSubstitutionProvider() |
Modifier and Type | Method and Description |
---|---|
void |
addUserSubstitution(UserSubstitution userSubstitution) |
void |
clear() |
protected void |
fireUserSubstitutionsChanged(java.lang.String username) |
java.util.Collection<UserSubstitution> |
getUserSubstitutions(java.lang.String username,
java.util.Date date)
Method returns a collection of
UserSubstitution available for the given username and active at
the given date . |
protected void |
onUserRemove(UserRemovedEvent event) |
protected com.google.common.collect.Multimap<java.lang.String,UserSubstitution> userSubstitutions
@Autowired protected org.springframework.context.ApplicationEventPublisher eventPublisher
public java.util.Collection<UserSubstitution> getUserSubstitutions(java.lang.String username, java.util.Date date)
UserSubstitutionProvider
UserSubstitution
available for the given username
and active at
the given date
. If UserSubstitution.startDate
and UserSubstitution.endDate
are
null then this substitution is considered active.getUserSubstitutions
in interface UserSubstitutionProvider
public void addUserSubstitution(UserSubstitution userSubstitution)
public void clear()
@EventListener protected void onUserRemove(UserRemovedEvent event)
protected void fireUserSubstitutionsChanged(java.lang.String username)