Re: [Architecture] Cloud Tenant deletion caching issue

2019-03-01 Thread Isura Karunaratne
Hi Pushpalanka,

We fixed this by using caches for tenantIdDomainMap and tenantDomainIdMap.
Once an item is removed from a node, other nodes' same cache will be
invalidated using local cache invalidations cluster messages.

Cheers,
Isura.

On Thu, Feb 21, 2019 at 7:41 PM Pushpalanka Jayawardhana 
wrote:

> Hi All,
>
> On Wed, 10 Sep 2014 at 21:13, Godwin Amila Shrimal 
> wrote:
>
>> Hi,
>>
>> As per the discussion had with Azeez offline please see below the
>> solution agreed.
>>
>> 1. Add a new overload method to *TenantManager *as *void
>> deleteTenant(int tenantId, boolean removeFromPersistentStorage) throws
>> UserStoreException;*
>>
>> 2. Implement this method in *JDBCTenantManager *class which use to
>> delete only the map entry and execute in each worker nodes by calling
>> from Cluster message.
>>
>> 3. Modify existing deleteTenant(int tenantId) to delete the persistent
>>  storage which is calling in management node.
>>
>> Please see below modified code snippet in *JDBCTenantManager*
>>
>>
>>  @Override
>> public void deleteTenant(int tenantId) throws UserStoreException {
>> try {
>> deleteTenant(tenantId, true);
>> } catch (org.wso2.carbon.user.api.UserStoreException e) {
>> throw new UserStoreException(e);
>> }
>> }
>>
>> @Override
>> public void deleteTenant(int tenantId, boolean
>> removeFromPersistentStorage)
>> throws org.wso2.carbon.user.api.UserStoreException {
>> // Remove tenant information from the cache.
>> String tenantDomain = (String) tenantIdDomainMap.remove(tenantId);
>> tenantDomainIdMap.remove(tenantDomain);
>>
>> tenantCacheManager.clearCacheEntry(new TenantIdKey(tenantId));
>>
>> if (removeFromPersistentStorage) {
>> Connection dbConnection = null;
>> PreparedStatement prepStmt = null;
>> try {
>> dbConnection = getDBConnection();
>> String sqlStmt = TenantConstants.DELETE_TENANT_SQL;
>> prepStmt = dbConnection.prepareStatement(sqlStmt);
>> prepStmt.setInt(1, tenantId);
>>
>> prepStmt.executeUpdate();
>> dbConnection.commit();
>> } catch (SQLException e) {
>> DatabaseUtil.rollBack(dbConnection);
>> String msg = "Error in deleting the tenant with " +
>> "tenant id: "
>> + tenantId + ".";
>> log.error(msg, e);
>> throw new UserStoreException(msg, e);
>> } finally {
>> DatabaseUtil.closeAllConnections(dbConnection,prepStmt);
>> }
>> }
>> }
>>
>> Did we follow this approach and fix this?
> Appreciate some details on how this issue was overcome.
>
> Thanks,
> Pushpalanka
>
>>
>>
>> Thanks
>> Godwin
>>
>>
>>
>>
>> On Tue, Sep 9, 2014 at 6:04 PM, Godwin Amila Shrimal 
>> wrote:
>>
>>> Yes, there are two maps as *tenantDomainIdMap* and *tenantIdDomainMap*.
>>> we'll address both.
>>>
>>>
>>>
>>> On Tue, Sep 9, 2014 at 5:23 PM, Amila Maha Arachchi 
>>> wrote:
>>>
 +1

 I remember there were two maps or a bidi-map. i.e. It was tracking both
 tenant ID and tenant domain. Make sure both issues are addressed (if my
 concern is valid).

 On Tue, Sep 9, 2014 at 3:37 AM, Godwin Amila Shrimal 
 wrote:

> Hi.
>
> We had a discussion about cleaning cache data (delete map entry in
> *JDBCTenantManger*), As per the discussion, we have to use cluster
> message to notify all the nodes in the clustered environment to
> delete the map entry.  Then we have to give a public method in
> *JDBCTenantManger* to delete the entry which is accessible from the
> *execute* method of the cluster message.
>
> listed below the summary of the implementation.
>
> 1. Create a new public method in *JDBCTenantManger *to delete the map
> entry.
> 2. Create a new class which extends ClusteringMessage and implements
> Serializable.
> 3. Implement the *execute* method on above class to perform the
> delete map entry method inside the *JDBCTenantManger.*
> 4. When execute the deleteTenant method in *TenantMgtAdminService, *create
> a object from new Cluster Message class created in #2 and set the tenantId
> as a property and send to all nodes in the cluster.
> 5. Nodes will receive the above message, deserialize it and perform
> the execute method of the cluster message, which will delete the map entry
> in each nodes.
>
>
> Please give a feedback on this.
>
>
> Thanks
> Godwin
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Mon, Sep 8, 2014 at 10:07 AM, Godwin Amila Shrimal  > wrote:
>
>> Hi All,
>>
>> Thanks for the valuable responses, As I understood we have to use cluster
>> messages(Which I 

Re: [Architecture] Cloud Tenant deletion caching issue

2019-02-21 Thread Pushpalanka Jayawardhana
Hi All,

On Wed, 10 Sep 2014 at 21:13, Godwin Amila Shrimal  wrote:

> Hi,
>
> As per the discussion had with Azeez offline please see below the solution
> agreed.
>
> 1. Add a new overload method to *TenantManager *as *void deleteTenant(int
> tenantId, boolean removeFromPersistentStorage) throws UserStoreException;*
>
> 2. Implement this method in *JDBCTenantManager *class which use to delete
> only the map entry and execute in each worker nodes by calling from
> Cluster message.
>
> 3. Modify existing deleteTenant(int tenantId) to delete the persistent
>  storage which is calling in management node.
>
> Please see below modified code snippet in *JDBCTenantManager*
>
>
>  @Override
> public void deleteTenant(int tenantId) throws UserStoreException {
> try {
> deleteTenant(tenantId, true);
> } catch (org.wso2.carbon.user.api.UserStoreException e) {
> throw new UserStoreException(e);
> }
> }
>
> @Override
> public void deleteTenant(int tenantId, boolean
> removeFromPersistentStorage)
> throws org.wso2.carbon.user.api.UserStoreException {
> // Remove tenant information from the cache.
> String tenantDomain = (String) tenantIdDomainMap.remove(tenantId);
> tenantDomainIdMap.remove(tenantDomain);
>
> tenantCacheManager.clearCacheEntry(new TenantIdKey(tenantId));
>
> if (removeFromPersistentStorage) {
> Connection dbConnection = null;
> PreparedStatement prepStmt = null;
> try {
> dbConnection = getDBConnection();
> String sqlStmt = TenantConstants.DELETE_TENANT_SQL;
> prepStmt = dbConnection.prepareStatement(sqlStmt);
> prepStmt.setInt(1, tenantId);
>
> prepStmt.executeUpdate();
> dbConnection.commit();
> } catch (SQLException e) {
> DatabaseUtil.rollBack(dbConnection);
> String msg = "Error in deleting the tenant with " +
> "tenant id: "
> + tenantId + ".";
> log.error(msg, e);
> throw new UserStoreException(msg, e);
> } finally {
> DatabaseUtil.closeAllConnections(dbConnection,prepStmt);
> }
> }
> }
>
> Did we follow this approach and fix this?
Appreciate some details on how this issue was overcome.

Thanks,
Pushpalanka

>
>
> Thanks
> Godwin
>
>
>
>
> On Tue, Sep 9, 2014 at 6:04 PM, Godwin Amila Shrimal 
> wrote:
>
>> Yes, there are two maps as *tenantDomainIdMap* and *tenantIdDomainMap*.
>> we'll address both.
>>
>>
>>
>> On Tue, Sep 9, 2014 at 5:23 PM, Amila Maha Arachchi 
>> wrote:
>>
>>> +1
>>>
>>> I remember there were two maps or a bidi-map. i.e. It was tracking both
>>> tenant ID and tenant domain. Make sure both issues are addressed (if my
>>> concern is valid).
>>>
>>> On Tue, Sep 9, 2014 at 3:37 AM, Godwin Amila Shrimal 
>>> wrote:
>>>
 Hi.

 We had a discussion about cleaning cache data (delete map entry in
 *JDBCTenantManger*), As per the discussion, we have to use cluster
 message to notify all the nodes in the clustered environment to delete
 the map entry.  Then we have to give a public method in
 *JDBCTenantManger* to delete the entry which is accessible from the
 *execute* method of the cluster message.

 listed below the summary of the implementation.

 1. Create a new public method in *JDBCTenantManger *to delete the map
 entry.
 2. Create a new class which extends ClusteringMessage and implements
 Serializable.
 3. Implement the *execute* method on above class to perform the delete
 map entry method inside the *JDBCTenantManger.*
 4. When execute the deleteTenant method in *TenantMgtAdminService, *create
 a object from new Cluster Message class created in #2 and set the tenantId
 as a property and send to all nodes in the cluster.
 5. Nodes will receive the above message, deserialize it and perform the
 execute method of the cluster message, which will delete the map entry in
 each nodes.


 Please give a feedback on this.


 Thanks
 Godwin















 On Mon, Sep 8, 2014 at 10:07 AM, Godwin Amila Shrimal 
 wrote:

> Hi All,
>
> Thanks for the valuable responses, As I understood we have to use cluster
> messages(Which I need to study more) to delete the map entry in each nodes
> in clustered environment.
> @Danushka: Yes we can use the existing deleteTenant method in
> *JDBCTenantManger*.
>
> Thanks
> Godwin
>
>
> On Sun, Sep 7, 2014 at 9:59 PM, Danushka Fernando 
> wrote:
>
>> Hi
>>
>> On Sun, Sep 7, 2014 at 6:59 PM, Johann Nallathamby 
>> wrote:
>>
>>>
>>>
>>>
>>> On Sun, Sep 7, 2014 at 6:29 PM, 

Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-10 Thread Godwin Amila Shrimal
Hi,

As per the discussion had with Azeez offline please see below the solution
agreed.

1. Add a new overload method to *TenantManager *as *void deleteTenant(int
tenantId, boolean removeFromPersistentStorage) throws UserStoreException;*

2. Implement this method in *JDBCTenantManager *class which use to delete
only the map entry and execute in each worker nodes by calling from Cluster
message.

3. Modify existing deleteTenant(int tenantId) to delete the persistent
 storage which is calling in management node.

Please see below modified code snippet in *JDBCTenantManager*


 @Override
public void deleteTenant(int tenantId) throws UserStoreException {
try {
deleteTenant(tenantId, true);
} catch (org.wso2.carbon.user.api.UserStoreException e) {
throw new UserStoreException(e);
}
}

@Override
public void deleteTenant(int tenantId, boolean
removeFromPersistentStorage)
throws org.wso2.carbon.user.api.UserStoreException {
// Remove tenant information from the cache.
String tenantDomain = (String) tenantIdDomainMap.remove(tenantId);
tenantDomainIdMap.remove(tenantDomain);

tenantCacheManager.clearCacheEntry(new TenantIdKey(tenantId));

if (removeFromPersistentStorage) {
Connection dbConnection = null;
PreparedStatement prepStmt = null;
try {
dbConnection = getDBConnection();
String sqlStmt = TenantConstants.DELETE_TENANT_SQL;
prepStmt = dbConnection.prepareStatement(sqlStmt);
prepStmt.setInt(1, tenantId);

prepStmt.executeUpdate();
dbConnection.commit();
} catch (SQLException e) {
DatabaseUtil.rollBack(dbConnection);
String msg = Error in deleting the tenant with  + tenant
id: 
+ tenantId + .;
log.error(msg, e);
throw new UserStoreException(msg, e);
} finally {
DatabaseUtil.closeAllConnections(dbConnection,prepStmt);
}
}
}



Thanks
Godwin




On Tue, Sep 9, 2014 at 6:04 PM, Godwin Amila Shrimal god...@wso2.com
wrote:

 Yes, there are two maps as *tenantDomainIdMap* and *tenantIdDomainMap*.
 we'll address both.



 On Tue, Sep 9, 2014 at 5:23 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:

 +1

 I remember there were two maps or a bidi-map. i.e. It was tracking both
 tenant ID and tenant domain. Make sure both issues are addressed (if my
 concern is valid).

 On Tue, Sep 9, 2014 at 3:37 AM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi.

 We had a discussion about cleaning cache data (delete map entry in
 *JDBCTenantManger*), As per the discussion, we have to use cluster
 message to notify all the nodes in the clustered environment to delete
 the map entry.  Then we have to give a public method in
 *JDBCTenantManger* to delete the entry which is accessible from the
 *execute* method of the cluster message.

 listed below the summary of the implementation.

 1. Create a new public method in *JDBCTenantManger *to delete the map
 entry.
 2. Create a new class which extends ClusteringMessage and implements
 Serializable.
 3. Implement the *execute* method on above class to perform the delete
 map entry method inside the *JDBCTenantManger.*
 4. When execute the deleteTenant method in *TenantMgtAdminService, *create
 a object from new Cluster Message class created in #2 and set the tenantId
 as a property and send to all nodes in the cluster.
 5. Nodes will receive the above message, deserialize it and perform the
 execute method of the cluster message, which will delete the map entry in
 each nodes.


 Please give a feedback on this.


 Thanks
 Godwin















 On Mon, Sep 8, 2014 at 10:07 AM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi All,

 Thanks for the valuable responses, As I understood we have to use cluster
 messages(Which I need to study more) to delete the map entry in each nodes
 in clustered environment.
 @Danushka: Yes we can use the existing deleteTenant method in
 *JDBCTenantManger*.

 Thanks
 Godwin


 On Sun, Sep 7, 2014 at 9:59 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi

 On Sun, Sep 7, 2014 at 6:59 PM, Johann Nallathamby joh...@wso2.com
 wrote:




 On Sun, Sep 7, 2014 at 6:29 PM, Danushka Fernando danush...@wso2.com
  wrote:

 Hi
 To the first most problem raised by Goodwin, AFAIU when you call
 tenant deletion you call deleteTenant in TenantManager. So why cant you
 clear the tenant from the map in JDBCTenantManger's deleteTenant method?


 Yes. Should be able to do that. But as Shankar explained we need to
 send cluster messages to do the same in all the nodes.

 Yes I also agree to that point. +1.


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Sat, Sep 6, 2014 at 8:20 PM, Nirmal Fernando 

Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-09 Thread Godwin Amila Shrimal
Hi.

We had a discussion about cleaning cache data (delete map entry in
*JDBCTenantManger*), As per the discussion, we have to use cluster message
to notify all the nodes in the clustered environment to delete the map
entry.  Then we have to give a public method in *JDBCTenantManger* to
delete the entry which is accessible from the *execute* method of the
cluster message.

listed below the summary of the implementation.

1. Create a new public method in *JDBCTenantManger *to delete the map entry.
2. Create a new class which extends ClusteringMessage and implements
Serializable.
3. Implement the *execute* method on above class to perform the delete map
entry method inside the *JDBCTenantManger.*
4. When execute the deleteTenant method in *TenantMgtAdminService, *create
a object from new Cluster Message class created in #2 and set the tenantId
as a property and send to all nodes in the cluster.
5. Nodes will receive the above message, deserialize it and perform the
execute method of the cluster message, which will delete the map entry in
each nodes.


Please give a feedback on this.


Thanks
Godwin















On Mon, Sep 8, 2014 at 10:07 AM, Godwin Amila Shrimal god...@wso2.com
wrote:

 Hi All,

 Thanks for the valuable responses, As I understood we have to use cluster
 messages(Which I need to study more) to delete the map entry in each nodes
 in clustered environment.
 @Danushka: Yes we can use the existing deleteTenant method in
 *JDBCTenantManger*.

 Thanks
 Godwin


 On Sun, Sep 7, 2014 at 9:59 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi

 On Sun, Sep 7, 2014 at 6:59 PM, Johann Nallathamby joh...@wso2.com
 wrote:




 On Sun, Sep 7, 2014 at 6:29 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi
 To the first most problem raised by Goodwin, AFAIU when you call tenant
 deletion you call deleteTenant in TenantManager. So why cant you clear the
 tenant from the map in JDBCTenantManger's deleteTenant method?


 Yes. Should be able to do that. But as Shankar explained we need to send
 cluster messages to do the same in all the nodes.

 Yes I also agree to that point. +1.


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Sat, Sep 6, 2014 at 8:20 PM, Nirmal Fernando nir...@wso2.com
 wrote:

 Shouldn't this tenant event listener be triggered in all the nodes in
 the cluster? If not, I think we might need to fix it.


 On Sat, Sep 6, 2014 at 10:00 AM, Selvaratnam Uthaiyashankar 
 shan...@wso2.com wrote:

 Even if we have public method, how will it work in a clustered
 environment? For example, delete request is sent to Node1, (and lets say
 one way or the other we delete the entry from map on Node1), and create
 request is sent to Node 2 (which still has the entry in the map). Are we
 going to use cluster messages to clear the entry from all nodes?


 On Friday, September 5, 2014, Nirmal Fernando nir...@wso2.com
 wrote:

 I think that should be ok. @Johann wdyt?


 On Fri, Sep 5, 2014 at 8:23 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:

 Hi Nirmal,

 Yes we can do it, But current map doesn't have public access, then
 we need to have a public method inside the *JDBCTenantManager *to
 delete the entry.


 On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com
 wrote:

 Can't we use a tenant event listener and remove the entry from the
 map on a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform
 the current tenant deletion operation in *TenantMgtAdminService*
 it deletes registry, user store etc. data. But it doesn't allow to 
 create a
 tenant again with the same tenant domain name until restart the 
 server.

 Reason for above situation is tenant domain and id is keeping in
 a map(*tenantDomainIdMap*) inside the *JDBCTenantManager*. When
 perform delete operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data,
 but this will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the
 map, this will be a security issue which people can pass tenant 
 domain and
 perform deletion.

 *Solution3*
 Run a periodic operation which check the availability of the
 tenant in the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  

Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-09 Thread Amila Maha Arachchi
+1

I remember there were two maps or a bidi-map. i.e. It was tracking both
tenant ID and tenant domain. Make sure both issues are addressed (if my
concern is valid).

On Tue, Sep 9, 2014 at 3:37 AM, Godwin Amila Shrimal god...@wso2.com
wrote:

 Hi.

 We had a discussion about cleaning cache data (delete map entry in
 *JDBCTenantManger*), As per the discussion, we have to use cluster
 message to notify all the nodes in the clustered environment to delete
 the map entry.  Then we have to give a public method in *JDBCTenantManger* to
 delete the entry which is accessible from the *execute* method of the
 cluster message.

 listed below the summary of the implementation.

 1. Create a new public method in *JDBCTenantManger *to delete the map
 entry.
 2. Create a new class which extends ClusteringMessage and implements
 Serializable.
 3. Implement the *execute* method on above class to perform the delete
 map entry method inside the *JDBCTenantManger.*
 4. When execute the deleteTenant method in *TenantMgtAdminService, *create
 a object from new Cluster Message class created in #2 and set the tenantId
 as a property and send to all nodes in the cluster.
 5. Nodes will receive the above message, deserialize it and perform the
 execute method of the cluster message, which will delete the map entry in
 each nodes.


 Please give a feedback on this.


 Thanks
 Godwin















 On Mon, Sep 8, 2014 at 10:07 AM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi All,

 Thanks for the valuable responses, As I understood we have to use cluster
 messages(Which I need to study more) to delete the map entry in each nodes
 in clustered environment.
 @Danushka: Yes we can use the existing deleteTenant method in
 *JDBCTenantManger*.

 Thanks
 Godwin


 On Sun, Sep 7, 2014 at 9:59 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi

 On Sun, Sep 7, 2014 at 6:59 PM, Johann Nallathamby joh...@wso2.com
 wrote:




 On Sun, Sep 7, 2014 at 6:29 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi
 To the first most problem raised by Goodwin, AFAIU when you call
 tenant deletion you call deleteTenant in TenantManager. So why cant you
 clear the tenant from the map in JDBCTenantManger's deleteTenant method?


 Yes. Should be able to do that. But as Shankar explained we need to
 send cluster messages to do the same in all the nodes.

 Yes I also agree to that point. +1.


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Sat, Sep 6, 2014 at 8:20 PM, Nirmal Fernando nir...@wso2.com
 wrote:

 Shouldn't this tenant event listener be triggered in all the nodes in
 the cluster? If not, I think we might need to fix it.


 On Sat, Sep 6, 2014 at 10:00 AM, Selvaratnam Uthaiyashankar 
 shan...@wso2.com wrote:

 Even if we have public method, how will it work in a clustered
 environment? For example, delete request is sent to Node1, (and lets say
 one way or the other we delete the entry from map on Node1), and create
 request is sent to Node 2 (which still has the entry in the map). Are we
 going to use cluster messages to clear the entry from all nodes?


 On Friday, September 5, 2014, Nirmal Fernando nir...@wso2.com
 wrote:

 I think that should be ok. @Johann wdyt?


 On Fri, Sep 5, 2014 at 8:23 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:

 Hi Nirmal,

 Yes we can do it, But current map doesn't have public access, then
 we need to have a public method inside the *JDBCTenantManager *to
 delete the entry.


 On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com
 wrote:

 Can't we use a tenant event listener and remove the entry from
 the map on a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:

 Hi,

 We are working on tenant deletion implementation, once we
 perform the current tenant deletion operation in
 *TenantMgtAdminService* it deletes registry, user store etc.
 data. But it doesn't allow to create a tenant again with the same 
 tenant
 domain name until restart the server.

 Reason for above situation is tenant domain and id is keeping in
 a map(*tenantDomainIdMap*) inside the *JDBCTenantManager*. When
 perform delete operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory
 data, but this will be costly if it is a frequently perform 
 operation.

 *Solution2*
 We can give a public access to delete the particular key in the
 map, this will be a security issue which people can pass tenant 
 domain and
 perform deletion.

 *Solution3*
 Run a periodic operation which check the availability of the
 tenant in the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: 

Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-07 Thread Danushka Fernando
Hi
To the first most problem raised by Goodwin, AFAIU when you call tenant
deletion you call deleteTenant in TenantManager. So why cant you clear the
tenant from the map in JDBCTenantManger's deleteTenant method?

Thanks  Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729


On Sat, Sep 6, 2014 at 8:20 PM, Nirmal Fernando nir...@wso2.com wrote:

 Shouldn't this tenant event listener be triggered in all the nodes in the
 cluster? If not, I think we might need to fix it.


 On Sat, Sep 6, 2014 at 10:00 AM, Selvaratnam Uthaiyashankar 
 shan...@wso2.com wrote:

 Even if we have public method, how will it work in a clustered
 environment? For example, delete request is sent to Node1, (and lets say
 one way or the other we delete the entry from map on Node1), and create
 request is sent to Node 2 (which still has the entry in the map). Are we
 going to use cluster messages to clear the entry from all nodes?


 On Friday, September 5, 2014, Nirmal Fernando nir...@wso2.com wrote:

 I think that should be ok. @Johann wdyt?


 On Fri, Sep 5, 2014 at 8:23 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi Nirmal,

 Yes we can do it, But current map doesn't have public access, then we
 need to have a public method inside the *JDBCTenantManager *to delete
 the entry.


 On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com
 wrote:

 Can't we use a tenant event listener and remove the entry from the map
 on a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform the
 current tenant deletion operation in *TenantMgtAdminService* it
 deletes registry, user store etc. data. But it doesn't allow to create a
 tenant again with the same tenant domain name until restart the server.

 Reason for above situation is tenant domain and id is keeping in a
 map(*tenantDomainIdMap*) inside the *JDBCTenantManager*. When
 perform delete operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data, but
 this will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the map,
 this will be a security issue which people can pass tenant domain and
 perform deletion.

 *Solution3*
 Run a periodic operation which check the availability of the tenant
 in the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/




 --
 S.Uthaiyashankar
 VP Engineering
 WSO2 Inc.
 http://wso2.com/ - lean . enterprise . middleware

 Phone: +94 714897591


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-07 Thread Johann Nallathamby
On Sun, Sep 7, 2014 at 6:29 PM, Danushka Fernando danush...@wso2.com
wrote:

 Hi
 To the first most problem raised by Goodwin, AFAIU when you call tenant
 deletion you call deleteTenant in TenantManager. So why cant you clear the
 tenant from the map in JDBCTenantManger's deleteTenant method?


Yes. Should be able to do that. But as Shankar explained we need to send
cluster messages to do the same in all the nodes.


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Sat, Sep 6, 2014 at 8:20 PM, Nirmal Fernando nir...@wso2.com wrote:

 Shouldn't this tenant event listener be triggered in all the nodes in the
 cluster? If not, I think we might need to fix it.


 On Sat, Sep 6, 2014 at 10:00 AM, Selvaratnam Uthaiyashankar 
 shan...@wso2.com wrote:

 Even if we have public method, how will it work in a clustered
 environment? For example, delete request is sent to Node1, (and lets say
 one way or the other we delete the entry from map on Node1), and create
 request is sent to Node 2 (which still has the entry in the map). Are we
 going to use cluster messages to clear the entry from all nodes?


 On Friday, September 5, 2014, Nirmal Fernando nir...@wso2.com wrote:

 I think that should be ok. @Johann wdyt?


 On Fri, Sep 5, 2014 at 8:23 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi Nirmal,

 Yes we can do it, But current map doesn't have public access, then we
 need to have a public method inside the *JDBCTenantManager *to delete
 the entry.


 On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com
 wrote:

 Can't we use a tenant event listener and remove the entry from the
 map on a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal god...@wso2.com
  wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform
 the current tenant deletion operation in *TenantMgtAdminService* it
 deletes registry, user store etc. data. But it doesn't allow to create a
 tenant again with the same tenant domain name until restart the server.

 Reason for above situation is tenant domain and id is keeping in a
 map(*tenantDomainIdMap*) inside the *JDBCTenantManager*. When
 perform delete operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data,
 but this will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the map,
 this will be a security issue which people can pass tenant domain and
 perform deletion.

 *Solution3*
 Run a periodic operation which check the availability of the tenant
 in the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/




 --
 S.Uthaiyashankar
 VP Engineering
 WSO2 Inc.
 http://wso2.com/ - lean . enterprise . middleware

 Phone: +94 714897591


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




-- 
Thanks  Regards,

*Johann Dilantha Nallathamby*
Associate Technical 

Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-07 Thread Danushka Fernando
Hi

On Sun, Sep 7, 2014 at 6:59 PM, Johann Nallathamby joh...@wso2.com wrote:




 On Sun, Sep 7, 2014 at 6:29 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi
 To the first most problem raised by Goodwin, AFAIU when you call tenant
 deletion you call deleteTenant in TenantManager. So why cant you clear the
 tenant from the map in JDBCTenantManger's deleteTenant method?


 Yes. Should be able to do that. But as Shankar explained we need to send
 cluster messages to do the same in all the nodes.

Yes I also agree to that point. +1.


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Sat, Sep 6, 2014 at 8:20 PM, Nirmal Fernando nir...@wso2.com wrote:

 Shouldn't this tenant event listener be triggered in all the nodes in
 the cluster? If not, I think we might need to fix it.


 On Sat, Sep 6, 2014 at 10:00 AM, Selvaratnam Uthaiyashankar 
 shan...@wso2.com wrote:

 Even if we have public method, how will it work in a clustered
 environment? For example, delete request is sent to Node1, (and lets say
 one way or the other we delete the entry from map on Node1), and create
 request is sent to Node 2 (which still has the entry in the map). Are we
 going to use cluster messages to clear the entry from all nodes?


 On Friday, September 5, 2014, Nirmal Fernando nir...@wso2.com wrote:

 I think that should be ok. @Johann wdyt?


 On Fri, Sep 5, 2014 at 8:23 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi Nirmal,

 Yes we can do it, But current map doesn't have public access, then we
 need to have a public method inside the *JDBCTenantManager *to
 delete the entry.


 On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com
 wrote:

 Can't we use a tenant event listener and remove the entry from the
 map on a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform
 the current tenant deletion operation in *TenantMgtAdminService*
 it deletes registry, user store etc. data. But it doesn't allow to 
 create a
 tenant again with the same tenant domain name until restart the server.

 Reason for above situation is tenant domain and id is keeping in a
 map(*tenantDomainIdMap*) inside the *JDBCTenantManager*. When
 perform delete operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data,
 but this will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the
 map, this will be a security issue which people can pass tenant domain 
 and
 perform deletion.

 *Solution3*
 Run a periodic operation which check the availability of the tenant
 in the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/




 --
 S.Uthaiyashankar
 VP Engineering
 WSO2 Inc.
 http://wso2.com/ - lean . enterprise . middleware

 Phone: +94 714897591


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



 ___
 Architecture mailing list
 Architecture@wso2.org
 

Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-07 Thread Godwin Amila Shrimal
Hi All,

Thanks for the valuable responses, As I understood we have to use cluster
messages(Which I need to study more) to delete the map entry in each nodes
in clustered environment.
@Danushka: Yes we can use the existing deleteTenant method in
*JDBCTenantManger*.

Thanks
Godwin


On Sun, Sep 7, 2014 at 9:59 PM, Danushka Fernando danush...@wso2.com
wrote:

 Hi

 On Sun, Sep 7, 2014 at 6:59 PM, Johann Nallathamby joh...@wso2.com
 wrote:




 On Sun, Sep 7, 2014 at 6:29 PM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi
 To the first most problem raised by Goodwin, AFAIU when you call tenant
 deletion you call deleteTenant in TenantManager. So why cant you clear the
 tenant from the map in JDBCTenantManger's deleteTenant method?


 Yes. Should be able to do that. But as Shankar explained we need to send
 cluster messages to do the same in all the nodes.

 Yes I also agree to that point. +1.


 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Sat, Sep 6, 2014 at 8:20 PM, Nirmal Fernando nir...@wso2.com wrote:

 Shouldn't this tenant event listener be triggered in all the nodes in
 the cluster? If not, I think we might need to fix it.


 On Sat, Sep 6, 2014 at 10:00 AM, Selvaratnam Uthaiyashankar 
 shan...@wso2.com wrote:

 Even if we have public method, how will it work in a clustered
 environment? For example, delete request is sent to Node1, (and lets say
 one way or the other we delete the entry from map on Node1), and create
 request is sent to Node 2 (which still has the entry in the map). Are we
 going to use cluster messages to clear the entry from all nodes?


 On Friday, September 5, 2014, Nirmal Fernando nir...@wso2.com wrote:

 I think that should be ok. @Johann wdyt?


 On Fri, Sep 5, 2014 at 8:23 PM, Godwin Amila Shrimal god...@wso2.com
  wrote:

 Hi Nirmal,

 Yes we can do it, But current map doesn't have public access, then
 we need to have a public method inside the *JDBCTenantManager *to
 delete the entry.


 On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com
 wrote:

 Can't we use a tenant event listener and remove the entry from the
 map on a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform
 the current tenant deletion operation in *TenantMgtAdminService*
 it deletes registry, user store etc. data. But it doesn't allow to 
 create a
 tenant again with the same tenant domain name until restart the 
 server.

 Reason for above situation is tenant domain and id is keeping in a
 map(*tenantDomainIdMap*) inside the *JDBCTenantManager*. When
 perform delete operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data,
 but this will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the
 map, this will be a security issue which people can pass tenant 
 domain and
 perform deletion.

 *Solution3*
 Run a periodic operation which check the availability of the
 tenant in the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/




 --
 S.Uthaiyashankar
 VP Engineering
 WSO2 Inc.
 http://wso2.com/ - lean . enterprise . middleware

 Phone: +94 714897591


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- 

Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-06 Thread Nirmal Fernando
Shouldn't this tenant event listener be triggered in all the nodes in the
cluster? If not, I think we might need to fix it.


On Sat, Sep 6, 2014 at 10:00 AM, Selvaratnam Uthaiyashankar 
shan...@wso2.com wrote:

 Even if we have public method, how will it work in a clustered
 environment? For example, delete request is sent to Node1, (and lets say
 one way or the other we delete the entry from map on Node1), and create
 request is sent to Node 2 (which still has the entry in the map). Are we
 going to use cluster messages to clear the entry from all nodes?


 On Friday, September 5, 2014, Nirmal Fernando nir...@wso2.com wrote:

 I think that should be ok. @Johann wdyt?


 On Fri, Sep 5, 2014 at 8:23 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi Nirmal,

 Yes we can do it, But current map doesn't have public access, then we
 need to have a public method inside the *JDBCTenantManager *to delete
 the entry.


 On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com wrote:

 Can't we use a tenant event listener and remove the entry from the map
 on a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform the
 current tenant deletion operation in *TenantMgtAdminService* it
 deletes registry, user store etc. data. But it doesn't allow to create a
 tenant again with the same tenant domain name until restart the server.

 Reason for above situation is tenant domain and id is keeping in a map(
 *tenantDomainIdMap*) inside the *JDBCTenantManager*. When perform
 delete operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data, but
 this will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the map,
 this will be a security issue which people can pass tenant domain and
 perform deletion.

 *Solution3*
 Run a periodic operation which check the availability of the tenant in
 the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/




 --
 S.Uthaiyashankar
 VP Engineering
 WSO2 Inc.
 http://wso2.com/ - lean . enterprise . middleware

 Phone: +94 714897591


 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




-- 

Thanks  regards,
Nirmal

Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


[Architecture] Cloud Tenant deletion caching issue

2014-09-05 Thread Godwin Amila Shrimal
Hi,

We are working on tenant deletion implementation, once we perform the
current tenant deletion operation in *TenantMgtAdminService* it deletes
registry, user store etc. data. But it doesn't allow to create a tenant
again with the same tenant domain name until restart the server.

Reason for above situation is tenant domain and id is keeping in a map(
*tenantDomainIdMap*) inside the *JDBCTenantManager*. When perform delete
operation it check the availability from this map.

As per the discussion we can see following solutions for this.

*Solution1*
Check the tenant availability from database not from memory data, but this
will be costly if it is a frequently perform operation.

*Solution2*
We can give a public access to delete the particular key in the map, this
will be a security issue which people can pass tenant domain and perform
deletion.

*Solution3*
Run a periodic operation which check the availability of the tenant in the
database and delete from map which are not exist.


We are looking for a feedback on this.

Thanks
Godwin


-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
twitter: https://twitter.com/godwinamila
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-05 Thread Nirmal Fernando
Can't we use a tenant event listener and remove the entry from the map on a
tenant deletion event?


On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal god...@wso2.com
wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform the
 current tenant deletion operation in *TenantMgtAdminService* it deletes
 registry, user store etc. data. But it doesn't allow to create a tenant
 again with the same tenant domain name until restart the server.

 Reason for above situation is tenant domain and id is keeping in a map(
 *tenantDomainIdMap*) inside the *JDBCTenantManager*. When perform delete
 operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data, but this
 will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the map, this
 will be a security issue which people can pass tenant domain and perform
 deletion.

 *Solution3*
 Run a periodic operation which check the availability of the tenant in the
 database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




-- 

Thanks  regards,
Nirmal

Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-05 Thread Godwin Amila Shrimal
Hi Nirmal,

Yes we can do it, But current map doesn't have public access, then we need
to have a public method inside the *JDBCTenantManager *to delete the entry.


On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com wrote:

 Can't we use a tenant event listener and remove the entry from the map on
 a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform the
 current tenant deletion operation in *TenantMgtAdminService* it deletes
 registry, user store etc. data. But it doesn't allow to create a tenant
 again with the same tenant domain name until restart the server.

 Reason for above situation is tenant domain and id is keeping in a map(
 *tenantDomainIdMap*) inside the *JDBCTenantManager*. When perform delete
 operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data, but
 this will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the map, this
 will be a security issue which people can pass tenant domain and perform
 deletion.

 *Solution3*
 Run a periodic operation which check the availability of the tenant in
 the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
twitter: https://twitter.com/godwinamila
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Cloud Tenant deletion caching issue

2014-09-05 Thread Selvaratnam Uthaiyashankar
Even if we have public method, how will it work in a clustered environment?
For example, delete request is sent to Node1, (and lets say one way or the
other we delete the entry from map on Node1), and create request is sent to
Node 2 (which still has the entry in the map). Are we going to use cluster
messages to clear the entry from all nodes?

On Friday, September 5, 2014, Nirmal Fernando nir...@wso2.com wrote:

 I think that should be ok. @Johann wdyt?


 On Fri, Sep 5, 2014 at 8:23 PM, Godwin Amila Shrimal god...@wso2.com
 javascript:_e(%7B%7D,'cvml','god...@wso2.com'); wrote:

 Hi Nirmal,

 Yes we can do it, But current map doesn't have public access, then we
 need to have a public method inside the *JDBCTenantManager *to delete
 the entry.


 On Fri, Sep 5, 2014 at 8:00 PM, Nirmal Fernando nir...@wso2.com
 javascript:_e(%7B%7D,'cvml','nir...@wso2.com'); wrote:

 Can't we use a tenant event listener and remove the entry from the map
 on a tenant deletion event?


 On Fri, Sep 5, 2014 at 7:50 PM, Godwin Amila Shrimal god...@wso2.com
 javascript:_e(%7B%7D,'cvml','god...@wso2.com'); wrote:

 Hi,

 We are working on tenant deletion implementation, once we perform the
 current tenant deletion operation in *TenantMgtAdminService* it
 deletes registry, user store etc. data. But it doesn't allow to create a
 tenant again with the same tenant domain name until restart the server.

 Reason for above situation is tenant domain and id is keeping in a map(
 *tenantDomainIdMap*) inside the *JDBCTenantManager*. When perform
 delete operation it check the availability from this map.

 As per the discussion we can see following solutions for this.

 *Solution1*
 Check the tenant availability from database not from memory data, but
 this will be costly if it is a frequently perform operation.

 *Solution2*
 We can give a public access to delete the particular key in the map,
 this will be a security issue which people can pass tenant domain and
 perform deletion.

 *Solution3*
 Run a periodic operation which check the availability of the tenant in
 the database and delete from map which are not exist.


 We are looking for a feedback on this.

 Thanks
 Godwin


 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 javascript:_e(%7B%7D,'cvml','Architecture@wso2.org');
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/



 ___
 Architecture mailing list
 Architecture@wso2.org
 javascript:_e(%7B%7D,'cvml','Architecture@wso2.org');
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D http://lnkd.in/KUum6D*
 twitter: https://twitter.com/godwinamila

 ___
 Architecture mailing list
 Architecture@wso2.org
 javascript:_e(%7B%7D,'cvml','Architecture@wso2.org');
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




 --

 Thanks  regards,
 Nirmal

 Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
 Mobile: +94715779733
 Blog: http://nirmalfdo.blogspot.com/




-- 
S.Uthaiyashankar
VP Engineering
WSO2 Inc.
http://wso2.com/ - lean . enterprise . middleware

Phone: +94 714897591
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] [Cloud] Tenant deletion

2014-08-25 Thread Amila Maha Arachchi
On Monday, August 25, 2014, Dimuthu Leelarathne dimut...@wso2.com wrote:

 Hi Amila,

 You are only repeating what I have said in my previous mail.


Well... That only contained a solution for a standalone product. To make
this working for both standalone product and a distributed deployment we
had to discuss for two hours and the missing pieces in your mail can be
found in my one.

Intention of my mail was to provide the final summary for others
information.


 thanks,
 dimuthu


 On Mon, Aug 25, 2014 at 7:22 PM, Amila Maha Arachchi ami...@wso2.com
 javascript:_e(%7B%7D,'cvml','ami...@wso2.com'); wrote:

 Following is the finally agreed approach.

 1. TenantMgtListener will have a preDelete() method.
 2. deleteTenant() of TenantMgtAdminService will notify the listeners at
 the beginning.
 3. We need to set a flag whether to completely remove the tenant or not
 (i.e. delete from registry and LDAP). If this flag is set to true,
 deleteTenant() remove the tenant completely. If not, it will just invoke
 the listeners and return.

 With 1,2,3, any standalone product will be able to support tenant
 deletion properly and it will be product teams' responsibility to cleanup
 everything properly by implementing the preDelete() method.

 But, for a distributed deployment such as WSO2 Cloud, we need to
 coordinate with multiple clouds and, iff all the clouds has done the
 cleanup only, we can delete the tenant permanently. For this, we will be
 writing a BPEL which will invoke the deleteTenant() of the available clouds
 (i.e. AF and APIM). Both above products will have the previously mentioned
 flag set to false. For the cloud deployment, we'll have a separate carbon
 server with the flag set to true and once its deleteTenant() is invoked,
 tenant will be deleted completely.

 Azeez, we would like to know your feedback too on this.

 Regards,
 Amila.


 On Sat, Aug 23, 2014 at 8:40 PM, Amila Maha Arachchi ami...@wso2.com
 javascript:_e(%7B%7D,'cvml','ami...@wso2.com'); wrote:




 On Sat, Aug 23, 2014 at 3:12 AM, Dimuthu Leelarathne dimut...@wso2.com
 javascript:_e(%7B%7D,'cvml','dimut...@wso2.com'); wrote:




 On Fri, Aug 22, 2014 at 10:01 PM, Godwin Amila Shrimal god...@wso2.com
 javascript:_e(%7B%7D,'cvml','god...@wso2.com'); wrote:


 Hi Amila,


 As per the discussion we had with Dimuthu and AF team. Listed below
 the decision made to implement this.


 1. Add onDelete() and onPreDelete() methods to TenantMgtListener
 interface


 Add the onPreDelete() method to TenantMgtListener interface and call
 that method from the deleteTenant of the TenantMgtService. I don't see the
 point of adding onDelete method to TenantMgtListenter interface currently.


 I see couple of problems with this approach.

 1. Since this involved an interface change, we are going to get trouble
 when using this with existing products in our setup. We'll have to patch
 their tenant.mgt code and all implementations of the listener.
 2. Even if we add the onPreDelete method, it will only execute the
 implementation classes in that jvm only. So, if I call the deleteTenant
 method in AF, it won't affect other products such as SS, Jenkins AS,
 Stratos Manager.  This will end of tenants' bits and pieces remaining in
 other products even after we delete the tenant.

 Do we have a solution for this?






 2. Implement those methods in AppFactoryTenantMgtListener as we
 discussed.

 3. We don’t use any BPEL implementation and use the existing listeners
 to implement this

 4.  Future Cloud products can implement the onDelete() and
 onPreDelete() methods in TenantMgtListener interface



 thanks,
 dimuthu



  Please share your feedback on this.

 Thanks
 Godwin






 On Fri, Aug 22, 2014 at 6:09 PM, Amila Maha Arachchi ami...@wso2.com
 javascript:_e(%7B%7D,'cvml','ami...@wso2.com'); wrote:

 +1 for preOnDelete method. Actually there is a place which has this
 kind of an implementation. Thats the user.core. So, we can learn from it
 and do this implementation.

 BTW,

 Mahesh, can you post what did you agreed online+offline?


 On Fri, Aug 22, 2014 at 4:51 PM, Mahesh Chinthaka mahe...@wso2.com
 javascript:_e(%7B%7D,'cvml','mahe...@wso2.com'); wrote:

 Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
 We will do this with the approach discussed online+offline.


 On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando 
 danush...@wso2.com
 javascript:_e(%7B%7D,'cvml','danush...@wso2.com'); wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have this
 Pre and Post events anywhere in platform. I think that's something we
 should consider about. WDYT?

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne 
 dimut...@wso2.com
 javascript:_e(%7B%7D,'cvml','dimut...@wso2.com'); wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to
 delete it 

Re: [Architecture] [Cloud] Tenant deletion

2014-08-25 Thread Dimuthu Leelarathne
Hi Amila,

It is not a standalone product. Please read my mail carefully, it says what
each product should do. In the offline chat I even said what should
AFTenantMgtListner should contain.

thanks,
dimuthu



On Mon, Aug 25, 2014 at 9:20 PM, Amila Maha Arachchi ami...@wso2.com
wrote:



 On Monday, August 25, 2014, Dimuthu Leelarathne dimut...@wso2.com wrote:

 Hi Amila,

 You are only repeating what I have said in my previous mail.


 Well... That only contained a solution for a standalone product. To make
 this working for both standalone product and a distributed deployment we
 had to discuss for two hours and the missing pieces in your mail can be
 found in my one.

 Intention of my mail was to provide the final summary for others
 information.


 thanks,
 dimuthu


 On Mon, Aug 25, 2014 at 7:22 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:

 Following is the finally agreed approach.

 1. TenantMgtListener will have a preDelete() method.
 2. deleteTenant() of TenantMgtAdminService will notify the listeners at
 the beginning.
 3. We need to set a flag whether to completely remove the tenant or not
 (i.e. delete from registry and LDAP). If this flag is set to true,
 deleteTenant() remove the tenant completely. If not, it will just invoke
 the listeners and return.

 With 1,2,3, any standalone product will be able to support tenant
 deletion properly and it will be product teams' responsibility to cleanup
 everything properly by implementing the preDelete() method.

 But, for a distributed deployment such as WSO2 Cloud, we need to
 coordinate with multiple clouds and, iff all the clouds has done the
 cleanup only, we can delete the tenant permanently. For this, we will be
 writing a BPEL which will invoke the deleteTenant() of the available clouds
 (i.e. AF and APIM). Both above products will have the previously mentioned
 flag set to false. For the cloud deployment, we'll have a separate carbon
 server with the flag set to true and once its deleteTenant() is invoked,
 tenant will be deleted completely.

 Azeez, we would like to know your feedback too on this.

 Regards,
 Amila.


 On Sat, Aug 23, 2014 at 8:40 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:




 On Sat, Aug 23, 2014 at 3:12 AM, Dimuthu Leelarathne dimut...@wso2.com
  wrote:




 On Fri, Aug 22, 2014 at 10:01 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:


 Hi Amila,


 As per the discussion we had with Dimuthu and AF team. Listed below
 the decision made to implement this.


 1. Add onDelete() and onPreDelete() methods to TenantMgtListener
 interface


 Add the onPreDelete() method to TenantMgtListener interface and call
 that method from the deleteTenant of the TenantMgtService. I don't see the
 point of adding onDelete method to TenantMgtListenter interface currently.


 I see couple of problems with this approach.

 1. Since this involved an interface change, we are going to get trouble
 when using this with existing products in our setup. We'll have to patch
 their tenant.mgt code and all implementations of the listener.
 2. Even if we add the onPreDelete method, it will only execute the
 implementation classes in that jvm only. So, if I call the deleteTenant
 method in AF, it won't affect other products such as SS, Jenkins AS,
 Stratos Manager.  This will end of tenants' bits and pieces remaining in
 other products even after we delete the tenant.

 Do we have a solution for this?






 2. Implement those methods in AppFactoryTenantMgtListener as we
 discussed.

 3. We don’t use any BPEL implementation and use the existing
 listeners to implement this

 4.  Future Cloud products can implement the onDelete() and
 onPreDelete() methods in TenantMgtListener interface



 thanks,
 dimuthu



  Please share your feedback on this.

 Thanks
 Godwin






 On Fri, Aug 22, 2014 at 6:09 PM, Amila Maha Arachchi ami...@wso2.com
  wrote:

 +1 for preOnDelete method. Actually there is a place which has this
 kind of an implementation. Thats the user.core. So, we can learn from it
 and do this implementation.

 BTW,

 Mahesh, can you post what did you agreed online+offline?


 On Fri, Aug 22, 2014 at 4:51 PM, Mahesh Chinthaka mahe...@wso2.com
 wrote:

 Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
 We will do this with the approach discussed online+offline.


 On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have
 this Pre and Post events anywhere in platform. I think that's 
 something we
 should consider about. WDYT?

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to
 delete it from all other places. So +1 for the interface that would 
 allow
 different product teams to 

Re: [Architecture] [Cloud] Tenant deletion

2014-08-25 Thread Dimuthu Leelarathne
On Mon, Aug 25, 2014 at 10:31 PM, Amila Maha Arachchi ami...@wso2.com
wrote:



 On Monday, August 25, 2014, Dimuthu Leelarathne dimut...@wso2.com wrote:

 Hi Amila,

 It is not a standalone product. Please read my mail carefully, it says
 what each product should do. In the offline chat I even said what should
 AFTenantMgtListner should contain.


 Right. What you have said works for AF. We, as the cloud, have more
 concerns. What I have summarized is what is going to be implemented and
 works for the entire cloud.


Yes it is a summery.

thanks,
dimuthu



 thanks,
 dimuthu



 On Mon, Aug 25, 2014 at 9:20 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:



 On Monday, August 25, 2014, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Amila,

 You are only repeating what I have said in my previous mail.


 Well... That only contained a solution for a standalone product. To make
 this working for both standalone product and a distributed deployment we
 had to discuss for two hours and the missing pieces in your mail can be
 found in my one.

 Intention of my mail was to provide the final summary for others
 information.


 thanks,
 dimuthu


 On Mon, Aug 25, 2014 at 7:22 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:

 Following is the finally agreed approach.

 1. TenantMgtListener will have a preDelete() method.
 2. deleteTenant() of TenantMgtAdminService will notify the listeners
 at the beginning.
 3. We need to set a flag whether to completely remove the tenant or
 not (i.e. delete from registry and LDAP). If this flag is set to true,
 deleteTenant() remove the tenant completely. If not, it will just invoke
 the listeners and return.

 With 1,2,3, any standalone product will be able to support tenant
 deletion properly and it will be product teams' responsibility to cleanup
 everything properly by implementing the preDelete() method.

 But, for a distributed deployment such as WSO2 Cloud, we need to
 coordinate with multiple clouds and, iff all the clouds has done the
 cleanup only, we can delete the tenant permanently. For this, we will be
 writing a BPEL which will invoke the deleteTenant() of the available 
 clouds
 (i.e. AF and APIM). Both above products will have the previously mentioned
 flag set to false. For the cloud deployment, we'll have a separate carbon
 server with the flag set to true and once its deleteTenant() is invoked,
 tenant will be deleted completely.

 Azeez, we would like to know your feedback too on this.

 Regards,
 Amila.


 On Sat, Aug 23, 2014 at 8:40 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:




 On Sat, Aug 23, 2014 at 3:12 AM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:




 On Fri, Aug 22, 2014 at 10:01 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:


 Hi Amila,


 As per the discussion we had with Dimuthu and AF team. Listed below
 the decision made to implement this.


 1. Add onDelete() and onPreDelete() methods to TenantMgtListener
 interface


 Add the onPreDelete() method to TenantMgtListener interface and call
 that method from the deleteTenant of the TenantMgtService. I don't see 
 the
 point of adding onDelete method to TenantMgtListenter interface 
 currently.


 I see couple of problems with this approach.

 1. Since this involved an interface change, we are going to get
 trouble when using this with existing products in our setup. We'll have 
 to
 patch their tenant.mgt code and all implementations of the listener.
 2. Even if we add the onPreDelete method, it will only execute the
 implementation classes in that jvm only. So, if I call the deleteTenant
 method in AF, it won't affect other products such as SS, Jenkins AS,
 Stratos Manager.  This will end of tenants' bits and pieces remaining in
 other products even after we delete the tenant.

 Do we have a solution for this?






 2. Implement those methods in AppFactoryTenantMgtListener as we
 discussed.

 3. We don’t use any BPEL implementation and use the existing
 listeners to implement this

 4.  Future Cloud products can implement the onDelete() and
 onPreDelete() methods in TenantMgtListener interface



 thanks,
 dimuthu



  Please share your feedback on this.

 Thanks
 Godwin






 On Fri, Aug 22, 2014 at 6:09 PM, Amila Maha Arachchi 
 ami...@wso2.com wrote:

 +1 for preOnDelete method. Actually there is a place which has
 this kind of an implementation. Thats the user.core. So, we can learn 
 from
 it and do this implementation.

 BTW,

 Mahesh, can you post what did you agreed online+offline?


 On Fri, Aug 22, 2014 at 4:51 PM, Mahesh Chinthaka 
 mahe...@wso2.com wrote:

 Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
 We will do this with the approach discussed online+offline.


 On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have
 this Pre and Post events anywhere in platform. I think that's 
 something we
 should consider about. WDYT?

 Thanks  Regards
 Danushka Fernando

Re: [Architecture] [Cloud] Tenant deletion

2014-08-25 Thread Dimuthu Leelarathne
Hi Amila,

I have said what will work for the platform. AF as a solution should
implement what is given out of the platform. It is a matter of writing the
reverse of the Tenant creation BPEL. AF is not a standalone product but
meant to be deployed in a distributed manner. One cannot think of AF in
un-distributed manner.

You have given a nice summery of everything.

thanks,
dimuthu



On Mon, Aug 25, 2014 at 10:34 PM, Dimuthu Leelarathne dimut...@wso2.com
wrote:




 On Mon, Aug 25, 2014 at 10:31 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:



 On Monday, August 25, 2014, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Amila,

 It is not a standalone product. Please read my mail carefully, it says
 what each product should do. In the offline chat I even said what should
 AFTenantMgtListner should contain.


 Right. What you have said works for AF. We, as the cloud, have more
 concerns. What I have summarized is what is going to be implemented and
 works for the entire cloud.


 Yes it is a summery.

 thanks,
 dimuthu



 thanks,
 dimuthu



 On Mon, Aug 25, 2014 at 9:20 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:



 On Monday, August 25, 2014, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Amila,

 You are only repeating what I have said in my previous mail.


 Well... That only contained a solution for a standalone product. To
 make this working for both standalone product and a distributed
 deployment we had to discuss for two hours and the missing pieces in your
 mail can be found in my one.

 Intention of my mail was to provide the final summary for others
 information.


 thanks,
 dimuthu


 On Mon, Aug 25, 2014 at 7:22 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:

 Following is the finally agreed approach.

 1. TenantMgtListener will have a preDelete() method.
 2. deleteTenant() of TenantMgtAdminService will notify the listeners
 at the beginning.
 3. We need to set a flag whether to completely remove the tenant or
 not (i.e. delete from registry and LDAP). If this flag is set to true,
 deleteTenant() remove the tenant completely. If not, it will just invoke
 the listeners and return.

 With 1,2,3, any standalone product will be able to support tenant
 deletion properly and it will be product teams' responsibility to cleanup
 everything properly by implementing the preDelete() method.

 But, for a distributed deployment such as WSO2 Cloud, we need to
 coordinate with multiple clouds and, iff all the clouds has done the
 cleanup only, we can delete the tenant permanently. For this, we will be
 writing a BPEL which will invoke the deleteTenant() of the available 
 clouds
 (i.e. AF and APIM). Both above products will have the previously 
 mentioned
 flag set to false. For the cloud deployment, we'll have a separate carbon
 server with the flag set to true and once its deleteTenant() is invoked,
 tenant will be deleted completely.

 Azeez, we would like to know your feedback too on this.

 Regards,
 Amila.


 On Sat, Aug 23, 2014 at 8:40 PM, Amila Maha Arachchi ami...@wso2.com
  wrote:




 On Sat, Aug 23, 2014 at 3:12 AM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:




 On Fri, Aug 22, 2014 at 10:01 PM, Godwin Amila Shrimal 
 god...@wso2.com wrote:


 Hi Amila,


 As per the discussion we had with Dimuthu and AF team. Listed
 below the decision made to implement this.


 1. Add onDelete() and onPreDelete() methods to TenantMgtListener
 interface


 Add the onPreDelete() method to TenantMgtListener interface and
 call that method from the deleteTenant of the TenantMgtService. I 
 don't see
 the point of adding onDelete method to TenantMgtListenter interface
 currently.


 I see couple of problems with this approach.

 1. Since this involved an interface change, we are going to get
 trouble when using this with existing products in our setup. We'll have 
 to
 patch their tenant.mgt code and all implementations of the listener.
 2. Even if we add the onPreDelete method, it will only execute the
 implementation classes in that jvm only. So, if I call the deleteTenant
 method in AF, it won't affect other products such as SS, Jenkins AS,
 Stratos Manager.  This will end of tenants' bits and pieces remaining in
 other products even after we delete the tenant.

 Do we have a solution for this?






 2. Implement those methods in AppFactoryTenantMgtListener as we
 discussed.

 3. We don’t use any BPEL implementation and use the existing
 listeners to implement this

 4.  Future Cloud products can implement the onDelete() and
 onPreDelete() methods in TenantMgtListener interface



 thanks,
 dimuthu



  Please share your feedback on this.

 Thanks
 Godwin






 On Fri, Aug 22, 2014 at 6:09 PM, Amila Maha Arachchi 
 ami...@wso2.com wrote:

 +1 for preOnDelete method. Actually there is a place which has
 this kind of an implementation. Thats the user.core. So, we can 
 learn from
 it and do this implementation.

 BTW,

 Mahesh, can you post what did you agreed online+offline?


 On Fri, Aug 

Re: [Architecture] [Cloud] Tenant deletion

2014-08-23 Thread Amila Maha Arachchi
On Sat, Aug 23, 2014 at 3:12 AM, Dimuthu Leelarathne dimut...@wso2.com
wrote:




 On Fri, Aug 22, 2014 at 10:01 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:


 Hi Amila,


 As per the discussion we had with Dimuthu and AF team. Listed below the
 decision made to implement this.


 1. Add onDelete() and onPreDelete() methods to TenantMgtListener interface


 Add the onPreDelete() method to TenantMgtListener interface and call that
 method from the deleteTenant of the TenantMgtService. I don't see the point
 of adding onDelete method to TenantMgtListenter interface currently.


I see couple of problems with this approach.

1. Since this involved an interface change, we are going to get trouble
when using this with existing products in our setup. We'll have to patch
their tenant.mgt code and all implementations of the listener.
2. Even if we add the onPreDelete method, it will only execute the
implementation classes in that jvm only. So, if I call the deleteTenant
method in AF, it won't affect other products such as SS, Jenkins AS,
Stratos Manager.  This will end of tenants' bits and pieces remaining in
other products even after we delete the tenant.

Do we have a solution for this?






 2. Implement those methods in AppFactoryTenantMgtListener as we discussed.

 3. We don’t use any BPEL implementation and use the existing listeners to
 implement this

 4.  Future Cloud products can implement the onDelete() and onPreDelete()
 methods in TenantMgtListener interface



 thanks,
 dimuthu



  Please share your feedback on this.

 Thanks
 Godwin






 On Fri, Aug 22, 2014 at 6:09 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:

 +1 for preOnDelete method. Actually there is a place which has this kind
 of an implementation. Thats the user.core. So, we can learn from it and do
 this implementation.

 BTW,

 Mahesh, can you post what did you agreed online+offline?


 On Fri, Aug 22, 2014 at 4:51 PM, Mahesh Chinthaka mahe...@wso2.com
 wrote:

 Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
 We will do this with the approach discussed online+offline.


 On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando danush...@wso2.com
  wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have this
 Pre and Post events anywhere in platform. I think that's something we
 should consider about. WDYT?

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to
 delete it from all other places. So +1 for the interface that would allow
 different product teams to clean up their cleanup process, but here is 
 what
 I recommend,

 We need a method call onPreDelete() on TenantMgtListener. This is
 to allow all product teams to implement it. So the first rule of thumb 
 is,
 if any product is moving to cloud they must implement this method and 
 prove
 that they clean up the tenant before they move to WSO2Cloud.

 So basically, in tenant.core what you have to do is call all OSGi
 registered TenantMgtListener's onPreDelete(), and after that delete from
 registry and finally user.core.

 That would be the most elegant and extensible fix for platform.

 Now we come to AF as a product/solution. We have to implement
 onPreDelete() method. So we as a product team should decide whether we 
 are
 going to implement it from BPEL or not. So as a product in order to be
 WSO2Cloud friendly we have to implement onPreDelete() method. From what I
 feel, I believe the way to do is code + BPEL.

 thanks,
 dimuthu


 On Fri, Aug 22, 2014 at 7:26 AM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Fri, Aug 22, 2014 at 5:48 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi Ajanthan
 Problem with OnDelete is it is called after tenant deleted (After
 deleting userstore and registry). But we need to cleanup before that
 otherwise we cannot call admin services since tenant is not there. As 
 per I
 mentioned in the previous thread we need to call this at a OnPreDelete.

 IMO OnDelete method should be called as first step.

 @Mahesh : I think you have missed delete applications step. And
 delete applications step would Issue tracker details as well I guess. @
 Ajanthan : Correct me if I am wrong.

 Looping through each applications and deleting will not be a salable
 solution.

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Thu, Aug 21, 2014 at 8:46 PM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Thu, Aug 21, 2014 at 8:24 PM, Mahesh Chinthaka 
 mahe...@wso2.com wrote:

 Hi Everyone,


 We are working on the Training Project -[Cloud] Tenant deletion
 code/script for cloud - https://redmine.wso2.com/issues/3121.
 Listed below the  workflow of the tenant deletion process in the App 
 

Re: [Architecture] [Cloud] Tenant deletion

2014-08-23 Thread Kasun Gajasinghe
Hi,

Curious to know couple of things..

Will this be available for stand-alone products as well? tenant-deletion is
a requirement for stand-alone products as well, so it would be good if this
is available in stand-alone products as well.

Where will the development happen? For Carbon trunk, the tenant-mgt code
can be found here [1] and the tenant-mgt code is no longer available in
Stratos. Will you also be using the trunk?

[1]
https://github.com/wso2/carbon-multitenancy/tree/master/components/tenant-mgt

Thanks,
KasunG


On Sat, Aug 23, 2014 at 8:40 PM, Amila Maha Arachchi ami...@wso2.com
wrote:




 On Sat, Aug 23, 2014 at 3:12 AM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:




 On Fri, Aug 22, 2014 at 10:01 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:


 Hi Amila,


 As per the discussion we had with Dimuthu and AF team. Listed below the
 decision made to implement this.


 1. Add onDelete() and onPreDelete() methods to TenantMgtListener
 interface


 Add the onPreDelete() method to TenantMgtListener interface and call that
 method from the deleteTenant of the TenantMgtService. I don't see the point
 of adding onDelete method to TenantMgtListenter interface currently.


 I see couple of problems with this approach.

 1. Since this involved an interface change, we are going to get trouble
 when using this with existing products in our setup. We'll have to patch
 their tenant.mgt code and all implementations of the listener.
 2. Even if we add the onPreDelete method, it will only execute the
 implementation classes in that jvm only. So, if I call the deleteTenant
 method in AF, it won't affect other products such as SS, Jenkins AS,
 Stratos Manager.  This will end of tenants' bits and pieces remaining in
 other products even after we delete the tenant.

 Do we have a solution for this?






 2. Implement those methods in AppFactoryTenantMgtListener as we discussed.

 3. We don’t use any BPEL implementation and use the existing listeners
 to implement this

 4.  Future Cloud products can implement the onDelete() and onPreDelete()
 methods in TenantMgtListener interface



 thanks,
 dimuthu



  Please share your feedback on this.

 Thanks
 Godwin






 On Fri, Aug 22, 2014 at 6:09 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:

 +1 for preOnDelete method. Actually there is a place which has this
 kind of an implementation. Thats the user.core. So, we can learn from it
 and do this implementation.

 BTW,

 Mahesh, can you post what did you agreed online+offline?


 On Fri, Aug 22, 2014 at 4:51 PM, Mahesh Chinthaka mahe...@wso2.com
 wrote:

 Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
 We will do this with the approach discussed online+offline.


 On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have this
 Pre and Post events anywhere in platform. I think that's something we
 should consider about. WDYT?

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to
 delete it from all other places. So +1 for the interface that would 
 allow
 different product teams to clean up their cleanup process, but here is 
 what
 I recommend,

 We need a method call onPreDelete() on TenantMgtListener. This is
 to allow all product teams to implement it. So the first rule of thumb 
 is,
 if any product is moving to cloud they must implement this method and 
 prove
 that they clean up the tenant before they move to WSO2Cloud.

 So basically, in tenant.core what you have to do is call all OSGi
 registered TenantMgtListener's onPreDelete(), and after that delete from
 registry and finally user.core.

 That would be the most elegant and extensible fix for platform.

 Now we come to AF as a product/solution. We have to implement
 onPreDelete() method. So we as a product team should decide whether we 
 are
 going to implement it from BPEL or not. So as a product in order to be
 WSO2Cloud friendly we have to implement onPreDelete() method. From what 
 I
 feel, I believe the way to do is code + BPEL.

 thanks,
 dimuthu


 On Fri, Aug 22, 2014 at 7:26 AM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Fri, Aug 22, 2014 at 5:48 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi Ajanthan
 Problem with OnDelete is it is called after tenant deleted (After
 deleting userstore and registry). But we need to cleanup before that
 otherwise we cannot call admin services since tenant is not there. As 
 per I
 mentioned in the previous thread we need to call this at a 
 OnPreDelete.

 IMO OnDelete method should be called as first step.

 @Mahesh : I think you have missed delete applications step. And
 delete applications step would Issue tracker details as 

Re: [Architecture] [Cloud] Tenant deletion

2014-08-23 Thread Amila Maha Arachchi
This is definitely going to be available for standalone products :)

At the moment our target is Cloud deployment. i.e. 4.2.0 products. But,
this will definitely added to trunk.


On Sat, Aug 23, 2014 at 9:01 PM, Kasun Gajasinghe kas...@wso2.com wrote:

 Hi,

 Curious to know couple of things..

 Will this be available for stand-alone products as well? tenant-deletion
 is a requirement for stand-alone products as well, so it would be good if
 this is available in stand-alone products as well.

 Where will the development happen? For Carbon trunk, the tenant-mgt code
 can be found here [1] and the tenant-mgt code is no longer available in
 Stratos. Will you also be using the trunk?

 [1]
 https://github.com/wso2/carbon-multitenancy/tree/master/components/tenant-mgt

 Thanks,
 KasunG


 On Sat, Aug 23, 2014 at 8:40 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:




 On Sat, Aug 23, 2014 at 3:12 AM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:




 On Fri, Aug 22, 2014 at 10:01 PM, Godwin Amila Shrimal god...@wso2.com
 wrote:


 Hi Amila,


 As per the discussion we had with Dimuthu and AF team. Listed below the
 decision made to implement this.


 1. Add onDelete() and onPreDelete() methods to TenantMgtListener
 interface


 Add the onPreDelete() method to TenantMgtListener interface and call
 that method from the deleteTenant of the TenantMgtService. I don't see the
 point of adding onDelete method to TenantMgtListenter interface currently.


 I see couple of problems with this approach.

 1. Since this involved an interface change, we are going to get trouble
 when using this with existing products in our setup. We'll have to patch
 their tenant.mgt code and all implementations of the listener.
 2. Even if we add the onPreDelete method, it will only execute the
 implementation classes in that jvm only. So, if I call the deleteTenant
 method in AF, it won't affect other products such as SS, Jenkins AS,
 Stratos Manager.  This will end of tenants' bits and pieces remaining in
 other products even after we delete the tenant.

 Do we have a solution for this?






 2. Implement those methods in AppFactoryTenantMgtListener as we
 discussed.

 3. We don’t use any BPEL implementation and use the existing listeners
 to implement this

 4.  Future Cloud products can implement the onDelete() and
 onPreDelete() methods in TenantMgtListener interface



 thanks,
 dimuthu



  Please share your feedback on this.

 Thanks
 Godwin






 On Fri, Aug 22, 2014 at 6:09 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:

 +1 for preOnDelete method. Actually there is a place which has this
 kind of an implementation. Thats the user.core. So, we can learn from it
 and do this implementation.

 BTW,

 Mahesh, can you post what did you agreed online+offline?


 On Fri, Aug 22, 2014 at 4:51 PM, Mahesh Chinthaka mahe...@wso2.com
 wrote:

 Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
 We will do this with the approach discussed online+offline.


 On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have this
 Pre and Post events anywhere in platform. I think that's something we
 should consider about. WDYT?

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to
 delete it from all other places. So +1 for the interface that would 
 allow
 different product teams to clean up their cleanup process, but here is 
 what
 I recommend,

 We need a method call onPreDelete() on TenantMgtListener. This is
 to allow all product teams to implement it. So the first rule of thumb 
 is,
 if any product is moving to cloud they must implement this method and 
 prove
 that they clean up the tenant before they move to WSO2Cloud.

 So basically, in tenant.core what you have to do is call all OSGi
 registered TenantMgtListener's onPreDelete(), and after that delete 
 from
 registry and finally user.core.

 That would be the most elegant and extensible fix for platform.

 Now we come to AF as a product/solution. We have to implement
 onPreDelete() method. So we as a product team should decide whether we 
 are
 going to implement it from BPEL or not. So as a product in order to be
 WSO2Cloud friendly we have to implement onPreDelete() method. From 
 what I
 feel, I believe the way to do is code + BPEL.

 thanks,
 dimuthu


 On Fri, Aug 22, 2014 at 7:26 AM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Fri, Aug 22, 2014 at 5:48 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi Ajanthan
 Problem with OnDelete is it is called after tenant deleted (After
 deleting userstore and registry). But we need to cleanup before that
 otherwise we cannot call admin services since tenant is not 

Re: [Architecture] [Cloud] Tenant deletion

2014-08-23 Thread Kasun Gajasinghe
Good to know.. Thanks. :)


On Sat, Aug 23, 2014 at 9:04 PM, Amila Maha Arachchi ami...@wso2.com
wrote:

 This is definitely going to be available for standalone products :)

 At the moment our target is Cloud deployment. i.e. 4.2.0 products. But,
 this will definitely added to trunk.


 On Sat, Aug 23, 2014 at 9:01 PM, Kasun Gajasinghe kas...@wso2.com wrote:

 Hi,

 Curious to know couple of things..

 Will this be available for stand-alone products as well? tenant-deletion
 is a requirement for stand-alone products as well, so it would be good if
 this is available in stand-alone products as well.

 Where will the development happen? For Carbon trunk, the tenant-mgt code
 can be found here [1] and the tenant-mgt code is no longer available in
 Stratos. Will you also be using the trunk?

 [1]
 https://github.com/wso2/carbon-multitenancy/tree/master/components/tenant-mgt

 Thanks,
 KasunG


 On Sat, Aug 23, 2014 at 8:40 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:




 On Sat, Aug 23, 2014 at 3:12 AM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:




 On Fri, Aug 22, 2014 at 10:01 PM, Godwin Amila Shrimal god...@wso2.com
  wrote:


 Hi Amila,


 As per the discussion we had with Dimuthu and AF team. Listed below
 the decision made to implement this.


 1. Add onDelete() and onPreDelete() methods to TenantMgtListener
 interface


 Add the onPreDelete() method to TenantMgtListener interface and call
 that method from the deleteTenant of the TenantMgtService. I don't see the
 point of adding onDelete method to TenantMgtListenter interface currently.


 I see couple of problems with this approach.

 1. Since this involved an interface change, we are going to get trouble
 when using this with existing products in our setup. We'll have to patch
 their tenant.mgt code and all implementations of the listener.
 2. Even if we add the onPreDelete method, it will only execute the
 implementation classes in that jvm only. So, if I call the deleteTenant
 method in AF, it won't affect other products such as SS, Jenkins AS,
 Stratos Manager.  This will end of tenants' bits and pieces remaining in
 other products even after we delete the tenant.

 Do we have a solution for this?






 2. Implement those methods in AppFactoryTenantMgtListener as we
 discussed.

 3. We don’t use any BPEL implementation and use the existing listeners
 to implement this

 4.  Future Cloud products can implement the onDelete() and
 onPreDelete() methods in TenantMgtListener interface



 thanks,
 dimuthu



  Please share your feedback on this.

 Thanks
 Godwin






 On Fri, Aug 22, 2014 at 6:09 PM, Amila Maha Arachchi ami...@wso2.com
 wrote:

 +1 for preOnDelete method. Actually there is a place which has this
 kind of an implementation. Thats the user.core. So, we can learn from it
 and do this implementation.

 BTW,

 Mahesh, can you post what did you agreed online+offline?


 On Fri, Aug 22, 2014 at 4:51 PM, Mahesh Chinthaka mahe...@wso2.com
 wrote:

 Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
 We will do this with the approach discussed online+offline.


 On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have this
 Pre and Post events anywhere in platform. I think that's something we
 should consider about. WDYT?

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne 
 dimut...@wso2.com wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to
 delete it from all other places. So +1 for the interface that would 
 allow
 different product teams to clean up their cleanup process, but here 
 is what
 I recommend,

 We need a method call onPreDelete() on TenantMgtListener. This
 is to allow all product teams to implement it. So the first rule of 
 thumb
 is, if any product is moving to cloud they must implement this method 
 and
 prove that they clean up the tenant before they move to WSO2Cloud.

 So basically, in tenant.core what you have to do is call all OSGi
 registered TenantMgtListener's onPreDelete(), and after that delete 
 from
 registry and finally user.core.

 That would be the most elegant and extensible fix for platform.

 Now we come to AF as a product/solution. We have to implement
 onPreDelete() method. So we as a product team should decide whether 
 we are
 going to implement it from BPEL or not. So as a product in order to be
 WSO2Cloud friendly we have to implement onPreDelete() method. From 
 what I
 feel, I believe the way to do is code + BPEL.

 thanks,
 dimuthu


 On Fri, Aug 22, 2014 at 7:26 AM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Fri, Aug 22, 2014 at 5:48 AM, Danushka Fernando 
 danush...@wso2.com wrote:

 Hi Ajanthan
 Problem with OnDelete is it is called after tenant deleted
 (After deleting userstore 

Re: [Architecture] [Cloud] Tenant deletion

2014-08-22 Thread Mahesh Chinthaka
Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
We will do this with the approach discussed online+offline.


On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando danush...@wso2.com
wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have this Pre
 and Post events anywhere in platform. I think that's something we should
 consider about. WDYT?

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to delete it
 from all other places. So +1 for the interface that would allow different
 product teams to clean up their cleanup process, but here is what I
 recommend,

 We need a method call onPreDelete() on TenantMgtListener. This is to
 allow all product teams to implement it. So the first rule of thumb is, if
 any product is moving to cloud they must implement this method and prove
 that they clean up the tenant before they move to WSO2Cloud.

 So basically, in tenant.core what you have to do is call all OSGi
 registered TenantMgtListener's onPreDelete(), and after that delete from
 registry and finally user.core.

 That would be the most elegant and extensible fix for platform.

 Now we come to AF as a product/solution. We have to implement
 onPreDelete() method. So we as a product team should decide whether we are
 going to implement it from BPEL or not. So as a product in order to be
 WSO2Cloud friendly we have to implement onPreDelete() method. From what I
 feel, I believe the way to do is code + BPEL.

 thanks,
 dimuthu


 On Fri, Aug 22, 2014 at 7:26 AM, Ajanthan Balachandran ajant...@wso2.com
  wrote:




 On Fri, Aug 22, 2014 at 5:48 AM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi Ajanthan
 Problem with OnDelete is it is called after tenant deleted (After
 deleting userstore and registry). But we need to cleanup before that
 otherwise we cannot call admin services since tenant is not there. As per I
 mentioned in the previous thread we need to call this at a OnPreDelete.

 IMO OnDelete method should be called as first step.

 @Mahesh : I think you have missed delete applications step. And delete
 applications step would Issue tracker details as well I guess. @ Ajanthan :
 Correct me if I am wrong.

 Looping through each applications and deleting will not be a salable
 solution.

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Thu, Aug 21, 2014 at 8:46 PM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Thu, Aug 21, 2014 at 8:24 PM, Mahesh Chinthaka mahe...@wso2.com
 wrote:

 Hi Everyone,


 We are working on the Training Project -[Cloud] Tenant deletion
 code/script for cloud - https://redmine.wso2.com/issues/3121. Listed
 below the  workflow of the tenant deletion process in the App Cloud as we
 identified.

 1. Undeploy Jenkins web app from application server

 2. Delete Git repository (use gitblit api to delete repo in Git)

 3. Unsubscribe Stratos using Stratos Rest Services

 4. Check database created by RSSAdmin and delete them

 5. Perform TenantMgtAdminService deleteTenant operation

-

i. Delete Billing data
ii. Delete Tenant Registration Data (Ex. REG_CLUSTER_LOCK,
REG_LOG)
iii. Delete Tenant User management data (Ex. UM_USER_PERMISSION,
UM_USER)
iv. Remove Tenant information from cache
v. Delete UM_TENANT table



 Don't you need to cleanup issue tracker?

 As per the analysis there are two solutions we have identified to
 implement this , such as BPEL and Carbon Component. We thought of going 
 for
 a *carbon component* implementation rather than using a* BPEL* due
 to following reasons.

 1. Plugging a Carbon Component will give more extensibility to
 implement Tenant Deletion operation in future Cloud base products

 2. If we used a BPEL we will have to reconstruct at each time when we
 meet a new requirement (ex: esb cloud integration).


 Proposed Solution

 Why can't you use existing TenantMgtListener and add onDelete
 method.It also has ListenerOrder and every implementation should be
 registered as OSGI service.


 1. Create an abstraction for delete operation

  public interface TenantDeletion{

  public void onDeletion();

 }

 2. Implement TenantDeletion for each operations

 public class JenkinsAppUndeployer implements TenantDeletion{

 public void onDeletion(){

  //Implementation of the JenkinsApp undeploy process

 }

 }

 3. Use a configuration file to maintain the execution order which
 help to dynamically add new requirement

 ExecutionOrder

class name=”org.wso2.cloud.tenant.JenkinsAppUndeployer”/class

class name=”org.wso2.cloud.tenant.GitRepoRemover”/class

class name=”org.wso2.cloud.tenant.XX”/class

 /ExecutionOrder


 We are looking for a feedback on this to 

Re: [Architecture] [Cloud] Tenant deletion

2014-08-22 Thread Amila Maha Arachchi
+1 for preOnDelete method. Actually there is a place which has this kind of
an implementation. Thats the user.core. So, we can learn from it and do
this implementation.

BTW,

Mahesh, can you post what did you agreed online+offline?


On Fri, Aug 22, 2014 at 4:51 PM, Mahesh Chinthaka mahe...@wso2.com wrote:

 Thanks Dimuthu, Danushka  Ajanthan  for your feedback.
 We will do this with the approach discussed online+offline.


 On Fri, Aug 22, 2014 at 10:59 AM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi
 +1 for the OnPreDelete concept. But the thing is we don't have this Pre
 and Post events anywhere in platform. I think that's something we should
 consider about. WDYT?

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne dimut...@wso2.com
 wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to delete
 it from all other places. So +1 for the interface that would allow
 different product teams to clean up their cleanup process, but here is what
 I recommend,

 We need a method call onPreDelete() on TenantMgtListener. This is to
 allow all product teams to implement it. So the first rule of thumb is, if
 any product is moving to cloud they must implement this method and prove
 that they clean up the tenant before they move to WSO2Cloud.

 So basically, in tenant.core what you have to do is call all OSGi
 registered TenantMgtListener's onPreDelete(), and after that delete from
 registry and finally user.core.

 That would be the most elegant and extensible fix for platform.

 Now we come to AF as a product/solution. We have to implement
 onPreDelete() method. So we as a product team should decide whether we are
 going to implement it from BPEL or not. So as a product in order to be
 WSO2Cloud friendly we have to implement onPreDelete() method. From what I
 feel, I believe the way to do is code + BPEL.

 thanks,
 dimuthu


 On Fri, Aug 22, 2014 at 7:26 AM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Fri, Aug 22, 2014 at 5:48 AM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi Ajanthan
 Problem with OnDelete is it is called after tenant deleted (After
 deleting userstore and registry). But we need to cleanup before that
 otherwise we cannot call admin services since tenant is not there. As per 
 I
 mentioned in the previous thread we need to call this at a OnPreDelete.

 IMO OnDelete method should be called as first step.

 @Mahesh : I think you have missed delete applications step. And delete
 applications step would Issue tracker details as well I guess. @ Ajanthan 
 :
 Correct me if I am wrong.

 Looping through each applications and deleting will not be a salable
 solution.

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Thu, Aug 21, 2014 at 8:46 PM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Thu, Aug 21, 2014 at 8:24 PM, Mahesh Chinthaka mahe...@wso2.com
 wrote:

 Hi Everyone,


 We are working on the Training Project -[Cloud] Tenant deletion
 code/script for cloud - https://redmine.wso2.com/issues/3121.
 Listed below the  workflow of the tenant deletion process in the App 
 Cloud
 as we identified.

 1. Undeploy Jenkins web app from application server

 2. Delete Git repository (use gitblit api to delete repo in Git)

 3. Unsubscribe Stratos using Stratos Rest Services

 4. Check database created by RSSAdmin and delete them

 5. Perform TenantMgtAdminService deleteTenant operation

-

i. Delete Billing data
ii. Delete Tenant Registration Data (Ex. REG_CLUSTER_LOCK,
REG_LOG)
iii. Delete Tenant User management data (Ex. UM_USER_PERMISSION,
UM_USER)
iv. Remove Tenant information from cache
v. Delete UM_TENANT table



 Don't you need to cleanup issue tracker?

 As per the analysis there are two solutions we have identified to
 implement this , such as BPEL and Carbon Component. We thought of going 
 for
 a *carbon component* implementation rather than using a* BPEL* due
 to following reasons.

 1. Plugging a Carbon Component will give more extensibility to
 implement Tenant Deletion operation in future Cloud base products

 2. If we used a BPEL we will have to reconstruct at each time when
 we meet a new requirement (ex: esb cloud integration).


 Proposed Solution

 Why can't you use existing TenantMgtListener and add onDelete
 method.It also has ListenerOrder and every implementation should be
 registered as OSGI service.


 1. Create an abstraction for delete operation

  public interface TenantDeletion{

  public void onDeletion();

 }

 2. Implement TenantDeletion for each operations

 public class JenkinsAppUndeployer implements TenantDeletion{

 public void onDeletion(){

  //Implementation of the JenkinsApp undeploy process

 }

 }

 3. Use a configuration file to maintain the 

[Architecture] [Cloud] Tenant deletion

2014-08-21 Thread Mahesh Chinthaka
Hi Everyone,


We are working on the Training Project -[Cloud] Tenant deletion code/script
for cloud - https://redmine.wso2.com/issues/3121. Listed below the
 workflow of the tenant deletion process in the App Cloud as we identified.

1. Undeploy Jenkins web app from application server

2. Delete Git repository (use gitblit api to delete repo in Git)

3. Unsubscribe Stratos using Stratos Rest Services

4. Check database created by RSSAdmin and delete them

5. Perform TenantMgtAdminService deleteTenant operation

   -

   i. Delete Billing data
   ii. Delete Tenant Registration Data (Ex. REG_CLUSTER_LOCK, REG_LOG)
   iii. Delete Tenant User management data (Ex. UM_USER_PERMISSION, UM_USER)
   iv. Remove Tenant information from cache
   v. Delete UM_TENANT table



As per the analysis there are two solutions we have identified to implement
this , such as BPEL and Carbon Component. We thought of going for a *carbon
component* implementation rather than using a* BPEL* due to following
reasons.

1. Plugging a Carbon Component will give more extensibility to implement
Tenant Deletion operation in future Cloud base products

2. If we used a BPEL we will have to reconstruct at each time when we meet
a new requirement (ex: esb cloud integration).


Proposed Solution

1. Create an abstraction for delete operation

 public interface TenantDeletion{

 public void onDeletion();

}

2. Implement TenantDeletion for each operations

public class JenkinsAppUndeployer implements TenantDeletion{

public void onDeletion(){

 //Implementation of the JenkinsApp undeploy process

}

}

3. Use a configuration file to maintain the execution order which help to
dynamically add new requirement

ExecutionOrder

   class name=”org.wso2.cloud.tenant.JenkinsAppUndeployer”/class

   class name=”org.wso2.cloud.tenant.GitRepoRemover”/class

   class name=”org.wso2.cloud.tenant.XX”/class

/ExecutionOrder


We are looking for a feedback on this to move forward with selected design.

-- 
Mahesh Chinthaka
Software Engineer , WSO2.

Phone : (+94) 71 63 63 083
Email : mahe...@wso2.com
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] [Cloud] Tenant deletion

2014-08-21 Thread Ajanthan Balachandran
On Thu, Aug 21, 2014 at 8:24 PM, Mahesh Chinthaka mahe...@wso2.com wrote:

 Hi Everyone,


 We are working on the Training Project -[Cloud] Tenant deletion
 code/script for cloud - https://redmine.wso2.com/issues/3121. Listed
 below the  workflow of the tenant deletion process in the App Cloud as we
 identified.

 1. Undeploy Jenkins web app from application server

 2. Delete Git repository (use gitblit api to delete repo in Git)

 3. Unsubscribe Stratos using Stratos Rest Services

 4. Check database created by RSSAdmin and delete them

 5. Perform TenantMgtAdminService deleteTenant operation

-

i. Delete Billing data
ii. Delete Tenant Registration Data (Ex. REG_CLUSTER_LOCK, REG_LOG)
iii. Delete Tenant User management data (Ex. UM_USER_PERMISSION,
UM_USER)
iv. Remove Tenant information from cache
v. Delete UM_TENANT table



 Don't you need to cleanup issue tracker?

 As per the analysis there are two solutions we have identified to
 implement this , such as BPEL and Carbon Component. We thought of going for
 a *carbon component* implementation rather than using a* BPEL* due to
 following reasons.

 1. Plugging a Carbon Component will give more extensibility to implement
 Tenant Deletion operation in future Cloud base products

 2. If we used a BPEL we will have to reconstruct at each time when we meet
 a new requirement (ex: esb cloud integration).


 Proposed Solution

Why can't you use existing TenantMgtListener and add onDelete method.It
also has ListenerOrder and every implementation should be registered as
OSGI service.


 1. Create an abstraction for delete operation

  public interface TenantDeletion{

  public void onDeletion();

 }

 2. Implement TenantDeletion for each operations

 public class JenkinsAppUndeployer implements TenantDeletion{

 public void onDeletion(){

  //Implementation of the JenkinsApp undeploy process

 }

 }

 3. Use a configuration file to maintain the execution order which help to
 dynamically add new requirement

 ExecutionOrder

class name=”org.wso2.cloud.tenant.JenkinsAppUndeployer”/class

class name=”org.wso2.cloud.tenant.GitRepoRemover”/class

class name=”org.wso2.cloud.tenant.XX”/class

 /ExecutionOrder


 We are looking for a feedback on this to move forward with selected design.

 --
 Mahesh Chinthaka
 Software Engineer , WSO2.

 Phone : (+94) 71 63 63 083
 Email : mahe...@wso2.com

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




-- 
ajanthan
-- 
Ajanthan Balachandiran
Senior Software Engineer;
Solutions Technologies Team ;WSO2, Inc.;  http://wso2.com/

email: ajanthan http://goog_595075977@wso2.com; cell: +94775581497
blog: http://bkayts.blogspot.com/

Lean . Enterprise . Middleware
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] [Cloud] Tenant deletion

2014-08-21 Thread Danushka Fernando
Hi
+1 for the OnPreDelete concept. But the thing is we don't have this Pre and
Post events anywhere in platform. I think that's something we should
consider about. WDYT?

Thanks  Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729


On Fri, Aug 22, 2014 at 9:14 AM, Dimuthu Leelarathne dimut...@wso2.com
wrote:

 Hi Mahesh all,

 Lets consider Carbon Platform aspect first.

 Before we remove tenant from user core and registry, we have to delete it
 from all other places. So +1 for the interface that would allow different
 product teams to clean up their cleanup process, but here is what I
 recommend,

 We need a method call onPreDelete() on TenantMgtListener. This is to
 allow all product teams to implement it. So the first rule of thumb is, if
 any product is moving to cloud they must implement this method and prove
 that they clean up the tenant before they move to WSO2Cloud.

 So basically, in tenant.core what you have to do is call all OSGi
 registered TenantMgtListener's onPreDelete(), and after that delete from
 registry and finally user.core.

 That would be the most elegant and extensible fix for platform.

 Now we come to AF as a product/solution. We have to implement
 onPreDelete() method. So we as a product team should decide whether we are
 going to implement it from BPEL or not. So as a product in order to be
 WSO2Cloud friendly we have to implement onPreDelete() method. From what I
 feel, I believe the way to do is code + BPEL.

 thanks,
 dimuthu


 On Fri, Aug 22, 2014 at 7:26 AM, Ajanthan Balachandran ajant...@wso2.com
 wrote:




 On Fri, Aug 22, 2014 at 5:48 AM, Danushka Fernando danush...@wso2.com
 wrote:

 Hi Ajanthan
 Problem with OnDelete is it is called after tenant deleted (After
 deleting userstore and registry). But we need to cleanup before that
 otherwise we cannot call admin services since tenant is not there. As per I
 mentioned in the previous thread we need to call this at a OnPreDelete.

 IMO OnDelete method should be called as first step.

 @Mahesh : I think you have missed delete applications step. And delete
 applications step would Issue tracker details as well I guess. @ Ajanthan :
 Correct me if I am wrong.

 Looping through each applications and deleting will not be a salable
 solution.

 Thanks  Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729


 On Thu, Aug 21, 2014 at 8:46 PM, Ajanthan Balachandran 
 ajant...@wso2.com wrote:




 On Thu, Aug 21, 2014 at 8:24 PM, Mahesh Chinthaka mahe...@wso2.com
 wrote:

 Hi Everyone,


 We are working on the Training Project -[Cloud] Tenant deletion
 code/script for cloud - https://redmine.wso2.com/issues/3121. Listed
 below the  workflow of the tenant deletion process in the App Cloud as we
 identified.

 1. Undeploy Jenkins web app from application server

 2. Delete Git repository (use gitblit api to delete repo in Git)

 3. Unsubscribe Stratos using Stratos Rest Services

 4. Check database created by RSSAdmin and delete them

 5. Perform TenantMgtAdminService deleteTenant operation

-

i. Delete Billing data
ii. Delete Tenant Registration Data (Ex. REG_CLUSTER_LOCK, REG_LOG)
iii. Delete Tenant User management data (Ex. UM_USER_PERMISSION,
UM_USER)
iv. Remove Tenant information from cache
v. Delete UM_TENANT table



 Don't you need to cleanup issue tracker?

 As per the analysis there are two solutions we have identified to
 implement this , such as BPEL and Carbon Component. We thought of going 
 for
 a *carbon component* implementation rather than using a* BPEL* due to
 following reasons.

 1. Plugging a Carbon Component will give more extensibility to
 implement Tenant Deletion operation in future Cloud base products

 2. If we used a BPEL we will have to reconstruct at each time when we
 meet a new requirement (ex: esb cloud integration).


 Proposed Solution

 Why can't you use existing TenantMgtListener and add onDelete
 method.It also has ListenerOrder and every implementation should be
 registered as OSGI service.


 1. Create an abstraction for delete operation

  public interface TenantDeletion{

  public void onDeletion();

 }

 2. Implement TenantDeletion for each operations

 public class JenkinsAppUndeployer implements TenantDeletion{

 public void onDeletion(){

  //Implementation of the JenkinsApp undeploy process

 }

 }

 3. Use a configuration file to maintain the execution order which help
 to dynamically add new requirement

 ExecutionOrder

class name=”org.wso2.cloud.tenant.JenkinsAppUndeployer”/class

class name=”org.wso2.cloud.tenant.GitRepoRemover”/class

class name=”org.wso2.cloud.tenant.XX”/class

 /ExecutionOrder


 We are looking for a feedback on this to move forward with selected
 design.

 --
 Mahesh Chinthaka
 Software Engineer , WSO2.

 Phone : (+94) 71 63 63 083
 Email : mahe...@wso2.com

 ___
 Architecture mailing