I have completed some main methods of Airavata Registry API so far. Now I'm facing a problem with getWorkflow(...) and getWorkflows(...) methods.
The signatures of the methods are as follows.
public Node getWorkflow(QName templateID, String userName)
public Map<QName, Node> getWorkflows(String userName)
As these show, above methods return JCR Node objects. Since current implementation uses JCR API, it knows what JCR node is. But in the new API, jackrabbit is accessed through Sling. So, this new API does not know anything about JCR Nodes. So returning JCR Nodes is not possible. That's the problem I'm facing.
To avoid this problem there are 2 options.
Option 1:
Change method signatures to return something else. I checked some places where these methods are called. What I saw was it only get properties of returned Nodes. So, in my opinion, a Map would be a good option to replace Node. But certainly this will lead to a lot of work in a lot of places. But IMHO, this is exactly what should be done if we think about long term use.
Option 2:
Create a JCR Node an return. Of course this should be a temporary solution. And creating Nodes is not an 100% possible because Node is an interface. Implementing its all methods is not possible. So only required methods can be implemented.
That's the only problem I'm facing now and I'm waiting for an answer from Airavata's side.
No comments:
Post a Comment