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 void
addDateSeen(BugInstance b, long when)
boolean
availableForInitialization()
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.void
bugFiled(BugInstance b, java.lang.Object bugLink)
Note that we've initiated or completed a request to file a bug;void
bugsPopulated()
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.Mode
getMode()
Get voting modeBugDesignation
getPrimaryDesignation(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.String
getUser()
Cloud.UserDesignation
getUserDesignation(BugInstance b)
Get the user's designation for the bugjava.lang.String
getUserEvaluation(BugInstance b)
Get free text evaluation of the buglong
getUserTimestamp(BugInstance b)
Return the time the user last changed their evaluation of this bugboolean
initialize()
Attempt to initialize the cloudvoid
initiateCommunication()
Initiate communication with the cloud.boolean
isInCloud(BugInstance b)
returns whether the bug is stored remotely or not.boolean
isOnlineCloud()
boolean
isSavingSignInInformationEnabled()
void
setMode(Cloud.Mode m)
Set voting modevoid
setSaveSignInInformation(boolean save)
Whether the cloud should save login information, session ID's, etc.void
signIn()
void
signOut()
void
storeUserAnnotation(BugInstance bugInstance)
Update user designation and evaluation from information in bug instance and push to databasevoid
waitUntilIssueDataDownloaded()
Waits until all data about this bug collection has been received from the cloud.boolean
waitUntilIssueDataDownloaded(long timeout, java.util.concurrent.TimeUnit unit)
void
waitUntilNewIssuesUploaded()
Waits until all new issues have been uploadedboolean
waitUntilNewIssuesUploaded(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:Cloud
Attempt to initialize the cloud- Specified by:
initialize
in interfaceCloud
- Overrides:
initialize
in classAbstractCloud
- Returns:
- true if successful
-
waitUntilIssueDataDownloaded
public void waitUntilIssueDataDownloaded()
Description copied from interface:Cloud
Waits until all data about this bug collection has been received from the cloud.
-
initiateCommunication
public void initiateCommunication()
Description copied from interface:Cloud
Initiate 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:Cloud
Get voting mode- Specified by:
getMode
in interfaceCloud
- Overrides:
getMode
in classAbstractCloud
-
getUser
public java.lang.String getUser()
-
getUserDesignation
public Cloud.UserDesignation getUserDesignation(BugInstance b)
Description copied from interface:Cloud
Get the user's designation for the bug- Specified by:
getUserDesignation
in interfaceCloud
- Overrides:
getUserDesignation
in classAbstractCloud
-
getUserEvaluation
public java.lang.String getUserEvaluation(BugInstance b)
Description copied from interface:Cloud
Get free text evaluation of the bug- Specified by:
getUserEvaluation
in interfaceCloud
- Overrides:
getUserEvaluation
in classAbstractCloud
-
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 interfaceCloud
- Overrides:
getUserTimestamp
in classAbstractCloud
-
setMode
public void setMode(Cloud.Mode m)
Description copied from interface:Cloud
Set voting mode- Specified by:
setMode
in interfaceCloud
- Overrides:
setMode
in classAbstractCloud
-
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 interfaceCloud
- Overrides:
bugsPopulated
in classAbstractCloud
-
setSaveSignInInformation
public void setSaveSignInInformation(boolean save)
Description copied from interface:Cloud
Whether 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:Cloud
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.- Returns:
- true if we have the needed information
-
storeUserAnnotation
public void storeUserAnnotation(BugInstance bugInstance)
Description copied from interface:Cloud
Update 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:Cloud
Note 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:Cloud
Get the most recent BugDesignation from the current user
-
getLatestDesignationFromEachUser
protected java.lang.Iterable<BugDesignation> getLatestDesignationFromEachUser(BugInstance bd)
- Specified by:
getLatestDesignationFromEachUser
in classAbstractCloud
-
getProjects
public java.util.Collection<java.lang.String> getProjects(java.lang.String className)
Description copied from interface:Cloud
Get 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:Cloud
returns 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:Cloud
Waits until all new issues have been uploaded
-
addDateSeen
public void addDateSeen(BugInstance b, long when)
- Specified by:
addDateSeen
in interfaceCloud
- Overrides:
addDateSeen
in classAbstractCloud
-
-