.. 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
}
}
}
+
+
+ .. 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
}
-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