Class AbstractCommand
java.lang.Object
org.deltava.commands.AbstractCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
AbstractAcademyHistoryCommand, AbstractCalendarCommand, AbstractFormCommand, AbstractLibraryCommand, AbstractTestHistoryCommand, AbstractViewCommand, ACARSDeleteCommand, AccomplishmentAirportMapCommand, AccomplishmentCheckCommand, AccomplishmentDeleteCommand, AccomplishmentEligibilityCommand, AccomplishmentUpdateCommand, AirlineInformationListCommand, AirlineListCommand, AirlineTotalsCommand, AirportDeleteCommand, AirportExportCommand, AirportInformationCommand, APIStatsCommand, ApplicantApproveCommand, ApplicantDeleteCommand, ApplicantFindCommand, ApplicantRejectCommand, ApplicationCommand, AssignmentCommand, AssignmentDeleteCommand, AssignmentReleaseCommand, AssignmentReserveCommand, AssignmentSaveCommand, AUSOTPlotCommand, BlacklistDeleteCommand, BriefingCommand, BuildCommand, CenturyClubCommand, CertificationDeleteCommand, CertificationListCommand, ChannelAdminCommand, ChannelDeleteCommand, ChannelListCommand, ChartDeleteCommand, CharterRequestDeleteCommand, CharterRequestDisposeCommand, ChartsCommand, CheckRideCommand, CheckRidePIREPApprovalCommand, CheckRidePIREPCommand, CheckRideScoreCommand, CheckRideScriptDeleteCommand, ClientStatsCommand, CommandStatsCommand, ConnectionInfoDeleteCommand, ContentOverrideCommand, ContentReportCommand, CookieCheckCommand, CookieDataCommand, CourseAssignCommand, CourseCheckRideCommand, CourseCommentCommand, CourseDeleteCommand, CourseDisposalCommand, CourseProgressCommand, DashboardCommand, DiagnosticCommand, DiscordRegistrationCommand, DispatcherStatsCommand, DispatchRouteUpdateCommand, DuplicatePilotCommand, DuplicatePilotMergeCommand, DuplicatePilotSearchCommand, EliteInfoCommand, EliteLevelSetCommand, EliteLifetimeDeleteCommand, ElitePilotsCommand, EliteRolloverCommand, EliteStatsCommand, EliteStatusCalculateCommand, EmoticonHelperCommand, ErrorLogDeleteCommand, ErrorLogEntryCommand, ErrorLogPurgeCommand, EventAssignCommand, EventBalanceCommand, EventCancelCommand, EventCommand, EventDeleteCommand, EventEditCommand, EventReleaseCommand, EventSaveCommand, EventSignupCommand, ExamCommand, ExamDeleteCommand, ExamProfileDeleteCommand, ExamProfilesCommand, ExamScoreCommand, ExamSubmitCommand, ExternalPIREPApprovalCommand, ExternalPIREPCommand, FAAChartDownloadCommand, FindFlightCommand, FlightBoardCommand, FlightBoardMapCommand, FlightInfoCommand, FlightInfoDeleteCommand, FlightPreapproveCommand, ForgetUserCommand, GalleryDeleteCommand, GateCalculateCommand, GateInformationCommand, HelpDeskSearchCommand, HomeCommand, IMAPDeleteCommand, ImportStatusCommand, InactivityListCommand, InstallerStatsCommand, InstructionCancelCommand, InstructorBusyDeleteCommand, InstructorBusySaveCommand, InvalidateEmailCommand, IPBlockImportCommand, IPGeoImportCommand, IssueCloseCommand, IssueCommentCommand, IssueCommentCommand, IssueConvertCommand, IssueConvertCommand, IssueSearchCommand, IssueUpdateCommand, JobApproveCommand, JobCloneCommand, JobCommentCommand, JobCompleteCommand, JobDeleteCommand, JobResetCommand, LeaveCommand, LinkImageCommand, LiveryDeleteCommand, LoadCalculateCommand, LoadInfoCommand, LoginCommand, LogoutCommand, ManualDeleteCommand, MapCommand, MapCommand, MassMailingCommand, MembershipStatsCommand, MessageTemplateDeleteCommand, NATPlotCommand, NavaidSearchCommand, NavDataImportCommand, NavigationCycleCommand, NetworkServersCommand, NewAirportListCommand, NewsDeleteCommand, NewsEditCommand, NewsSaveCommand, NominationCenterCommand, NominationDisposeCommand, NominationPostponeCommand, NominationPurgeCommand, NominationRescoreCommand, NOTAMEditCommand, NOTAMSaveCommand, NotificationClearCommand, NotificationListUpdateCommand, NotificationToggleCommand, OfflineFlightCommand, PACOTPlotCommand, PartnerDeleteCommand, PasswordResetCommand, PilotActivationCommand, PilotBoardCommand, PilotLocationCommand, PilotRecognitionCommand, PilotRouteMapCommand, PilotSearchCommand, PIREPDeleteCommand, PIREPDisposalCommand, PIREPEliteScoreCommand, PIREPReleaseCommand, PIREPSubmitCommand, PIREPWithdrawCommand, PostDeleteCommand, PrivacyInfoCommand, PromotionToggleCommand, QuestionDeleteCommand, QuestionIncludeCommand, QuestionnaireCommand, QuestionnaireScoreCommand, QuestionnaireSubmitCommand, QuestionProfileSearchCommand, RatingCountCommand, RedirectCommand, RegisterCommand, ResendValidationCommand, ResendValidationCommand, ResetCommand, ResourceDeleteCommand, ResourceJumpCommand, ResponseTemplateDeleteCommand, RestoreImageLinksCommand, RetireUserCommand, ReturnCharterCommand, RideScriptDeleteCommand, RideScriptsCommand, RouteAssignmentBuildCommand, RouteAssignmentSearchCommand, RouteCommand, RouteCommand, RouteDeleteCommand, RouteMapCommand, RoutePlotCommand, RoutePlotCommand, RouteSaveCommand, RouteSearchCommand, RouteToggleCommand, RunwayCalculateCommand, RunwayChoiceCommand, ScheduleDeleteCommand, ScheduleExportCommand, ScheduleFilterCommand, ScheduleImportCommand, ScheduleSyncCommand, SecurityRoleMembersCommand, SELCALReserveCommand, ServiceEntryDeleteCommand, ShortListCommand, SignatureApproveCommand, SignatureUpdateCommand, SingleAssignmentBuildCommand, SingleAssignmentSearchCommand, StaffProfileCommand, StaffRosterCommand, StatusCommentCommand, SuspendUserCommand, TaskExecuteCommand, ThreadCommand, ThreadDeleteCommand, ThreadLockCommand, ThreadMoveCommand, ThreadPostCommand, ThreadReplyCommand, ThreadStickCommand, ThreadSubjectEditCommand, ThreadUnlockCommand, ThreadUnstickCommand, TourDeleteCommand, TrackMapCommand, TransferAirlineCommand, TransferApproveCommand, TransferConvertCommand, TransferDeleteCommand, TransferProcessCommand, TransferRejectCommand, UnlinkImageCommand, UnreadClearCommand, UnservicedAirportsCommand, UpdateCommentsCommand, UpdateEmailCommand, UpdateEventCommand, UpdateRunwayCommand, UpdateTouchdownCommand, UpdateTourCommand, UserFileDeleteCommand, UserListCommand, UserSwitchCommand, ValidateEmailCommand, ValidateEMailCommand, VideoDeleteCommand, WeatherCenterCommand, WeatherFinderCommand, WelcomeMessageCommand, YearlyReviewCommand
-
Nested Class Summary
Nested classes/interfaces inherited from interface Command
Command.Scope -
Field Summary
Fields inherited from interface Command
ID, OPERATION, PAGE, REQUEST, SESSIONModifier and TypeFieldDescriptionstatic final intstatic final intstatic final Command.Scopestatic final Command.Scopestatic final Command.Scope -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static CommandExceptionHelper method to generate a content blocked exception.final StringgetID()Return the ID of the command.final StringgetName()Return the name of the command.final Collection<String> getRoles()Return the roles authorized to execute this command.voidInitialize the Command.protected static CommandExceptionnotFoundException(String msg, int id) Helper method to generate an "item not found" exception for a given database ID.protected static CommandExceptionnotFoundException(String msg, Object id) Helper method to generate an "item not found" exception for a given ID.protected static InstantparseDateTime(CommandContext ctx, String paramHdr) Parses one or two HTTP request parameters into a date/time value, using the user's format patterns or the default format patterns if the user is not authenticated.protected static InstantparseDateTime(CommandContext ctx, String paramHdr, String dfmt, String tfmt) Parses one or two HTTP request parameters into a date/time value.protected static CommandExceptionsecurityException(String msg) Helper method to generate a security exception.final voidsetRoles(Collection<String> roles) Updates the roles authorized to execute this command.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AbstractCommand
public AbstractCommand()
-
-
Method Details
-
init
Description copied from interface:CommandInitialize the Command. Since commands are instantiated via reflection, the init method is used to run data that would ordinarily be in the constructor. -
securityException
Helper method to generate a security exception.- Parameters:
msg- the exception message- Returns:
- a CommandException
-
forgottenException
Helper method to generate a content blocked exception.- Returns:
- a CommandException
-
notFoundException
Helper method to generate an "item not found" exception for a given database ID.- Parameters:
msg- the exception messageid- the database ID- Returns:
- a CommandException
-
notFoundException
Helper method to generate an "item not found" exception for a given ID.- Parameters:
msg- the exception messageid- the ID- Returns:
- a CommandException
-
getName
-
getID
-
getRoles
Return the roles authorized to execute this command. If setRoles() has not been called, this will return an empty Set. Commands defined to be executed by all users should have a wildcard entry (*) as an authorized role. -
setRoles
Updates the roles authorized to execute this command. This will make a copy of the List object provided (ie. making it immutable) for security reasons.- Specified by:
setRolesin interfaceCommand- Parameters:
roles- the List of role names- Throws:
IllegalStateException- if setRoles() has already been called- See Also:
-
parseDateTime
protected static Instant parseDateTime(CommandContext ctx, String paramHdr, String dfmt, String tfmt) Parses one or two HTTP request parameters into a date/time value. The parameter name header is used to construct the request parameter names. If the request contains a parameter called "$HDR$dateTime", then the parameter will be parsed as a date/time value. If the request contains two parameters named "$HDR$date" and "$HDR$time", then they will be appended and parsed together. If only a single parameter is found, it is parsed appropriately.- Parameters:
ctx- the Command ContextparamHdr- the parameter name headerdfmt- the date format patterntfmt- time time format pattern- Returns:
- a date/time value, or null if not found or unparseable
-
parseDateTime
Parses one or two HTTP request parameters into a date/time value, using the user's format patterns or the default format patterns if the user is not authenticated.- Parameters:
ctx- the Command ContextparamHdr- the parameter name header- Returns:
- a date/time value, or null if not found or unparseable
- See Also:
-