Package com.atlassian.bamboo.utils.error
Interface ErrorCollection
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AboutAction
,AbstractAdminRestAction
,AbstractBranchTriggerConfigAction
,AbstractContinuableBuildAction
,AbstractCreateDeploymentVersion
,AbstractCreateNewJiraIssueAction
,AbstractDeploymentProjectConfigurationAction
,AbstractDeploymentProjectDetailsAction
,AbstractDeploymentVersionAction
,AbstractDeploymentVersionHistoryAction
,AbstractEntityPagerSupport
,AbstractEnvironmentConfigurationAction
,AbstractExistingLinkedRepositoryAdminAction
,AbstractExistingProjectRepositoryAction
,AbstractJiraIssueAction
,AbstractJiraRelatedAction
,AbstractLinkedRepositoryAction
,AbstractMigrationAction
,AbstractNotificationBulkAction
,AbstractPermissionAction
,AbstractPluginConfigurationAction
,AbstractProjectRepositoryAction
,AbstractRemoteAgentAuthenticationAction
,AbstractRepositoryAction
,AbstractRepositoryBulkAction
,AbstractSetupAction
,AbstractViewCapabilitiesByType
,AccessDeniedAction
,AddNotificationBulkAction
,AddRemoteAgent
,AddSharedLocalBuilderCapability
,AddSharedLocalCapability
,AddSharedRemoteCapability
,AddStageAction
,AdminErrorAction
,AdministerAction
,AdministerAuthors
,AdminUpdateLicenseAction
,AgentConsoleAction
,AgentJsonProvider
,AllBuildsRssFeedAction
,AllElasticInstancesAction
,AllowLicenseUpdateOrShowExpirationInfo
,ArtifactUrlRedirectAction
,AvailableVariablesAction
,Backup
,BambooActionSupport
,BambooAgentInstallerAction
,BambooCancellableAction
,BuildActionSupport
,BuildConfigurationSupport
,BuildExpiryAction
,BuildJsonProviderAction
,BuildResultsAction
,BulkEditBuildPermissions
,BulkPlanAction
,CancelChainCreation
,CapabilityConfigurationSupport
,ChainActionSupport
,ChainResultProviderAction
,ChainResultsAction
,ChangeEmail
,ChangeForgottenPassword
,ChangePassword
,CloneDeploymentProject
,CloneEnvironment
,ConfigurationAction
,ConfigureAgentAssignments
,ConfigureAgentCapability
,ConfigureAgentDetails
,ConfigureAgents
,ConfigureAlias
,ConfigureArtifactHandlers
,ConfigureArtifactStorage
,ConfigureArtifactSubscription
,ConfigureBranches
,ConfigureBuildArtifact
,ConfigureBuildDetails
,ConfigureBuildDocker
,ConfigureBuildMiscellaneousOptions
,ConfigureBuildNotification
,ConfigureBuildPermissions
,ConfigureBuildRequirement
,ConfigureBuildTasks
,ConfigureCapability
,ConfigureCapabilityKey
,ConfigureChainBranchRepositories
,ConfigureChainNotification
,ConfigureChainRepositories
,ConfigureChainTrigger
,ConfigureChainTriggers
,ConfigureCloverPlugin
,ConfigureConcurrentBuilds
,ConfigureDeploymentProject
,ConfigureDeploymentProjectDetails
,ConfigureDeploymentProjectPermissions
,ConfigureDeploymentProjectSpecsRepositories
,ConfigureDeploymentProjectVersioning
,ConfigureElasticCapability
,ConfigureElasticCloudAction
,ConfigureElasticImageConfiguration
,ConfigureElasticImageConfigurationAssignments
,ConfigureElasticInstanceSchedule
,ConfigureElasticInstanceSchedules
,ConfigureEnvironment
,ConfigureEnvironmentAgents
,ConfigureEnvironmentDocker
,ConfigureEnvironmentMiscellaneousSettings
,ConfigureEnvironmentNotifications
,ConfigureEnvironmentPermissions
,ConfigureEnvironmentTasks
,ConfigureEnvironmentTriggers
,ConfigureEphemeralAgents
,ConfigureEphemeralAgentTemplateAssignments
,ConfigureEphemeralAgentTemplateCapability
,ConfigureGlobalBuildHangingDetection
,ConfigureGlobalPermissions
,ConfigureGlobalVariables
,ConfigureGroup
,ConfigureInstantMessagingServer
,ConfigureLinkedRepositories
,ConfigureLocalAgentDetails
,ConfigureLog4jAction
,ConfigureMailServer
,ConfigureNotificationPreferences
,ConfigurePage
,ConfigurePerforceManager
,ConfigurePlanDependencies
,ConfigurePlanVariables
,ConfigureProfile
,ConfigureProjectRepositories
,ConfigureProjectSharedCredentials
,ConfigureProjectVariables
,ConfigureQuickFilterAction
,ConfigureQuickFiltersAction
,ConfigureRemoteAgentAuthentications
,ConfigureRepository
,ConfigureSecurity
,ConfigureSharedCapability
,ConfigureSharedCredentials
,ConfigureSharedLocalCapability
,ConfigureSharedRemoteCapability
,ConfigureSpotInstancesAction
,ConfigureSystemNotifications
,ConfigureUser
,ConfigureUserAccessTokens
,ConfigureVariablesForEnvironment
,ConfigureWebhookTemplates
,ContinueBuild
,ControlRemoteAgentsAuthentication
,ControlRemoteAgentsAvailability
,ControlRemoteAgentsTokenVerification
,ConvertLocalToGlobalRepository
,CreateAccessTokensAction
,CreateChain
,CreateChainBranch
,CreateChainRepository
,CreateChainTrigger
,CreateDeploymentProjectDetails
,CreateDeploymentVersion
,CreateEnvironment
,CreateEnvironmentTask
,CreateEnvironmentTrigger
,CreateGlobalVariable
,CreateGroupAction
,CreateInstantMessagingServer
,CreateJob
,CreateLinkedRepository
,CreateNewJiraIssueForBuildResultAction
,CreateNewJiraIssueForTestAction
,CreatePlanVariable
,CreateProject
,CreateProjectRepository
,CreateProjectSharedCredentials
,CreateProjectVariable
,CreateRemoteJiraLinkAction
,CreateRepository
,CreateSharedCredentials
,CreateSpecs
,CreateTask
,CreateTasksChainWizard
,CreateVariableForEnvironment
,CronExpressionGeneratorAction
,DashboardFilter
,DashboardSummaryAction
,DeleteAllNotificationBulkAction
,DeleteBuildFiles
,DeleteBuilds
,DeleteChainAuditLog
,DeleteChainTrigger
,DeleteDeploymentProject
,DeleteDeploymentResult
,DeleteDeploymentVersion
,DeleteEnvironment
,DeleteEnvironmentTask
,DeleteEnvironmentTrigger
,DeleteGitCacheDirectoryAction
,DeleteGlobalVariable
,DeleteLinkedRepository
,DeletePlan
,DeletePlanResults
,DeletePlanVariable
,DeleteProjectRepository
,DeleteProjectSharedCredentials
,DeleteProjectVariable
,DeleteRepository
,DeleteSharedCredentials
,DeleteStageAction
,DeleteTask
,DeleteVariableForEnvironment
,DeploymentProjectAuditLog
,DescribeAgentAvailability
,DescribeAgentAvailability
,DisablePlanBulkAction
,EditAgentCapability
,EditChainBranchDetails
,EditChainBranchNotifications
,EditChainBranchRepository
,EditChainDetails
,EditChainTrigger
,EditCommentAction
,EditDeploymentVersionCommentAction
,EditElasticCapability
,EditEnvironmentTask
,EditEnvironmentTrigger
,EditEphemeralAgentTemplateCapability
,EditJiraIssues
,EditLabelsAction
,EditLinkedRepository
,EditPlanPermissions
,EditProjectDetails
,EditProjectPermissions
,EditProjectRepositories
,EditProjectRepository
,EditProjectSharedCredentials
,EditQuickFilterRuleAction
,EditRemoteAgentAuthenticationIp
,EditRepository
,EditSharedCapability
,EditSharedCredentials
,EditTask
,EnablePlanBulkAction
,ErrorAction
,ErrorEventsAction
,ExecuteManualDeployment
,ExecuteRenameAgentCapability
,Export
,ExportWorldToSpecs
,FilterCookieWriterAction
,FinishSetupAction
,FiveOhOh
,ForgotPassword
,GetFingerprintAction
,GetJiraIssueSchemaAction
,GetPkFileAction
,GlobalAdminAction
,GlobalTrackingConfiguration
,GotoAuthors
,GotoBuildResult
,Import
,ImportMavenPlanAction
,ImportMavenPlanCheckoutPomAction
,ImportMavenPlanCreatePlanAction
,JiraRedirectAction
,LabelRssFeedAction
,LinkTestToJiraIssueAction
,ListBuildResults
,ListChainResults
,ListJobsForChain
,ListProjects
,ListRunningInstances
,LoadGitHubRepositories
,Login
,Login
,Logout
,Logout
,LogToServer
,ManageElasticInstancesAction
,ManageEphemeralAgentsPodsAction
,ManageEphemeralAgentsTemplate
,ManageEphemeralAgentsTemplates
,ManualBuildBulkAction
,ManualEncryptionAction
,MoveBuilds
,MoveEnvironment
,MoveEnvironmentTask
,MoveJobAction
,MoveRepository
,MoveStageAction
,MoveTask
,ParameterisedManualBuild
,PerformanceStatsAction
,PerformanceStatsJmxAction
,PlanActionSupport
,PlanResultsAction
,PlanStatusHistoryAction
,PlansWithCustomExpirySettings
,Profile
,ProjectActionSupport
,QuarantineSettingsAction
,QuickFilterAction
,ReindexAction
,RemoveAdminErrorAction
,RemoveBuildArtifacts
,RemoveBuildError
,RenameAgentCapability
,RenameDeploymentVersion
,ReorderBuild
,ReplaceTriggersAction
,ReplaceTriggersBulkAction
,RepositorySettingsAction
,RerunBuild
,ResetChainBranchRepository
,ResponsibleAvatars
,RestartBuild
,RssConfigurationInterceptorTest
,RssFeedAction
,SearchUserAction
,SelectAgentsAction
,SelectBuildConfigurationTab
,SelectSetupStepAction
,SetAgentBuildFilter
,SetFavouriteAction
,SetResultsFilter
,SetupAdminUserAction
,SetupDatabaseAction
,SetupDatabaseConnectionAction
,SetupEmbeddedDatabaseAction
,SetupGeneralConfiguration
,SetupImportDataAction
,SetupLicenseAction
,SetupUpdateLicenseAction
,ShowLatestBuildStatus
,SignupUser
,SimpleErrorCollection
,SimpleErrorCollectionInternal
,StageAction
,StartElasticAgents
,StarterAction
,StopAllElasticAgents
,StopDeployment
,StopElasticAgents
,StopPlan
,SuspendBuild
,SuspendJob
,SvnBulkAction
,SystemErrorList
,SystemInfoAction
,TestOgnlEscaping
,TransitionJiraIssueAction
,TriggerManualBuild
,TriggerRemoteBuild
,TrustedKeysAction
,UnlinkTestToJiraIssueAction
,UpdateDefaultsLocalCapability
,UpdateGlobalVariable
,UpdateLicenseAction
,UpdatePlanVariable
,UpdateProjectVariable
,UpdateResponsibilitiesAction
,UpdateSvnCredentialsBulkAction
,UpdateSvnUrlBulkAction
,UpdateTaskState
,UpdateVariableForEnvironment
,UpdateWebUrlBulkAction
,UserPickerAction
,ViewActivityLog
,ViewAdministrators
,ViewAgent
,ViewAgentAdmin
,ViewAgentDetails
,ViewAgentDetailsAction
,ViewAgentPlanMatrix
,ViewAgentPlanMatrixWizard
,ViewAgentRecentBuildsSummary
,ViewAgentRecentBuildsSummary
,ViewAgents
,ViewAggregatedAuthors
,ViewAggregatedJobPlugins
,ViewAllDeploymentProjects
,ViewAllRepositories
,ViewAuthor
,ViewAuthorChart
,ViewAuthors
,ViewAuthors
,ViewBambooInternals
,ViewBuild
,ViewBuildError
,ViewBuilders
,ViewBuildFiles
,ViewBuildLogs
,ViewBuildNumberChart
,ViewBuildResults
,ViewBuildResultsByJiraKey
,ViewBuildResultsForLabelAction
,ViewBuildResultsSuccessfulTests
,ViewBuildResultsTable
,ViewBuildResultsTableByPlans
,ViewBuildResultsTests
,ViewBuildTaskTypes
,ViewChainArtifacts
,ViewChainAuditLog
,ViewChainBranches
,ViewChainLogs
,ViewChainResult
,ViewChainSummary
,ViewChainTestResults
,ViewChainWebhookResponses
,ViewCloverBuildResults
,ViewCloverCoverageSummary
,ViewCombinedByTimePeriodChart
,ViewDatabaseConfigurationAction
,ViewDeploymentProjects
,ViewDeploymentProjectSpecs
,ViewDeploymentResult
,ViewDeploymentVersion
,ViewDeploymentVersionCommits
,ViewDeploymentVersionJiraIssues
,ViewDeploymentVersionVariables
,ViewDeploymentWebhookResponses
,ViewElasticAgentHistoryAction
,ViewElasticInstanceAction
,ViewEnvironment
,ViewEnvironmentTaskTypes
,ViewEphemeralAgentPod
,ViewEphemeralAgentPodContainerLogs
,ViewEphemeralAgentTemplate
,ViewGadgetUrls
,ViewGlobalAuditLogAction
,ViewInstancesForConfigurationAction
,ViewJdks
,ViewJiraIssueForPlan
,ViewJiraIssues
,ViewLabels
,ViewLinkedRepository
,ViewLog4jAction
,ViewMaven2ChainSummary
,ViewNextBuildResults
,ViewOfflineAgents
,ViewOfflineElasticAgentDetailsAction
,ViewOfflineElasticAgentDetailsAdminAction
,ViewPlanConfiguration
,ViewPlanSpecs
,ViewPlanStatusByJiraKey
,ViewPlanUpdates
,ViewPreviousBuildResults
,ViewProjectPlans
,ViewProjectRepositories
,ViewProjectRepository
,ViewQuarantinedTests
,ViewRejectedRequirements
,ViewRemoteAgentAuthentications
,ViewReport
,ViewReportChart
,ViewResponsibilitiesForUser
,ViewRunningPlans
,ViewTelemetryAction
,ViewTestCaseAction
,ViewTestCaseResultAction
,ViewTestClassResultAction
,ViewTestsSummary
,ViewTestsSummaryForPlan
,ViewTrackingForBuildResult
,ViewUserDetailsAdminAction
,ViewUserSummary
,ViewWebhookResponseDetails
,YamlValidationAction
public interface ErrorCollection extends Serializable
A very simple interface to collect errors. This is typically used during form validation for collecting field validation errors (useaddError(String, String)
), and general errors (addErrorMessage(String)
) that aren't field-specific (eg. permission problems).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addError(String field, String message)
Add a field-specific error message.void
addError(String prefix, String field, String message)
Adds a new form validation error with a given prefix.void
addErrorCollection(@NotNull ErrorCollection errors)
Populate this ErrorCollection with general and field-specific errors.String
addErrorMessage(String message)
Add error message relating to system state (not field-specific).String
addErrorMessage(String message, Exception e)
void
addErrorMessages(Collection<String> errorMessages)
Append new error messages to those already collected.void
addErrors(Map<String,?> errors)
Deprecated.since 5.1 useaddFieldErrors(java.util.Map)
insteadvoid
addFieldErrors(Map<String,List<String>> errors)
Append new field-specific errors to those already collected.default @NotNull List<String>
getAllErrorMessages()
Get all error messages from this error collection.Collection<String>
getErrorMessages()
Get all non field-specific error messages.Map<String,List<String>>
getErrors()
Get all field-specific errors.Map<String,List<String>>
getFieldErrors()
Collection<String>
getFlushedErrorMessages()
Get error messages, then get rid of them.int
getTotalErrors()
boolean
hasAnyErrors()
Whether any errors (of any type - field-specific or otherwise) have been collected.void
setErrorMessages(Collection<String> errorMessages)
Populate this ErrorCollection with a new set of messages (existing errors are lost).
-
-
-
Method Detail
-
addError
void addError(String field, String message)
Add a field-specific error message.- Parameters:
field
- Field name, eg. "assignee"message
- Error message.
-
addError
void addError(String prefix, String field, String message)
Adds a new form validation error with a given prefix. ie. prefix of "builder.ant" and field "target" will result in a key of "builder.ant.target"- Parameters:
prefix
- The prefix of the field in . formfield
- The id of the form element in errormessage
- The error message to display to the user
-
addErrorMessage
String addErrorMessage(String message)
Add error message relating to system state (not field-specific).- Parameters:
message
- Error message.
-
getErrorMessages
Collection<String> getErrorMessages()
Get all non field-specific error messages.- Returns:
- Collection of error Strings.
-
setErrorMessages
void setErrorMessages(Collection<String> errorMessages)
Populate this ErrorCollection with a new set of messages (existing errors are lost).- Parameters:
errorMessages
- List of error messageString
s.
-
getFlushedErrorMessages
Collection<String> getFlushedErrorMessages()
Get error messages, then get rid of them.- Returns:
- The (now cleared) error messages.
-
getErrors
Map<String,List<String>> getErrors()
Get all field-specific errors.- Returns:
- Map of String: String pairs, eg. {"assignee": "Assignee is required"}
-
addErrorCollection
void addErrorCollection(@NotNull @NotNull ErrorCollection errors)
Populate this ErrorCollection with general and field-specific errors.- Parameters:
errors
- ErrorCollection whose errors/messages we obtain.
-
addErrorMessages
void addErrorMessages(Collection<String> errorMessages)
Append new error messages to those already collected.- Parameters:
errorMessages
- Collection of error strings.
-
addErrors
@Deprecated void addErrors(Map<String,?> errors)
Deprecated.since 5.1 useaddFieldErrors(java.util.Map)
insteadAppend new field-specific errors to those already collected.- Parameters:
errors
- AMap
fromString
field names, toString
error messages, orCollection
s ofString
error messages.
-
addFieldErrors
void addFieldErrors(Map<String,List<String>> errors)
Append new field-specific errors to those already collected.- Parameters:
errors
- AMap
fromString
field names, toString
error messages, orCollection
s ofString
error messages.
-
hasAnyErrors
boolean hasAnyErrors()
Whether any errors (of any type - field-specific or otherwise) have been collected.- Returns:
true
if there are errors;false
otherwise.
-
getTotalErrors
int getTotalErrors()
-
-