Class MemberActivity
java.lang.Object
org.odpi.openmetadata.adapters.connectors.usageinsight.popularity.MemberActivity
MemberActivity holds the seven usage activity counts for an element: the counts from its own UsageActivity
classification, plus - for a collection - the totals of the activity of its members. It is the value that an
element contributes to the MemberPopularityProfile of each collection it is a member of.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(MemberActivity other) Add another element's activity to this one.booleanCompare the values of the supplied object with those stored in the current object.static MemberActivityfromMemberPopularityProfile(ElementClassification memberPopularityProfile) Return the totals recorded in an element's MemberPopularityProfile classification.static MemberActivityfromUsageActivity(ElementClassification usageActivity) Return the activity recorded in an element's UsageActivity classification.longReturn the delete attachment count.longReturn the delete feedback count.longReturn the explicit get count.longReturn the find count.getMemberPopularityProfile(Map<String, MemberActivity> membersActivity) Build the MemberPopularityProfile for a collection from the activity of each of its members.longReturn the update attachment count.longReturn the update feedback count.longReturn the update property count.inthashCode()Return hash code based on properties.booleanisEmpty()Return whether there has been no activity at all.static booleansameCounts(MemberPopularityProfileProperties existing, MemberPopularityProfileProperties latest) Return whether two profiles hold the same counts.toString()JSON-style toString
-
Constructor Details
-
MemberActivity
public MemberActivity()Default constructor - all counts are zero.
-
-
Method Details
-
fromUsageActivity
Return the activity recorded in an element's UsageActivity classification.- Parameters:
usageActivity- classification from the element's header (may be null)- Returns:
- activity - all zero if the element is not classified
-
fromMemberPopularityProfile
public static MemberActivity fromMemberPopularityProfile(ElementClassification memberPopularityProfile) Return the totals recorded in an element's MemberPopularityProfile classification.- Parameters:
memberPopularityProfile- classification from the element's header (may be null)- Returns:
- activity - all zero if the element is not classified
-
add
Add another element's activity to this one.- Parameters:
other- activity to add (may be null)
-
isEmpty
public boolean isEmpty()Return whether there has been no activity at all.- Returns:
- boolean
-
getMemberPopularityProfile
public static MemberPopularityProfileProperties getMemberPopularityProfile(Map<String, MemberActivity> membersActivity) Build the MemberPopularityProfile for a collection from the activity of each of its members. The totals are the sum of the members' activity, and each profile maps a member's GUID to that member's count. Members with a zero count are left out of a profile so that the maps only describe the members that have been used.- Parameters:
membersActivity- map of member GUID to that member's activity- Returns:
- classification properties
-
sameCounts
public static boolean sameCounts(MemberPopularityProfileProperties existing, MemberPopularityProfileProperties latest) Return whether two profiles hold the same counts. Only the fourteen count attributes are compared - the profile read back from the repository carries other values (such as its type name) that a newly built one does not, and they must not make an unchanged profile look changed.- Parameters:
existing- profile currently stored (may be null)latest- newly built profile- Returns:
- boolean
-
getExplicitGetCount
public long getExplicitGetCount()Return the explicit get count.- Returns:
- long
-
getFindCount
public long getFindCount()Return the find count.- Returns:
- long
-
getUpdatePropertyCount
public long getUpdatePropertyCount()Return the update property count.- Returns:
- long
-
getUpdateAttachmentCount
public long getUpdateAttachmentCount()Return the update attachment count.- Returns:
- long
-
getUpdateFeedbackCount
public long getUpdateFeedbackCount()Return the update feedback count.- Returns:
- long
-
getDeleteAttachmentCount
public long getDeleteAttachmentCount()Return the delete attachment count.- Returns:
- long
-
getDeleteFeedbackCount
public long getDeleteFeedbackCount()Return the delete feedback count.- Returns:
- long
-
toString
JSON-style toString -
equals
Compare the values of the supplied object with those stored in the current object. -
hashCode
public int hashCode()Return hash code based on properties.
-