Documentation: Legacy APIs
[policy/engine.git] / docs / platform / offeredapis.rst
index 4a76fb7..7c6309c 100644 (file)
@@ -1,9 +1,12 @@
 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
 .. http://creativecommons.org/licenses/by/4.0
 
+.. _legacyapis-label:
 
-Offered APIs
-============
+Legacy Offered APIs  
+===================
+
+.. warning:: These Legacy APIs are scheduled to be deprecated after the Frankfurt release!
 
 .. contents:: 
     :depth: 2
@@ -418,6 +421,35 @@ Examples
                 }
             }
         }
+        
+        
+    .. code-block:: java
+       :caption: ListPolicy Example
+       :linenos:
+       
+       package org.onap.policyengine;
+
+       import java.util.Collection;
+       import org.onap.policy.api.ConfigNameRequest;
+       import org.onap.policy.api.PolicyEngine;
+
+       /**
+        * List Policy Client Code
+        * policyName : ".*" returns list of policy names from PAP.
+        * policyName : "scope + "_" + "policyType" + "_" + policyName" + ".*" returns the matching policy from pap (active version)
+        *
+        */
+        public class ListPolicyClient {
+          public static void main(String[] args) throws Exception {
+             PolicyEngine pe = new PolicyEngine("config.properties");
+             ConfigNameRequest listPolicyParams = new ConfigNameRequest();
+             listPolicyParams.setPolicyName(".*");
+             Collection<String> policies = pe.listPolicy(listPolicyParams);
+             for (String policy : policies) {
+                 System.out.println(policy);
+             }
+          }
+        }
 
 
     .. code-block:: java
@@ -634,16 +666,5 @@ Examples
         }
 
 
-Additional Information
-^^^^^^^^^^^^^^^^^^^^^^
-
-Additional information, including examples, can be found at `PolicyApi link`_.
-
-.. _PolicyApi link: https://wiki.onap.org/display/DW/Policy+API
-
-
-
-
-
 End of Document