T
- as tenant type, Example: Organization
U
- as SAASUser
typepublic class LogonChangeListener<T,U extends SAASUser<T>> extends LogonChangeListener<U>
LogonChangeListener
that ensures;
user Organization(s) are also loaded on login.
<bean class="com.skippo.user.service.LogonChangeListener">
<property name="subTenantsFromPrimaryTenantTransformer">
<bean class="com.neurosys.etl.common.TransformerChain"><constructor-arg><list>
<bean class="com.neurosys.etl.common.transformers.StringConcatTransformer"><constructor-arg><list>
<bean class="com.neurosys.etl.common.transformers.EntityChainAccessTransformer">
<property name="accessor" value="hierarchy"/>
</bean>
<value>_%</value>
</list></constructor-arg></bean>
<bean class="com.neurosys.dao.jpa.JPAQueryTransformer">
<property name="query"><value><![CDATA[
SELECT orgs from Organization orgs WHERE hierarchy LIKE ?1 ORDER BY hierarchy
]]></value></property>
<property name="queryIsNative" value="false" />
</bean>
</list></constructor-arg></bean>
</property>
</bean>
EVENT_LOGIN, EVENT_LOGOUT
Constructor and Description |
---|
LogonChangeListener() |
Modifier and Type | Method and Description |
---|---|
org.apache.commons.collections.Transformer |
getSubTenantsFromPrimaryOrgTransformer()
Assuming the tenant is a Hierarchy we will need to resolve it to its sub-tenants also to ensure, a person with access to parent tenant
can also access sub-tenants.
|
protected String |
identifyTenant(T tenant) |
protected void |
onChange(ChangeGenerator generator,
String eventName,
U user)
Override this method for any further customizations
By default simply passes on the AdminUser.getLastLogInDate() and AdminUser.getLastLogOutDate()
to the persisted entity. |
void |
setSubOrgsFromPrimaryOrgTransformer(org.apache.commons.collections.Transformer subTenantsFromPrimaryTenantTransformer)
Assuming the tenant is a Hierarchy we will need to resolve it to its sub-tenants also to ensure, a person with access to parent tenant
can also access sub-tenants.
|
getDao, onChange
protected void onChange(ChangeGenerator generator, String eventName, U user)
LogonChangeListener
AdminUser.getLastLogInDate()
and AdminUser.getLastLogOutDate()
to the persisted entity.onChange
in class LogonChangeListener<U extends SAASUser<T>>
generator
- as ChangeGenerator
eventName
- as Stringuser
- as User
type protected String identifyTenant(T tenant)
Displayable
type and displays its display name.public org.apache.commons.collections.Transformer getSubTenantsFromPrimaryOrgTransformer()
Transformer
that returns list of sub AppOrganization
s for an AppOrganization
public void setSubOrgsFromPrimaryOrgTransformer(org.apache.commons.collections.Transformer subTenantsFromPrimaryTenantTransformer)
subTenantsFromPrimaryTenantTransformer
- - a Transformer
that returns list of sub tenants for a parent tenantCopyright © 2018. All rights reserved.