2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.policy.api;
23 import java.util.Collection;
25 import java.util.UUID;
27 import javax.json.JsonObject;
29 import org.openecomp.policy.api.NotificationHandler;
30 import org.openecomp.policy.api.PDPNotification;
31 import org.openecomp.policy.std.StdPolicyEngine;
34 * PolicyEngine is the Interface that applications use to make policy queries against a PEPEngine
38 public class PolicyEngine{
39 private String propertyFilePath = null;
40 private StdPolicyEngine stdPolicyEngine;
41 private NotificationScheme scheme = null;
42 private NotificationHandler handler = null;
45 * Gets the configuration from the PolicyDecisionPoint(PDP) for the <code>String</code> which represents the Policy File Name
47 * @param policyName the <code>String</code> format of the PolicyFile Name whose configuration is required.
48 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
49 * @throws PolicyConfigException
50 * @deprecated use {@link #getConfigByPolicyName(String policyName, UUID requestID)} Instead.
53 public Collection<PolicyConfig> getConfigByPolicyName(String policyName) throws PolicyConfigException {
54 Collection<PolicyConfig> policyConfig = stdPolicyEngine.policyName(policyName,(UUID)null);
59 * Gets the configuration from the PolicyDecisionPoint(PDP) for the <code>String</code> which represents the Policy File Name
61 * @param policyName the <code>String</code> format of the PolicyFile Name whose configuration is required.
62 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
63 * A different request ID should be passed for each request.
64 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
65 * @throws PolicyConfigException
66 * @deprecated use {@link #getConfigByPolicyName(String policyName, UUID requestID)} Instead.
69 public Collection<PolicyConfig> getConfigByPolicyName(String policyName, UUID requestID) throws PolicyConfigException {
70 Collection<PolicyConfig> policyConfig = stdPolicyEngine.policyName(policyName,requestID);
75 * Gets the configuration from the PolicyDecisionPoint(PDP) for the <code>String</code> which represents the eCOMPComponentName
77 * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
78 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
79 * @throws PolicyConfigException
80 * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
83 public Collection<PolicyConfig> getConfig(String eCOMPComponentName) throws PolicyConfigException {
84 Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,(UUID)null);
89 * Gets the configuration from the PolicyDecisionPoint(PDP) for the <code>String</code> which represents the eCOMPComponentName
91 * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
92 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
93 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
94 * A different request ID should be passed for each request.
95 * @throws PolicyConfigException
96 * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
99 public Collection<PolicyConfig> getConfig(String eCOMPComponentName, UUID requestID) throws PolicyConfigException {
100 Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,requestID);
105 * Requests the configuration of the <code>String</code> which represents the eCOMPComponentName and <code>String</code>
106 * which represents the configName and returns the configuration if different Configurations exist for the
107 * particular eCOMPComponentName.
109 * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
110 * @param configName the <code>String</code> format of the configurationName whose configuration is required.
111 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
112 * @throws PolicyConfigException
113 * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
116 public Collection<PolicyConfig> getConfig(String eCOMPComponentName, String configName) throws PolicyConfigException {
117 Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,configName,(UUID)null);
122 * Requests the configuration of the <code>String</code> which represents the eCOMPComponentName and <code>String</code>
123 * which represents the configName and returns the configuration if different Configurations exist for the
124 * particular eCOMPComponentName.
126 * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
127 * @param configName the <code>String</code> format of the configurationName whose configuration is required.
128 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
129 * A different request ID should be passed for each request.
130 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
131 * @throws PolicyConfigException
132 * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
135 public Collection<PolicyConfig> getConfig(String eCOMPComponentName, String configName, UUID requestID) throws PolicyConfigException {
136 Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,configName,requestID);
141 * Requests the configuration of the <code>String</code> which represents the eCOMPComponentName, <code>String</code>
142 * which represents the configName and <code>Map</code> of <code>String,String</code> which has the configAttribute and returns the specific
143 * configuration related to the configAttributes mentioned.
145 * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
146 * @param configName the <code>String</code> format of the configurationName whose configuration is required.
147 * @param configAttributes the <code>Map</code> of <code>String,String</code> format of the configuration attributes which are required.
148 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
149 * @throws PolicyConfigException
150 * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
153 public Collection<PolicyConfig> getConfig(String eCOMPComponentName, String configName, Map<String, String> configAttributes) throws PolicyConfigException{
154 Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,configName,configAttributes,(UUID)null);
159 * Requests the configuration of the <code>String</code> which represents the eCOMPComponentName, <code>String</code>
160 * which represents the configName and <code>Map</code> of <code>String,String</code> which has the configAttribute and returns the specific
161 * configuration related to the configAttributes mentioned.
163 * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose configuration is required.
164 * @param configName the <code>String</code> format of the configurationName whose configuration is required.
165 * @param configAttributes the <code>Map</code> of <code>String,String</code> format of the configuration attributes which are required.
166 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
167 * A different request ID should be passed for each request.
168 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
169 * @throws PolicyConfigException
170 * @deprecated use {@link #getConfig(ConfigRequestParameters)} Instead.
173 public Collection<PolicyConfig> getConfig(String eCOMPComponentName, String configName, Map<String, String> configAttributes, UUID requestID) throws PolicyConfigException{
174 Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(eCOMPComponentName,configName,configAttributes,requestID);
179 * Requests the configuration of the <code>ConfigRequestParameters</code> which represents the Config policy request parameters
180 * and returns the specific configuration related to the matching parameters.
182 * @param configRequestParameters {@link org.openecomp.policy.api.ConfigRequestParameters} which represents the Config policy request parameters.
183 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyConfig} which has the configuration.
184 * @throws PolicyConfigException
186 public Collection<PolicyConfig> getConfig(ConfigRequestParameters configRequestParameters) throws PolicyConfigException{
187 Collection<PolicyConfig> policyConfig = stdPolicyEngine.config(configRequestParameters);
192 * Requests the list of policies based on the <code>ConfigRequestParameters</code> which represents the policy request parameters
193 * and returns the list of policies filtered by the parameters.
195 * @param configRequestParameters {@link org.openecomp.policy.api.ConfigRequestParameters} which represents the List Policy request parameters.
196 * @return <code>Collection</code> of <code>String</code> which returns the list of policies.
197 * @throws PolicyConfigException
199 public Collection<String> listConfig(ConfigRequestParameters listPolicyRequestParameters) throws PolicyConfigException{
200 Collection<String> policyList = stdPolicyEngine.listConfig(listPolicyRequestParameters);
206 * Sends the Events specified to the PEP and returns back the PolicyResponse.
208 * @param eventAttributes the <code>Map</code> of <code>String,String</code> format of the eventAttributes that must contain the event ID and values.
209 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyResponse} which has the Response.
210 * @throws PolicyEventException
211 * @deprecated use {@link #sendEvent(EventRequestParameters)} Instead.
214 public Collection<PolicyResponse> sendEvent(Map<String, String> eventAttributes) throws PolicyEventException {
215 Collection<PolicyResponse> policyResponse = stdPolicyEngine.event(eventAttributes, (UUID) null);
216 return policyResponse;
220 * Sends the Events specified to the PEP and returns back the PolicyResponse.
222 * @param eventAttributes the <code>Map</code> of <code>String,String</code> format of the eventAttributes that must contain the event ID and values.
223 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
224 * A different request ID should be passed for each request.
225 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyResponse} which has the Response.
226 * @throws PolicyEventException
227 * @deprecated use {@link #sendEvent(EventRequestParameters)} Instead.
230 public Collection<PolicyResponse> sendEvent(Map<String, String> eventAttributes, UUID requestID) throws PolicyEventException {
231 Collection<PolicyResponse> policyResponse = stdPolicyEngine.event(eventAttributes, requestID);
232 return policyResponse;
236 * Sends the Events specified to the PEP and returns back the PolicyResponse.
238 * @param eventRequestParameters {@link org.openecomp.policy.api.EventRequestParameters} which represents the Event Request Parameters.
239 * @return <code>Collection</code> of {@link org.openecomp.policy.api.PolicyResponse} which has the Response.
240 * @throws PolicyEventException
242 public Collection<PolicyResponse> sendEvent(EventRequestParameters eventRequestParameters) throws PolicyEventException {
243 Collection<PolicyResponse> policyResponse = stdPolicyEngine.event(eventRequestParameters);
244 return policyResponse;
248 * Sends the decision Attributes specified to the PEP and returns back the PolicyDecision.
250 * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose Decision is required.
251 * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that must contain the ID and values.
252 * @return {@link org.openecomp.policy.api.DecisionResponse} which has the Decision.
253 * @throws PolicyDecisionException
254 * @deprecated use {@link #getDecision(DecisionRequestParameters)} Instead.
257 public DecisionResponse getDecision(String eCOMPComponentName, Map<String,String> decisionAttributes) throws PolicyDecisionException {
258 DecisionResponse policyDecision = stdPolicyEngine.decide(eCOMPComponentName, decisionAttributes, null);
259 return policyDecision;
263 * Sends the decision Attributes specified to the PEP and returns back the PolicyDecision.
265 * @param eCOMPComponentName the <code>String</code> format of the eCOMPComponentName whose Decision is required.
266 * @param decisionAttributes the <code>Map</code> of <code>String,String</code> format of the decisionAttributes that must contain the ID and values.
267 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
268 * A different request ID should be passed for each request.
269 * @return {@link org.openecomp.policy.api.DecisionResponse} which has the Decision.
270 * @throws PolicyDecisionException
271 * @deprecated use {@link #getDecision(DecisionRequestParameters)} Instead.
274 public DecisionResponse getDecision(String eCOMPComponentName, Map<String,String> decisionAttributes, UUID requestID) throws PolicyDecisionException {
275 DecisionResponse policyDecision = stdPolicyEngine.decide(eCOMPComponentName, decisionAttributes, requestID);
276 return policyDecision;
280 * Sends the decision Attributes specified to the PEP and returns back the PolicyDecision.
282 * @param decisionRequestParameters {@link org.openecomp.policy.api.DecisionRequestParameters} which represents the Decision Request Parameters.
283 * @return {@link org.openecomp.policy.api.DecisionResponse} which has the Decision.
284 * @throws PolicyDecisionException
286 public DecisionResponse getDecision(DecisionRequestParameters decisionRequestParameters) throws PolicyDecisionException {
287 DecisionResponse policyDecision = stdPolicyEngine.decide(decisionRequestParameters);
288 return policyDecision;
292 * <code>setNotification</code> allows changes to the Notification Scheme and Notification Handler
294 * @param scheme the <code>NotificationScheme</code> of {@link org.openecomp.policy.api.NotificationScheme} which defines the Notification Scheme
295 * @param handler the <code>NotificationHandler</code> of {@link org.openecomp.policy.api.NotificationHandler} which defines what should happen when a notification is received.
297 public void setNotification(NotificationScheme scheme, NotificationHandler handler) {
298 this.scheme = scheme;
299 this.handler = handler;
300 stdPolicyEngine.notification(this.scheme,this.handler);
304 * <code>clearNotification</code> shutsDown the Notification Service if the Auto Scehme Notification service is running.
306 public void clearNotification(){
307 stdPolicyEngine.stopNotification();
311 * <code>setNotification</code> allows changes to the Notification Scheme
313 * @param scheme the <code>NotificationScheme</code> of {@link org.openecomp.policy.api.NotificationScheme} which defines the Notification Scheme
315 public void setScheme(NotificationScheme scheme){
316 this.scheme = scheme;
317 stdPolicyEngine.setScheme(this.scheme);
320 * Gets the <code>PDPNotification</code> if there is one exists. This is used for Polling Patterns.
322 * @return <code>PDPNotification</code> of {@link org.openecomp.policy.api.PDPNotification} which has the Notification.
324 public PDPNotification getNotification() {
325 return stdPolicyEngine.getNotification();
329 * Creates a Config Policy based on given arguments
330 * @param policyName the <code>String</code> format of the Policy Name
331 * @param policyDescription the <code>String</code> format of the Policy Description
332 * @param ecompName the <code>String</code> format of the ECOMP Name
333 * @param configName the <code>String</code> format of the Config Name
334 * @param configAttributes the <code>List</code> the <code>Map</code> Attributes that must contain the key and value.
335 * @param configType the <code>String</code> format of the Config Type
336 * @param body the <code>String</code> format of the Policy Body
337 * @param policyScope the <code>String</code> value of the sub scope directory where the policy will be created and stored
338 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
339 * A different request ID should be passed for each request.
341 * @return <code>String</code> format of response
342 * @deprecated use {@link #createPolicy(PolicyParameters)} Instead.
345 public String createConfigPolicy(String policyName, String policyDescription, String ecompName, String configName,
346 Map<String, String> configAttributes, String configType, String body, String policyScope, UUID requestID,
347 String riskLevel, String riskType, String guard, String ttlDate) throws Exception {
349 String response = stdPolicyEngine.createConfigPolicy(policyName, policyDescription, ecompName, configName,
350 configAttributes, configType, body, policyScope, requestID,
351 riskLevel, riskType, guard, ttlDate);
358 * Creates a Config Policy based on given arguments
359 * @param policyName the <code>String</code> format of the Policy Name
360 * @param policyDescription the <code>String</code> format of the Policy Description
361 * @param ecompName the <code>String</code> format of the ECOMP Name
362 * @param configName the <code>String</code> format of the Config Name
363 * @param configAttributes the <code>List</code> the <code>Map</code> Attributes that must contain the key and value.
364 * @param configType the <code>String</code> format of the Config Type
365 * @param body the <code>String</code> format of the Policy Body
366 * @param policyScope the <code>String</code> value of the sub scope directory where the policy will be created and stored
367 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
368 * A different request ID should be passed for each request.
370 * @return <code>String</code> format of response
371 * @deprecated use {@link #updatePolicy(PolicyParameters)} Instead.
374 public String updateConfigPolicy(String policyName, String policyDescription, String ecompName, String configName,
375 Map<String, String> configAttributes, String configType, String body, String policyScope, UUID requestID,
376 String riskLevel, String riskType, String guard, String ttlDate) throws Exception {
378 String response = stdPolicyEngine.updateConfigPolicy(policyName, policyDescription, ecompName, configName,
379 configAttributes, configType, body, policyScope, requestID,riskLevel, riskType, guard, ttlDate);
386 * Creates a Config Firewall Policy based on given arguments
387 * @param policyName the <code>String</code> format of the Policy Name
388 * @param firewallJson the <code>JsonObject</code> representation of the Firewall Rules List
389 * @param policyScope the <code>String</code> value of the sub scope directory where the policy will be created and stored
390 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
391 * A different request ID should be passed for each request.
393 * @return <code>String</code> format of response.
394 * @deprecated use {@link #createPolicy(PolicyParameters)} Instead.
397 public String createConfigFirewallPolicy(String policyName, JsonObject firewallJson, String policyScope, UUID requestID,
398 String riskLevel, String riskType, String guard, String ttlDate) throws Exception {
400 String response = stdPolicyEngine.createConfigFirewallPolicy(policyName, firewallJson, policyScope, requestID,riskLevel,
401 riskType, guard, ttlDate);
408 * Updates a Config Firewall Policy based on given arguments
409 * @param policyName the <code>String</code> format of the Policy Name
410 * @param firewallJson the <code>JsonObject</code> representation of the Firewall Rules List
411 * @param policyScope the <code>String</code> value of the sub scope directory where the policy will be created and stored
412 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
413 * A different request ID should be passed for each request.
415 * @return <code>String</code> format of response.
416 * @deprecated use {@link #updatePolicy(PolicyParameters)} Instead.
419 public String updateConfigFirewallPolicy(String policyName, JsonObject firewallJson, String policyScope, UUID requestID,
420 String riskLevel, String riskType, String guard, String ttlDate) throws Exception {
422 String response = stdPolicyEngine.updateConfigFirewallPolicy(policyName, firewallJson, policyScope, requestID,riskLevel, riskType, guard, ttlDate);
429 * Creates a Dictionary Item based on given Dictionary Parameters
431 * @param policyParameters {@link org.openecomp.policy.api.DictionaryParameters} which represents the Dictionary Parameters required to create a Dictionary Item.
432 * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to create dictionary item Request.
435 public PolicyChangeResponse createDictionaryItem(DictionaryParameters parameters) throws Exception {
436 PolicyChangeResponse response = stdPolicyEngine.createDictionaryItem(parameters);
441 * Creates a Policy based on given Policy Parameters.
443 * @param policyParameters {@link org.openecomp.policy.api.PolicyParameters} which represents the Policy Parameters required to create a Policy.
444 * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to create policy Request.
447 public PolicyChangeResponse createPolicy(PolicyParameters policyParameters) throws Exception {
448 PolicyChangeResponse response = stdPolicyEngine.createPolicy(policyParameters);
453 * Update Policy based on given Policy Parameters.
455 * @param policyParameters {@link org.openecomp.policy.api.PolicyParameters} which represents the Policy Parameters required to update a Policy.
456 * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to create policy Request.
459 public PolicyChangeResponse updatePolicy(PolicyParameters policyParameters) throws Exception {
460 PolicyChangeResponse response = stdPolicyEngine.updatePolicy(policyParameters);
465 * Pushes the specified policy to the PDP Group. If no PDP group is selected default is used.
467 * @param policyScope the <code>String</code> value of the sub scope directory where the policy is located
468 * @param policyName the <code>String</code> format of the Policy Name being pushed.
469 * @param policyType the <code>String</code> format of the Policy Type which is being pushed.
470 * @param pdpGroup the <code>String</code> format of the PDP Group name to which the policy needs to be pushed to.
471 * @param requestID unique request ID which will be passed throughout the ECOMP components to correlate logging messages.
472 * @return <code>String</code> format of the response related to the push Policy Request.
474 * @deprecated use {@link #pushPolicy(PushPolicyParameters)} instead.
477 public String pushPolicy(String policyScope, String policyName, String policyType, String pdpGroup, UUID requestID) throws Exception {
479 String response = stdPolicyEngine.pushPolicy(policyScope, policyName, policyType, pdpGroup, requestID);
485 * Pushes the specified policy to the PDP Group. If no PDP group is selected default is used.
487 * @param pushPolicyParameters {@link org.openecomp.policy.api.PushPolicyParameters} which represents the Push Policy parameters required to push a policy.
488 * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to the push Policy Request.
491 public PolicyChangeResponse pushPolicy(PushPolicyParameters pushPolicyParameters) throws Exception {
492 PolicyChangeResponse response = stdPolicyEngine.pushPolicy(pushPolicyParameters);
497 * Deletes the specified policy from the PAP or PDP.
499 * @param deletePolicyParameters {@link org.openecomp.policy.api.DeletePolicyParameters} which represents the Delete Policy parameters to delete a policy.
500 * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to the Delete Policy Request.
503 public PolicyChangeResponse deletePolicy(DeletePolicyParameters deletePolicyParameters) throws Exception {
504 PolicyChangeResponse response = stdPolicyEngine.deletePolicy(deletePolicyParameters);
509 * PolicyEngine Constructor with <code>String</code> format of propertiesFilePathname
511 * @param propertiesFilePathname the <code>String</code> format of the propertiesFilePathname
512 * @throws PolicyEngineException
514 public PolicyEngine(String propertiesFilePathname) throws PolicyEngineException {
515 this.propertyFilePath = propertiesFilePathname ;
516 this.stdPolicyEngine= new StdPolicyEngine(this.propertyFilePath);
520 * PolicyEngine Constructor with <code>String</code> format of PropertiesFilePathname, <code>NotificationScheme</code> and <code>NotificationHandler</code>
522 * @param propertiesFilePathname the <code>String</code> format of the propertiesFilePathname
523 * @param scheme the <code>NotificationScheme</code> of {@link org.openecomp.policy.api.NotificationScheme} which defines the Notification Scheme
524 * @param handler the <code>NotificationHandler</code> of {@link org.openecomp.policy.api.NotificationHandler} which defines what should happen when a notification is received.
525 * @throws PolicyEngineException
527 public PolicyEngine(String propertiesFilePathname, NotificationScheme scheme, NotificationHandler handler) throws PolicyEngineException {
528 this.propertyFilePath = propertiesFilePathname ;
529 this.scheme = scheme;
530 this.handler = handler;
531 this.stdPolicyEngine= new StdPolicyEngine(this.propertyFilePath,this.scheme,this.handler);
535 * Creates a new Policy Service based on given Service Parameters.
537 * @param importParameters {@link org.openecomp.policy.api.ImportParameters} which represents the Service Parameters required to create a Policy Service.
538 * @return {@link org.openecomp.policy.api.PolicyChangeResponse} which consists of the response related to create import Service.
541 public PolicyChangeResponse policyEngineImport(ImportParameters importParameters) throws Exception {
542 PolicyChangeResponse response = stdPolicyEngine.policyEngineImport(importParameters);
547 * PolicyEngine Constructor with <code>String</code> format of PropertiesFilePathname and <code>NotificationScheme</code>
549 * @param propertiesFilePathname the <code>String</code> format of the propertiesFilePathname
550 * @param scheme the <code>NotificationScheme</code> of {@link org.openecomp.policy.api.NotificationScheme} which defines the Notification Scheme
551 * @throws PolicyEngineException
553 public PolicyEngine(String propertiesFilePathname, NotificationScheme scheme) throws PolicyEngineException{
554 this.propertyFilePath = propertiesFilePathname;
555 this.scheme = scheme;
556 this.stdPolicyEngine = new StdPolicyEngine(this.propertyFilePath, this.scheme);
559 * PolicyEngine Constructor with no parameters.
561 public PolicyEngine(){
564 public void createFirewallPolicy(String filterName, String termName, String preIPSource, String preIPDest,
565 String sourcePort, String destPort, String Port, String protocol, String direction, String action ) throws PolicyDecisionException {
566 stdPolicyEngine.createFirewallPolicy(filterName, termName, preIPSource, preIPDest, sourcePort, destPort, Port,
567 protocol, direction, action);
570 public void updateFirewallPolicy(String filterName, String termName, String preIPSource, String preIPDest,
571 String sourcePort, String destPort, String Port, String protocol, String direction, String action ) throws PolicyDecisionException {
572 stdPolicyEngine.updateFirewallPolicy(filterName, termName, preIPSource, preIPDest, sourcePort, destPort, Port,
573 protocol, direction, action);