Class WebService

java.lang.Object
org.deltava.service.WebService
Direct Known Subclasses:
AcademyRideCountService, AIRACVersionService, AircraftListService, AirlineListService, AirportListService, AirportWeatherService, AllFlightsService, APICodeService, AvailableFlightLegService, AvailableFlightService, BandwidthInfoService, CacheClearService, CacheInfoService, ChatLogService, CheckRideSimulatorService, ClearEndpointsService, ClientVersionService, CoolerQuoteService, CoolerSyndicationService, CustomAirframeService, DatabaseIDService, DiscordInfoService, DiscordUnregisterService, DispatchRouteListService, DownloadService, DraftFlightPlanService, DuplicateNameService, EarthMapLinkService, EliteStatsService, ErrorLogService, EventCalendarService, EventInfoService, EventSyndicationService, ExportService, FeedbackService, FIRInfoService, FIRLayerService, FleetInfoService, FlightDataExportService, FlightStatsService, FlightTimeStatsService, GateService, GateUpdateService, GateUseService, GoogleEarthService, HealthCheckService, ImageLikeService, InstallerInfoService, IssueTemplateService, JobProfileService, JSONDataService, LoadModelService, LoadStatsService, LogbookPreloadService, LogbookService, MapFlightDataService, MapJSONService, MapPlotService, MapProgressJSONService, MapProgressXMLService, MapRouteService, MapService, MapXMLService, METARService, MyFlightsService, MyRouteMapService, MyTrackService, NavaidSearchService, NewsSyndicationService, NoticeSyndicationService, OceanicPlotService, OnlineStatsService, OnTimeStatsService, PackageDownloadService, PackageRefreshService, PartnerRedirectService, PassengerCountService, PilotLocationClearService, PilotLocationService, PilotNominationService, PilotValidationService, RoutePlanService, RouteService, SearchService, SeriesListService, ServicedAirportService, SimFDRService, SimulatorStatsService, SNSReceiverService, StatusService, SubscribeService, SystemInfoService, TAFService, TerminalRouteService, TerminalRouteUpdateService, TestService, TextService, TourLegService, TourService, TrackMetadataUpdateService, UnsubscribeService, UpdateAvailableService, UpdateChannelService, URLCheckService, ValidateCAPTCHAService, XAService

public abstract class WebService extends Object
Web Services are designed to be light-weight objects that are instantiated using a no-argument constructor and then passed a request and a response.
Since:
1.0
Version:
8.2
Author:
Luke
  • Constructor Details

    • WebService

      public WebService()
  • Method Details

    • execute

      public abstract int execute(ServiceContext ctx) throws ServiceException
      Executes the Web Service.
      Parameters:
      ctx - the Web Service context
      Returns:
      the HTTP status code
      Throws:
      ServiceException - if an error occurs
    • isSecure

      public boolean isSecure()
      Returns whether this web service requires authentication.
      Returns:
      TRUE if authentication is required, otherwise FALSE
    • isLogged

      public boolean isLogged()
      Returns whether this web service calls are logged. High volume services like the Map/ServInfo route services will not be logged.
      Returns:
      TRUE if invocation logging should be performed by the servlet, otherwise FALSE
    • error

      protected static ServiceException error(int code, String msg)
      Creates a ServiceException. This method allows subclasses outside the default package to create a new ServiceException, which has a package-private constructor.
      Parameters:
      code - the HTTP code
      msg - the error message
      Returns:
      ServiceException the newly-created ServiceException
      See Also:
    • error

      protected static ServiceException error(int code, String msg, boolean dumpStack)
      Creates a ServiceException. This method allows subclasses outside the default package to create a new ServiceException, which has a package-private constructor.
      Parameters:
      code - the HTTP code
      msg - the error message
      dumpStack - TRUE if a stack dump should be logged, otherwise FALSE
      Returns:
      ServiceException the newly-created ServiceException
      See Also:
    • error

      protected static ServiceException error(int code, String msg, Throwable t)
      Creates a ServiceException. This method allows subclasses outside the default package to create a new ServiceException, which has a package-private constructor.
      Parameters:
      code - the HTTP code
      msg - the error message
      t - the root exception
      Returns:
      ServiceException the newly-created ServiceException
      See Also:
    • getCount

      protected static int getCount(ServiceContext sctxt, int defaultValue)
      Helper method to return the number of entries to display.
      Parameters:
      sctxt - the Service Context
      defaultValue - the default number of entries
      Returns:
      the value of the count parameter, or defaultVlue