I am looking at the patch attached to SLING-4207 [1] and wonder about the 
property changes.

Shouldn’t we just have a TENANT_UPDATED event with three additional properties:

  * addedProperties
  * removedProperties
  * changedProperties

I agree, that adding just the propertyNames makes sense to not leak 
information. On the other hand, a Tenant can easily be retrieved and the 
properties accessed, so leaking may not be that big of a problem.

Plus: the added/removed/changed properties would not only be the properties set 
on the respective initial call but also encompassing any updates done by the 
TenantCustomizers.

So, essentially the properties would be:

  addedProperties = newProperties without oldProperties;
  removedProperties = oldProperties without newProperties;
  changedProperties = newProperties and oldProperties;

WDYT ?

Regards
Felix

[1] https://issues.apache.org/jira/browse/SLING-4207

> Am 28.11.2014 um 12:52 schrieb Felix Meschberger <[email protected]>:
> 
> Hi
> 
> This sounds useful to me.
> 
> Lets do OSGi events to decouple the actual listener handling and event 
> distribution from the tenant manager.
> 
> Regards
> Felix
> 
> --
> Typos caused by my iPhone
> 
>> Am 27.11.2014 um 16:56 schrieb Timothée Maret <[email protected]>:
>> 
>> Hi,
>> 
>> Currently, there is no clean way to detect when a tenant has been
>> added/removed/modified.
>> 
>> We may detect when a change is required by implementing the
>> TenantCustomizer interface, however, it tells nothing about the actual
>> completion of the change.
>> We may listen for OSGI events under /etc/tenants but this requires the user
>> to know where the tenants are located (which afaik, currently is not
>> exposed).
>> 
>> In order to allow apps reacting on tenant changes, I propose to either:
>> 
>> I. extend the current SPI with an interface TenantEventListener that users
>> can implement ; or
>> II. send OSGI events form the current implementation.
>> 
>> In both cases, the events should cover
>> * Tenant added
>> * Tenant removed
>> * Property added
>> * Property removed
>> 
>> wdyt ?
>> 
>> Regards,
>> 
>> Timothee

Reply via email to