Class IntersectedSubCubeProperties
- All Implemented Interfaces:
IContextValue,ISubCubeProperties,IIntersectable<ISubCubeProperties>,IClone<IContextValue>,Serializable,Cloneable
The intersection is a logical AND: a measure/member is granted in the intersection, if it is granted in all the intersected subCubeProperties.
- Author:
- ActiveViam
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclone()Deep clone of the sub cube properties.booleanstatic List<?> findIntersection(List<?> left, List<?> right) Find the member restriction common to two member restrictions by intersecting them.Class<? extends IContextValue> Returns the reference interface of the context value.getGrantedMembers(String dimension, String hierarchy) Returns the axis members that are granted by this intersection.Retrieves the mapping dimension => restricted hierarchies.getSubCubeTree(String dimension, String hierarchy) Deprecated, for removal: This API element is subject to removal in a future version.inthashCode()intersect(ISubCubeProperties other) Returns anISubCubePropertiesthat only grants the members and measures that are granted by thisISubCubePropertiesand the given one.static ISubCubePropertiesintersect(ISubCubeProperties... subcubes) Constructs an intersection of the givenISubCubePropertiessubcube properties.booleanReturns true if this user can access to the pivot, false otherwise.static booleanisGranted(ISubCubeProperties scp, String dimension, List<?> memberPath) Test if a subcube is granting access on the given dimension and hierarchy to the member designated by its path.intisHierarchyRestricted(HierarchyIdentifier hierarchyIdentifier) Returns a positive integer if this cube filter restricts access to any member of the given hierarchy.intisLocationGranted(List<? extends IHierarchyInfo> hierarchies, ILocation location) Tells if the user can access to a specific location.isLocationGrantedMultiple(List<? extends IHierarchyInfo> hierarchies, ILocation location) Tells if the user can access to a specific location.booleanisMeasureGranted(String measureName) Tells if the measure is granted.removeRestriction(HierarchyIdentifier hierarchy) Removes the restriction on the specified hierarchy.toString()Methods inherited from interface com.activeviam.activepivot.core.intf.api.contextvalues.subcube.ISubCubeProperties
getGrantedMembers, removeRestriction
-
Method Details
-
getIntersectedSubCubeProperties
-
intersect
Constructs an intersection of the givenISubCubePropertiessubcube properties.Note that this method may or may not return an instance of
IntersectedSubCubeProperties: this method is allowed to perform any optimizations that will simplify the resulting intersection.- Parameters:
subcubes- TheISubCubePropertiesto intersect- Returns:
- The intersection of the given
ISubCubeProperties, or null if null was given as argument.
-
intersect
Description copied from interface:ISubCubePropertiesReturns anISubCubePropertiesthat only grants the members and measures that are granted by thisISubCubePropertiesand the given one.The intersection is like a logical AND.
- Specified by:
intersectin interfaceIIntersectable<ISubCubeProperties>- Specified by:
intersectin interfaceISubCubeProperties- Parameters:
other- The ISubCubeProperties instance to intersect- Returns:
- the intersection of the sub cubes.
-
getRestrictedHierarchies
Description copied from interface:ISubCubePropertiesRetrieves the mapping dimension => restricted hierarchies. If a dimension is absent, it has no restricted hierarchies.- Specified by:
getRestrictedHierarchiesin interfaceISubCubeProperties- Returns:
- A map of dimensions with restricted hierarchies. If the dimensions has restricted hierarchies, the set of all restricted hierarchies is contained.
-
isAccessGranted
public boolean isAccessGranted()Description copied from interface:ISubCubePropertiesReturns true if this user can access to the pivot, false otherwise.- Specified by:
isAccessGrantedin interfaceISubCubeProperties- Returns:
- true if this user can access to the pivot, false otherwise.
-
isMeasureGranted
Description copied from interface:ISubCubePropertiesTells if the measure is granted.- Specified by:
isMeasureGrantedin interfaceISubCubeProperties- Parameters:
measureName- The name of the aggregated measure.- Returns:
- true if granted, false otherwise.
-
isHierarchyRestricted
Description copied from interface:ISubCubePropertiesReturns a positive integer if this cube filter restricts access to any member of the given hierarchy.The returned integer corresponds to the depth of the deepest member that cannot be accessed with this cube filter.
- Specified by:
isHierarchyRestrictedin interfaceISubCubeProperties- Parameters:
hierarchyIdentifier- The unique identifier for the hierarchy- Returns:
- -1 if no restriction, the maximum depth of the restriction otherwise.
-
removeRestriction
Description copied from interface:ISubCubePropertiesRemoves the restriction on the specified hierarchy.This method could return
this, when there is norestrictionon the hierarchy.- Specified by:
removeRestrictionin interfaceISubCubeProperties- Parameters:
hierarchy- The target hierarchy- Returns:
- an ISubCubeProperties without restriction on the specified hierarchy.
-
getGrantedMembers
Returns the axis members that are granted by this intersection.An axis member is granted only if all the sub cube properties in the intersection grant it, or when a sub cube property does not define any granted member (all are granted).
- Specified by:
getGrantedMembersin interfaceISubCubeProperties- Parameters:
dimension- The name of the target dimensionhierarchy- the name of the hierarchy- Returns:
- set of granted members. The return result can contain a list of member paths of granted
members or/and a list of
IConditiondefining which members are allowed.
-
findIntersection
Find the member restriction common to two member restrictions by intersecting them. For instance: - if List(A,B,C) and List(A) are given, the result is List(A,B,C) "if we grant access to [AllMember] on one side and [AllMember].[EUR].[foo] on the other side, the granted member is [AllMember].[EUR].[foo]" - if List(A) and List(B) are given, there is no common member so null is returned.It should take into account the fact some elements can be null among the list.
nullis like a wildcard i.e means everything on the given level. For instance: if List(A,null,C) and List(A,B) are given, the intersection is List(A,B,C).- Parameters:
left- list of member paths to merge with rightright- list of member paths to merge with left- Returns:
- the intersection list resulting from the merge described above between left and right.
-
isLocationGranted
Description copied from interface:ISubCubePropertiesTells if the user can access to a specific location.- Specified by:
isLocationGrantedin interfaceISubCubeProperties- Parameters:
hierarchies- all theIHierarchyInfoincluding the measures.location- tested target location, aligned with the context hierarchies- Returns:
- -1 if no access granted, 0 otherwise and the ordinal of the limiting hierarchy if it exists.
- See Also:
-
isLocationGrantedMultiple
public Set<Integer> isLocationGrantedMultiple(List<? extends IHierarchyInfo> hierarchies, ILocation location) Description copied from interface:ISubCubePropertiesTells if the user can access to a specific location.- Specified by:
isLocationGrantedMultiplein interfaceISubCubeProperties- Parameters:
hierarchies- list of hierarchies, including the measure hierarchylocation- A target location, aligned with the context hierarchies- Returns:
- NULL is filtered out completely. An empty collection if no restrictions, otherwise the set of restricted hierarchy ordinals.
- See Also:
-
getContextInterface
Description copied from interface:IContextValueReturns the reference interface of the context value.- Specified by:
getContextInterfacein interfaceIContextValue- Returns:
- The reference interface of the context value.
-
getSubCubeTree
@Deprecated(since="6.1.0", forRemoval=true) public ISubCubeTree getSubCubeTree(String dimension, String hierarchy) Deprecated, for removal: This API element is subject to removal in a future version.Returns the subCubeTree attached to a given hierarchy name.- Parameters:
dimension- The name of the target dimensionhierarchy- The name of the target hierarchy- Returns:
- the subCubeTree attached to a given hierarchy name
-
clone
Description copied from interface:ISubCubePropertiesDeep clone of the sub cube properties.- Specified by:
clonein interfaceIClone<IContextValue>- Specified by:
clonein interfaceIIntersectable<ISubCubeProperties>- Specified by:
clonein interfaceISubCubeProperties- Returns:
- a clone of the object
-
isGranted
Test if a subcube is granting access on the given dimension and hierarchy to the member designated by its path.- Parameters:
scp-ISubCubePropertiesto testdimension- name of the dimensionmemberPath- the path of the member- Returns:
- true if the member whose path corresponds to the input is granted.
-
hashCode
public int hashCode() -
equals
-
toString
-