Class AbstractPolicyHierarchyDef
java.lang.Object
com.onenetwork.platform.data.model.policy.AbstractPolicyHierarchyDef
public abstract class AbstractPolicyHierarchyDef
extends java.lang.Object
A Policy Hierarchy determines the path of "parents" to navigate through when fetching a policy value for
a model. For example, one might have an "OrgPolicyHierarchy" which searches first at the Org level, then the
Enterprise level, and finally the Value Chain level.
Developers should extend this class to implement a Policy Hierarchy.
-
Constructor Summary
Constructors Constructor Description AbstractPolicyHierarchyDef()
-
Method Summary
Modifier and Type Method Description PolicyHierarchyContext
getHierarchyContext()
java.util.List<com.onenetwork.platform.data.model.impl.ModelLevelType>
getModelLevelTypes()
Returns the list of model levels which are valid for this policy hierarchy def.abstract java.util.Map<java.lang.Long,ModelId>
getParent(com.onenetwork.platform.data.model.impl.ModelLevelType modelLevelType, java.util.List<java.lang.Long> ids)
Given a model level and list of ids, return a map of id to a "ModelId" object capturing the model level and id of its next available parent.org.json.JSONObject
getPickerReportConfig(com.onenetwork.platform.data.model.impl.ModelLevelType modelLevelType)
Given aModelLevelType
, return aJSONObject
containing the Picker Report Configurationvoid
setHierarchyContext(PolicyHierarchyContext hierarchyContext)
-
Constructor Details
-
AbstractPolicyHierarchyDef
public AbstractPolicyHierarchyDef()
-
-
Method Details
-
getParent
public abstract java.util.Map<java.lang.Long,ModelId> getParent(com.onenetwork.platform.data.model.impl.ModelLevelType modelLevelType, java.util.List<java.lang.Long> ids)Given a model level and list of ids, return a map of id to a "ModelId" object capturing the model level and id of its next available parent. May be null.- Parameters:
modelLevelType
- model levelids
- surrogate ids of the objects of the given level whose parents are to be fetched.
-
getModelLevelTypes
public java.util.List<com.onenetwork.platform.data.model.impl.ModelLevelType> getModelLevelTypes()Returns the list of model levels which are valid for this policy hierarchy def. The default implementation returns an empty list - subclasses are expected to override this, but it maintains a default implementation for backward-compatibility purposes.- Returns:
- List of ModelLevelType which are valid for this policy hierarchy def
-
getHierarchyContext
- Returns:
- the hierarchyContext
-
setHierarchyContext
- Parameters:
hierarchyContext
- the hierarchyContext to set
-
getPickerReportConfig
public org.json.JSONObject getPickerReportConfig(com.onenetwork.platform.data.model.impl.ModelLevelType modelLevelType)Given aModelLevelType
, return aJSONObject
containing the Picker Report Configuration
reportName - report name to be used for launching the picker dialog. targetLevelType - target model level type filters - Optional filters to supply to the picker report request.
- Parameters:
modelLevelType
-ModelLevelType
- Returns:
JSONObject
{ reportName: 'MyAndPartnerOrg', targetLevelType: 'Organization', filters:{'Undefined$Name': 'VendorA'} }
-