java.lang.Object
org.odpi.openmetadata.adapters.connectors.usageinsight.popularity.MemberActivity

public class MemberActivity extends Object
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 Details

    • MemberActivity

      public MemberActivity()
      Default constructor - all counts are zero.
  • Method Details

    • fromUsageActivity

      public static MemberActivity fromUsageActivity(ElementClassification usageActivity)
      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

      public void add(MemberActivity other)
      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

      public String toString()
      JSON-style toString
      Overrides:
      toString in class Object
      Returns:
      string of property names and values
    • equals

      public boolean equals(Object objectToCompare)
      Compare the values of the supplied object with those stored in the current object.
      Overrides:
      equals in class Object
      Parameters:
      objectToCompare - supplied object
      Returns:
      boolean result of comparison
    • hashCode

      public int hashCode()
      Return hash code based on properties.
      Overrides:
      hashCode in class Object
      Returns:
      int