Class AbstractCloud

  • All Implemented Interfaces:
    Cloud
    Direct Known Subclasses:
    BugCollectionStorageCloud

    public abstract class AbstractCloud
    extends java.lang.Object
    implements Cloud
    Author:
    William Pugh
    • Field Detail

      • MIN_TIMESTAMP

        public static long MIN_TIMESTAMP
      • THROW_EXCEPTION_IF_CANT_CONNECT

        protected static final boolean THROW_EXCEPTION_IF_CANT_CONNECT
        See Also:
        Constant Field Values
    • Constructor Detail

    • Method Detail

      • isInitialized

        public boolean isInitialized()
        Description copied from interface: Cloud
        Return true if the cloud has been successfully initialized
        Specified by:
        isInitialized in interface Cloud
      • initialize

        @OverridingMethodsMustInvokeSuper
        public boolean initialize()
                           throws java.io.IOException
        Description copied from interface: Cloud
        Attempt to initialize the cloud
        Specified by:
        initialize in interface Cloud
        Returns:
        true if successful
        Throws:
        java.io.IOException
      • getMode

        public Cloud.Mode getMode()
        Description copied from interface: Cloud
        Get voting mode
        Specified by:
        getMode in interface Cloud
      • setMode

        public void setMode​(Cloud.Mode mode)
        Description copied from interface: Cloud
        Set voting mode
        Specified by:
        setMode in interface Cloud
      • supportsBugLinks

        public boolean supportsBugLinks()
        Description copied from interface: Cloud
        Supports links to a bug database
        Specified by:
        supportsBugLinks in interface Cloud
      • updateBugStatusCache

        public void updateBugStatusCache​(BugInstance b,
                                         java.lang.String status)
        Description copied from interface: Cloud
        Updates the local cache of bug reporting status. Does not modify server code.
        Specified by:
        updateBugStatusCache in interface Cloud
      • supportsClaims

        public boolean supportsClaims()
        Description copied from interface: Cloud
        Supports allowing users to claim a bug
        Specified by:
        supportsClaims in interface Cloud
      • supportsCloudReports

        public boolean supportsCloudReports()
        Description copied from interface: Cloud
        Supports textual summaries about the status of a bug
        Specified by:
        supportsCloudReports in interface Cloud
      • claimedBy

        public java.lang.String claimedBy​(BugInstance b)
        Description copied from interface: Cloud
        Get the user who has claimed a bug; null if no one has
        Specified by:
        claimedBy in interface Cloud
      • claim

        public boolean claim​(BugInstance b)
        Description copied from interface: Cloud
        Claim the bug
        Specified by:
        claim in interface Cloud
        Returns:
        true if no one else has already done so
      • getBugLink

        public java.net.URL getBugLink​(BugInstance b)
        Description copied from interface: Cloud
        Get link for bug, either to file one or to view it
        Specified by:
        getBugLink in interface Cloud
      • canSeeCommentsByOthers

        public boolean canSeeCommentsByOthers​(BugInstance bug)
      • hasVoted

        public boolean hasVoted​(BugInstance bug)
      • notInCloudMsg

        public java.lang.String notInCloudMsg​(BugInstance b)
      • bugsPopulated

        public void bugsPopulated()
        Description copied from interface: Cloud
        Called after the bugs in the bug collection are loaded; bugs should not be synchronized before this method is called
        Specified by:
        bugsPopulated in interface Cloud
      • issueDataHasBeenDownloaded

        protected boolean issueDataHasBeenDownloaded()
      • getBugStatus

        public java.lang.String getBugStatus​(BugInstance b)
        Description copied from interface: Cloud
        A textual description of the bug status (e.g., FIX_LATER, ASSIGNED, OBSOLETE, WILL_NOT_FIX)
        Specified by:
        getBugStatus in interface Cloud
      • getLatestDesignationFromEachUser

        protected abstract java.lang.Iterable<BugDesignation> getLatestDesignationFromEachUser​(BugInstance bd)
      • getStatusMsg

        public java.lang.String getStatusMsg()
        Description copied from interface: Cloud
        Get a status message for the cloud; information about any errors, and information about database synchronization
        Specified by:
        getStatusMsg in interface Cloud
      • shutdown

        public void shutdown()
        Description copied from interface: Cloud
        Shutdown the cloud, note termination of session, close connections
        Specified by:
        shutdown in interface Cloud
      • getIWillFix

        public boolean getIWillFix​(BugInstance b)
        Description copied from interface: Cloud
        has the user said they will fix this bug
        Specified by:
        getIWillFix in interface Cloud
      • printCloudSummary

        public void printCloudSummary​(java.io.PrintWriter w,
                                      java.lang.Iterable<BugInstance> bugs,
                                      java.lang.String[] packagePrefixes)
        Specified by:
        printCloudSummary in interface Cloud
      • printLeaderBoard2

        public static void printLeaderBoard2​(java.io.PrintWriter w,
                                             Multiset<java.lang.String> evaluations,
                                             int maxRows,
                                             java.lang.String alwaysPrint,
                                             java.lang.String format,
                                             java.lang.String title)
      • canStoreUserAnnotation

        public boolean canStoreUserAnnotation​(BugInstance bugInstance)
        Description copied from interface: Cloud
        Is this bug one that gets persisted to the cloud? We may decide that we don't persist low confidence issues to the database to avoid overloading it
        Specified by:
        canStoreUserAnnotation in interface Cloud
      • getUserEvaluation

        public java.lang.String getUserEvaluation​(BugInstance b)
        Description copied from interface: Cloud
        Get free text evaluation of the bug
        Specified by:
        getUserEvaluation in interface Cloud
      • getUserTimestamp

        public long getUserTimestamp​(BugInstance b)
        Description copied from interface: Cloud
        Return the time the user last changed their evaluation of this bug
        Specified by:
        getUserTimestamp in interface Cloud
      • updatedStatus

        protected void updatedStatus()
      • updatedIssue

        public void updatedIssue​(BugInstance bug)
      • fireIssueDataDownloadedEvent

        protected void fireIssueDataDownloadedEvent()
      • getBugByHash

        public BugInstance getBugByHash​(java.lang.String hash)
      • getUsernameLookup

        protected NameLookup getUsernameLookup()
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • setStatusMsg

        public void setStatusMsg​(java.lang.String newMsg)
      • getCloudProperty

        protected java.lang.String getCloudProperty​(java.lang.String propertyName)
      • supportsSourceLinks

        public boolean supportsSourceLinks()
        Description copied from interface: Cloud
        Does the cloud support source lines (e.g., to FishEye)
        Specified by:
        supportsSourceLinks in interface Cloud
      • getSourceLink

        @CheckForNull
        public java.net.URL getSourceLink​(BugInstance b)
        Description copied from interface: Cloud
        URL to view the source for a bug instance
        Specified by:
        getSourceLink in interface Cloud
      • getSourceLinkToolTip

        public java.lang.String getSourceLinkToolTip​(BugInstance b)
        Description copied from interface: Cloud
        Tool tip text for "view source" button
        Specified by:
        getSourceLinkToolTip in interface Cloud
      • getBugIsUnassigned

        public boolean getBugIsUnassigned​(BugInstance b)
        Description copied from interface: Cloud
        does the issue have an unassigned issue in the bug tracker
        Specified by:
        getBugIsUnassigned in interface Cloud
      • getWillNotBeFixed

        public boolean getWillNotBeFixed​(BugInstance b)
        Description copied from interface: Cloud
        has the issue been marked "will not be fixed" in a bug tracker
        Specified by:
        getWillNotBeFixed in interface Cloud
      • getCloudName

        public java.lang.String getCloudName()
        Specified by:
        getCloudName in interface Cloud
      • communicationInitiated

        public boolean communicationInitiated()
        Description copied from interface: Cloud
        Returns true if communication has already been initiated (and perhaps completed).
        Specified by:
        communicationInitiated in interface Cloud
      • getLocalFirstSeen

        public long getLocalFirstSeen​(BugInstance b)