2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 // @ Project : Access Control Engine
20 // @ File Name : PolicyInformationPoint.h
21 // @ Date : 2009-05-06
26 #ifndef _POLICY_INFORMATION_POINT_H
27 #define _POLICY_INFORMATION_POINT_H
31 #include <dpl/ace/Attribute.h>
32 #include <dpl/ace/Request.h>
34 #include <dpl/ace-dao-ro/BaseAttribute.h>
36 #include <dpl/ace/WRT_INTERFACE.h>
38 typedef int PipResponse;
40 class PolicyInformationPoint
44 /** queries for interfaces*/
45 std::list<ATTRIBUTE> resourceAttributesQuery;
46 std::list<ATTRIBUTE> environmentAttributesQuery;
47 std::list<ATTRIBUTE> subjectAttributesQuery;
48 std::list<ATTRIBUTE> functionParamAttributesQuery;
51 void createQueries(AttributeSet* attributes);
53 IWebRuntime* wrtInterface;
54 IResourceInformation* resourceInformation;
55 IOperationSystem* operationSystem;
58 static const int ERROR_SHIFT_RESOURCE = 3;
59 static const int ERROR_SHIFT_OS = 6;
60 static const int ERROR_SHIFT_FP = 9;
62 /** Mask used to identify PIP error */
66 /* WebRuntime Error */
67 WRT_UNKNOWN_SUBJECT = 1 << 0,
68 WRT_UNKNOWN_ATTRIBUTE = 1 << 1,
69 WRT_INTERNAL_ERROR = 1 << 2,
70 /* Resource Information Storage Error */
71 RIS_UNKNOWN_RESOURCE = 1 << 3,
72 RIS_UNKNOWN_ATTRIBUTE = 1 << 4,
73 RIS_INTERNAL_ERROR = 1 << 5,
75 OS_UNKNOWN_ATTRIBUTE = 1 << 6,
76 OS_INTERNAL_ERROR = 1 << 7
79 //TODO add checking values of attributes
80 /** gather attributes values from adequate interfaces */
81 virtual PipResponse getAttributesValues(const Request* request,
82 AttributeSet* attributes);
83 virtual ~PolicyInformationPoint();
84 PolicyInformationPoint(IWebRuntime *wrt,
85 IResourceInformation *resource,
86 IOperationSystem *system) : wrtInterface(wrt),
87 resourceInformation(resource),
88 operationSystem(system)
91 virtual void update(IWebRuntime *wrt,
92 IResourceInformation *resource,
93 IOperationSystem *system)
96 resourceInformation = resource;
97 operationSystem = system;
99 IWebRuntime * getWebRuntime()
105 #endif //_POLICY_INFORMATION_POINT_H