My objective is to standardize the access (read/write or both) to data content in data sources like a database (MySQL) or any other content repository that is not by default JSR 170 compliant like Open CMS, live link or share point. By standardizing access I mean that the client program will no longer call the repository specific API like LAPI or JDBC but rather call JCR API methods to achieve common functions like, login, logout, read and write.
I want to write a kind of sample connector for MY SQL database which can be accessed by JCR API rather than JDBC. I understand that in order to do so I need to write a wrapper around JDBC API which will perform the desired operations using JDBC (as My SQL understand JDBC) but for a developer (client java program) the entry point will be JCR API.
I have confusion while writing this wrapper. Consider login method of repository interface of JCR API. I want to actually perform login using select queries from a database using JDBC API but I want to wrap it around with a wrapper class which will expose the login functionality of database by means of JCR API. Thios way developer will be calling login method of JCR API something like:
repository.login (userCredentials, workspaceName);
But internally login will be done using database.