Package edu.umd.cs.findbugs.cloud
Class BugCollectionStorageCloud
- java.lang.Object
-
- edu.umd.cs.findbugs.cloud.AbstractCloud
-
- edu.umd.cs.findbugs.cloud.BugCollectionStorageCloud
-
- All Implemented Interfaces:
Cloud
public class BugCollectionStorageCloud extends AbstractCloud
A basic "cloud" that stores information to the bug collection analysis XML file.- Author:
- pwilliam
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface edu.umd.cs.findbugs.cloud.Cloud
Cloud.BugFilingStatus, Cloud.CloudListener, Cloud.CloudStatusListener, Cloud.CloudTask, Cloud.CloudTaskListener, Cloud.Mode, Cloud.SigninState, Cloud.UserDesignation
-
-
Field Summary
-
Fields inherited from class edu.umd.cs.findbugs.cloud.AbstractCloud
bugCollection, MIN_TIMESTAMP, plugin, properties, THROW_EXCEPTION_IF_CANT_CONNECT
-
-
Constructor Summary
Constructors Constructor Description BugCollectionStorageCloud(CloudPlugin plugin, BugCollection bc, java.util.Properties properties)Constructor is not protected to allow CloudFactory.createCloudWithoutInitializing() create a new instance of this cloud
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDateSeen(BugInstance b, long when)booleanavailableForInitialization()Do we have the configuration information needed to try initializing the cloud; calling this method should have no side effects and not display any dialogs or make any network connections.voidbugFiled(BugInstance b, java.lang.Object bugLink)Note that we've initiated or completed a request to file a bug;voidbugsPopulated()Called after the bugs in the bug collection are loaded; bugs should not be synchronized before this method is calledprotected java.lang.Iterable<BugDesignation>getLatestDesignationFromEachUser(BugInstance bd)Cloud.ModegetMode()Get voting modeBugDesignationgetPrimaryDesignation(BugInstance b)Get the most recent BugDesignation from the current userjava.util.Collection<java.lang.String>getProjects(java.lang.String className)Get a list of names of FB projects that the given class "may be a part of." Used for filing bugs.java.lang.StringgetUser()Cloud.UserDesignationgetUserDesignation(BugInstance b)Get the user's designation for the bugjava.lang.StringgetUserEvaluation(BugInstance b)Get free text evaluation of the buglonggetUserTimestamp(BugInstance b)Return the time the user last changed their evaluation of this bugbooleaninitialize()Attempt to initialize the cloudvoidinitiateCommunication()Initiate communication with the cloud.booleanisInCloud(BugInstance b)returns whether the bug is stored remotely or not.booleanisOnlineCloud()booleanisSavingSignInInformationEnabled()voidsetMode(Cloud.Mode m)Set voting modevoidsetSaveSignInInformation(boolean save)Whether the cloud should save login information, session ID's, etc.voidsignIn()voidsignOut()voidstoreUserAnnotation(BugInstance bugInstance)Update user designation and evaluation from information in bug instance and push to databasevoidwaitUntilIssueDataDownloaded()Waits until all data about this bug collection has been received from the cloud.booleanwaitUntilIssueDataDownloaded(long timeout, java.util.concurrent.TimeUnit unit)voidwaitUntilNewIssuesUploaded()Waits until all new issues have been uploadedbooleanwaitUntilNewIssuesUploaded(long timeout, java.util.concurrent.TimeUnit unit)-
Methods inherited from class edu.umd.cs.findbugs.cloud.AbstractCloud
addListener, addStatusListener, canSeeCommentsByOthers, canStoreUserAnnotation, claim, claimedBy, communicationInitiated, createTask, fileBug, fireIssueDataDownloadedEvent, getBugByHash, getBugCollection, getBugIsUnassigned, getBugLink, getBugLinkStatus, getBugLinkType, getBugStatus, getClassificationDisagreement, getClassificationScore, getClassificationVariance, getCloudName, getCloudProperty, getCloudReport, getCloudReportWithoutMe, getConsensusDesignation, getFirstSeen, getGuiCallback, getIWillFix, getLocalFirstSeen, getNumberReviewers, getPlugin, getPortionObsoleteClassifications, getReviewers, getSigninState, getSourceLink, getSourceLinkToolTip, getStatusMsg, getUserDate, getUsernameLookup, getWillNotBeFixed, hasVoted, isInitialized, issueDataHasBeenDownloaded, notInCloudMsg, overallClassificationIsNotAProblem, printCloudSummary, printLeaderBoard2, removeListener, removeStatusListener, setBugLinkOnCloudAndStoreIssueDetails, setSigninState, setStatusMsg, shutdown, supportsBugLinks, supportsClaims, supportsCloudReports, supportsCloudSummaries, supportsSourceLinks, updateBugStatusCache, updatedIssue, updatedStatus
-
-
-
-
Constructor Detail
-
BugCollectionStorageCloud
public BugCollectionStorageCloud(CloudPlugin plugin, BugCollection bc, java.util.Properties properties)
Constructor is not protected to allow CloudFactory.createCloudWithoutInitializing() create a new instance of this cloud
-
-
Method Detail
-
initialize
public boolean initialize()
Description copied from interface:CloudAttempt to initialize the cloud- Specified by:
initializein interfaceCloud- Overrides:
initializein classAbstractCloud- Returns:
- true if successful
-
waitUntilIssueDataDownloaded
public void waitUntilIssueDataDownloaded()
Description copied from interface:CloudWaits until all data about this bug collection has been received from the cloud.
-
initiateCommunication
public void initiateCommunication()
Description copied from interface:CloudInitiate communication with the cloud. Clouds can implement lazy communication, where they don't initiate communication with the cloud until a request for cloud data is seen, or a call is made toCloud.waitUntilIssueDataDownloaded(). A call to this method forces eager initiation of communication.
-
waitUntilNewIssuesUploaded
public boolean waitUntilNewIssuesUploaded(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
waitUntilIssueDataDownloaded
public boolean waitUntilIssueDataDownloaded(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
getMode
public Cloud.Mode getMode()
Description copied from interface:CloudGet voting mode- Specified by:
getModein interfaceCloud- Overrides:
getModein classAbstractCloud
-
getUser
public java.lang.String getUser()
-
getUserDesignation
public Cloud.UserDesignation getUserDesignation(BugInstance b)
Description copied from interface:CloudGet the user's designation for the bug- Specified by:
getUserDesignationin interfaceCloud- Overrides:
getUserDesignationin classAbstractCloud
-
getUserEvaluation
public java.lang.String getUserEvaluation(BugInstance b)
Description copied from interface:CloudGet free text evaluation of the bug- Specified by:
getUserEvaluationin interfaceCloud- Overrides:
getUserEvaluationin classAbstractCloud
-
getUserTimestamp
public long getUserTimestamp(BugInstance b)
Description copied from interface:CloudReturn the time the user last changed their evaluation of this bug- Specified by:
getUserTimestampin interfaceCloud- Overrides:
getUserTimestampin classAbstractCloud
-
setMode
public void setMode(Cloud.Mode m)
Description copied from interface:CloudSet voting mode- Specified by:
setModein interfaceCloud- Overrides:
setModein classAbstractCloud
-
bugsPopulated
public void bugsPopulated()
Description copied from interface:CloudCalled after the bugs in the bug collection are loaded; bugs should not be synchronized before this method is called- Specified by:
bugsPopulatedin interfaceCloud- Overrides:
bugsPopulatedin classAbstractCloud
-
setSaveSignInInformation
public void setSaveSignInInformation(boolean save)
Description copied from interface:CloudWhether the cloud should save login information, session ID's, etc. If disabled, the user will need to re-authenticate each session.
-
isSavingSignInInformationEnabled
public boolean isSavingSignInInformationEnabled()
-
signIn
public void signIn()
-
signOut
public void signOut()
-
availableForInitialization
public boolean availableForInitialization()
Description copied from interface:CloudDo we have the configuration information needed to try initializing the cloud; calling this method should have no side effects and not display any dialogs or make any network connections.- Returns:
- true if we have the needed information
-
storeUserAnnotation
public void storeUserAnnotation(BugInstance bugInstance)
Description copied from interface:CloudUpdate user designation and evaluation from information in bug instance and push to database
-
bugFiled
public void bugFiled(BugInstance b, java.lang.Object bugLink)
Description copied from interface:CloudNote that we've initiated or completed a request to file a bug;- Parameters:
b- bug against which bug was filedbugLink- if we have any information about the result of filing the bug, it should go here
-
getPrimaryDesignation
public BugDesignation getPrimaryDesignation(BugInstance b)
Description copied from interface:CloudGet the most recent BugDesignation from the current user
-
getLatestDesignationFromEachUser
protected java.lang.Iterable<BugDesignation> getLatestDesignationFromEachUser(BugInstance bd)
- Specified by:
getLatestDesignationFromEachUserin classAbstractCloud
-
getProjects
public java.util.Collection<java.lang.String> getProjects(java.lang.String className)
Description copied from interface:CloudGet a list of names of FB projects that the given class "may be a part of." Used for filing bugs.
-
isInCloud
public boolean isInCloud(BugInstance b)
Description copied from interface:Cloudreturns whether the bug is stored remotely or not. for bug collection storage, always returns true
-
isOnlineCloud
public boolean isOnlineCloud()
-
waitUntilNewIssuesUploaded
public void waitUntilNewIssuesUploaded()
Description copied from interface:CloudWaits until all new issues have been uploaded
-
addDateSeen
public void addDateSeen(BugInstance b, long when)
- Specified by:
addDateSeenin interfaceCloud- Overrides:
addDateSeenin classAbstractCloud
-
-