Jaspersoft / jrs-rest-java-client

Java Rest Client for JasperReports Server
GNU Lesser General Public License v3.0
100 stars 101 forks source link

Is there any way which can push requests one time ? #317

Closed peteryuanpan closed 6 years ago

peteryuanpan commented 6 years ago

Hello:

I've found an interesting thing. The most time costs on the process of sending requests and getting requests when using api. That's means, If I have 1000 requests, one way is sending 1000 requests one time and getting one time, another way is sending requests 1000 times and getting 1000 times, the first way is so much faster than the second way. I am using your wonderful api to get permission of each folder and file from jasperserver. However, due to so many folders and files, it costs so much time that I can not bear it. Would you like to tell me, is that any way which can push permission even other requests just one time and get just one time ? PS : I knew that in user and role model. I can do that. And in report model, I can also get so many folders information in one time. But in permission model, I've not found that way.

Thanks for your reply.

yaroslav-kovalchyk commented 6 years ago

Hello, sorry, but I didn't get your question... Could you please clarify what does it mean: "push permission even other requests just one time and get just one time"? Any sample?

peteryuanpan commented 6 years ago

Hello, Sorry for my English. For example. I would like to get permission information of N folders from server. Now, I have two ways to do that. First way, I send a request for one folder to server, and then get a reply from server, and I can the permission information of the folder. After that, I send the second request and get the permission information of the second folder. ...... I repeat the way N times. And I get all information of N folders. Second way, I push the N requests to a ListA and send this list to server and get a reply ListB. From ListB, I can know all information of N folders.

I would like to know, In api, now, is there any way similar to the second way ? Because I know the second way is so much faster than the first way and I need it.

Thanks

yaroslav-kovalchyk commented 6 years ago

Thanks for explanation. Now I understand what do you mean. Unfortunately JasperReports Server doesn't provide such REST API. The best you can get for multiple resources are permission masks. Repository REST service provides a way to search resources and each resource in answer will contain permissionMask, that can give you an information about access rights for particular resource for current user. Nothing more.