HERAS-AF Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 20, 2012, 10:08:33 am

Login with username, password and session length
Search:     Advanced search
Welcome to the HERAS-AF Forum...
373 Posts in 89 Topics by 272 Members
Latest Member: Jasmine
* Home Help Search Login Register
+  HERAS-AF Forum
|-+  HERAS-AF XACML
| |-+  HERAS-AF XACML Core (Moderators: René Eggenschwiler, Florian Huonder)
| | |-+  How to implement Reference Loading
« previous next »
Pages: 1 [2] Print
Author Topic: How to implement Reference Loading  (Read 1376 times)
d95776
Newbie
*
Posts: 21


View Profile
« Reply #15 on: May 02, 2011, 02:27:50 am »

Very appreciate your help. I wish we will have a way to get the reference resolved.
Logged
d95776
Newbie
*
Posts: 21


View Profile
« Reply #16 on: May 04, 2011, 05:56:15 pm »

Just would like to check if we have any progress on the topic.
Logged
Florian Huonder
Administrator
Full Member
*****
Posts: 129



View Profile WWW
« Reply #17 on: May 05, 2011, 12:31:30 pm »

Hi,

Yes we are still on it.
We were not available during this week therefore you did not get a response.

Wouldn't it be sufficient for you to go for the eager-approach through the policy repository?
The reason why I am asking is that building the lazy-loading approach by yourself as extension is quite complex. After the issue has been resolved it will be very easy.

Best regards,
Florian
Logged
d95776
Newbie
*
Posts: 21


View Profile
« Reply #18 on: May 05, 2011, 01:47:12 pm »

For eager approach, we have to rebuild the PolicySet object every policy document is unmarshalled and all of the policies have to be stored in memory before we can query PDP. This approach is performance slower and memory entensive. We would not like to use it in production. We can try it now until you have the solution for lazy approach.

For PolicySet rebuild, once a policy document is unmarshalled, we need to go through the PolicySet object and find all of the references defined in the PolicySet and get their IDs, and find the referenced policy document, unmarchall them to the Policy or PolicySet objects, then I need to remove the old references defined in the original PolicySet and replace the newly created Policy or PolicySet object reference into the original PolicySet. Could you please show me a simple code to remove IReferenceType object from the policy and place Policy or PolicySet object into an existing PolicySet by using your api?
Logged
Florian Huonder
Administrator
Full Member
*****
Posts: 129



View Profile WWW
« Reply #19 on: May 05, 2011, 05:28:58 pm »

Hi,

The eager approach works so that you go through the whole policy tree on call of the List<Evaluatable> getEvaluatables(RequestType request);
this method is meant to be used in conjunction with some indexing functionality, for example, to return a minimized set of applicable policies.
This sets of policies to return can be traversed form its root.
Each policy set has a list named "additionalInformation". This list contains elements of type PolicySet, Policy, Rule or IdReferenceType.
When you travers through the policy tree you, my opinion, can create a new list that simply copies all non-reference objects and replaces the reference objects. In the end you replace the list and go on level deeper into the tree. If you hit a Policy, then you're done.

Regarding your comment on the performance of the eager solution.
You are right, eager is very slow compared to the lazy approach. Nevertheless it is the only consitent way of retrieving policies (in theory, in practise it depends on your deployment strategy and your case).

Best is when you watch the issue in our JIRA (http://dev.herasaf.org) that you get notified when we start working on it.

Regards,
Florian
Logged
d95776
Newbie
*
Posts: 21


View Profile
« Reply #20 on: May 20, 2011, 07:48:01 pm »

I can not start from  List<Evaluatable> getEvaluatables(RequestType request); to get referenced policies resolved because the method can't find those referenced policies. I have to resolve all of the referenced policies when I populate policies into PDP's repository. Am I right?
Logged
René Eggenschwiler
Administrator
Jr. Member
*****
Posts: 63



View Profile
« Reply #21 on: May 20, 2011, 07:57:09 pm »

Hi,

Not really. It is the idea that when "List<Evaluatable> getEvaluatables(RequestType request);" is called, only then your repository should find references that are contained in the result set. Then your repo should resolve the refs and replace them.
So with this approach there's no need ti replace the refs at deployment time.

Regards,
René
Logged
d95776
Newbie
*
Posts: 21


View Profile
« Reply #22 on: May 21, 2011, 11:52:58 am »

Ok, let me try to resolve policy reference starting from method getEvaluatables(). Thanks!
Logged
Pages: 1 [2] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!