[POLICY-22] Reorganizing drools-apps
[policy/drools-applications.git] / controlloop / templates / template.demo / src / test / resources / xacml / old / frequency_limiter_2.xml
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="urn:com:att:xacml:policy:id:25e12b06-11d5-4895-b2a2-6f6c594de069" Version="1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable">
3         <Description>Policy for frequency limiter.</Description>
4         <Target>
5             <AnyOf>
6                 <AllOf>
7                    <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
8                         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">APPC</AttributeValue>
9                         <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="urn:oasis:names:tc:xacml:1.0:actor:actor-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
10                     </Match>
11                     <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
12                         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Restart</AttributeValue>
13                         <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" AttributeId="urn:oasis:names:tc:xacml:1.0:operation:operation-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
14                     </Match>
15                 </AllOf>
16             </AnyOf>
17         </Target>
18         <Rule RuleId="urn:com:att:xacml:rule:id:e1e8c5c0-e2ba-47d5-9289-6c015305ed21" Effect="Permit">
19             <Description>PERMIT - only if number of operations performed in the past is less than the limit.</Description>
20            
21             <Condition>
22                         <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-equal">                
23         
24                     <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:boolean-bag-size">
25
26                                 <Apply FunctionId="urn:oasis:names:tc:xacml:3.0:function:map">  
27        
28                                         <Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:dateTime-less-than-or-equal"/> 
29                                 
30                                         <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:dateTime-subtract-dayTimeDuration">
31                                                 <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:dateTime-one-and-only">
32                                                         <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:environment:current-dateTime" DataType="http://www.w3.org/2001/XMLSchema#dateTime" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment" MustBePresent="false"/>
33                                             </Apply>
34                                             <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#dayTimeDuration">PT10M</AttributeValue>
35                                         </Apply> 
36                                        <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="com:att:research:xacml:test:sql:resource:operations:starttimebag" DataType="http://www.w3.org/2001/XMLSchema#dateTime" Issuer="com:att:research:xacml:test:sql" MustBePresent="false"/>    
37                                </Apply>  
38                         </Apply>
39                         
40                         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">22</AttributeValue>
41                         
42                         </Apply>
43                         </Condition>
44         </Rule>
45         
46         
47         <Rule RuleId="urn:com:att:xacml:rule:id:c9a3fb7d-d0b9-48bb-bdca-87eb4957120c" Effect="Deny">
48             <Description>DENY - default.</Description>
49             <Target/>
50         </Rule>
51         
52 </Policy>