AccountStoreMapping interface is misleading as it cannot be instantiated
When we introduced Organizations our DefaultAccountStoreMapping disappeared. Now we have DefaultApplicationAccountStoreMapping and DefaultOrganizationAccountStoreMapping.
This causes the following code to fail: client.instantiate(AccountStoreMapping.class). It was working previously since we had a DefaultAccountStoreMapping but that is not the case any longer.
I did not do enough thinking about this but AccountStoreMapping extends Resource and it is in our API module. Options are:
-
AccountStoreMappingshould not be part of the public API any longer, or -
AccountStoreMappingshould not extendResourceany longer - Create a new
DefaultAccountStoreMappingthat throws and Exception and outputs a message explaining the user what to do - Create a
DefaultAccountStoreMappingwhich can somehow return the proper resource (i.e. either anApplicationAccountStoreMappingor anOrganizationAccountStoreMapping
BTW, our documentation instruct users to do AccountStoreMapping accountStoreMapping = client.instantiate(AccountStoreMapping.class). See here: https://docs.stormpath.com/java/product-guide/#account-store-mappings
Relates to https://github.com/stormpath/stormpath-sdk-java/issues/531
This is still relevant... but the importance is really low as the reference in the documentation is no longer present (since we moved to the one product guide). I keep it open in case we decide to tackle it in the future.