DataContext.java

  1. /* Contributed in the public domain.
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.data;

  18. import org.orekit.annotation.DefaultDataContext;
  19. import org.orekit.bodies.CelestialBodies;
  20. import org.orekit.forces.gravity.potential.GravityFields;
  21. import org.orekit.frames.Frames;
  22. import org.orekit.frames.FramesFactory;
  23. import org.orekit.models.earth.GeoMagneticFields;
  24. import org.orekit.models.earth.ionosphere.KlobucharIonoCoefficientsLoader;
  25. import org.orekit.time.TimeScales;
  26. import org.orekit.time.TimeScalesFactory;

  27. /**
  28.  * Provides auxiliary data for portions of the application.
  29.  *
  30.  * @author Evan Ward
  31.  * @since 10.1
  32.  */
  33. public interface DataContext {

  34.     /**
  35.      * Get the default data context that is used to implement the static factories ({@link
  36.      * TimeScalesFactory}, {@link FramesFactory}, etc) and loaders that feed themselves
  37.      * (e.g. {@link KlobucharIonoCoefficientsLoader}). It is used to maintain
  38.      * compatibility with auxiliary data loading in Orekit 10.0.
  39.      *
  40.      * @return Orekit's default data context.
  41.      */
  42.     @DefaultDataContext
  43.     static LazyLoadedDataContext getDefault() {
  44.         return DefaultDataContextHolder.getInstance();
  45.     }

  46.     /**
  47.      * Set the default data context that is used to implement Orekit's static factories.
  48.      *
  49.      * <p> Calling this method will not modify any instances already retrieved from
  50.      * Orekit's static factories. In general this method should only be called at
  51.      * application start up before any of the static factories are used.
  52.      *
  53.      * @param context the new data context.
  54.      * @see #getDefault()
  55.      */
  56.     static void setDefault(final LazyLoadedDataContext context) {
  57.         DefaultDataContextHolder.setInstance(context);
  58.     }

  59.     /**
  60.      * Get a factory for constructing {@link org.orekit.time.TimeScale}s based on the auxiliary data in
  61.      * this context.
  62.      *
  63.      * @return the set of common time scales using this data context.
  64.      */
  65.     TimeScales getTimeScales();

  66.     /**
  67.      * Get a factory constructing {@link org.orekit.frames.Frame}s based on the auxiliary data in this
  68.      * context.
  69.      *
  70.      * @return the set of common reference frames using this data context.
  71.      */
  72.     Frames getFrames();

  73.     /**
  74.      * Get a factory constructing {@link org.orekit.bodies.CelestialBody}s based on the auxiliary data in
  75.      * this context.
  76.      *
  77.      * @return the set of common celestial bodies using this data context.
  78.      */
  79.     CelestialBodies getCelestialBodies();

  80.     /**
  81.      * Get a factory constructing gravity fields based on the auxiliary data in this
  82.      * context.
  83.      *
  84.      * @return the gravity fields using this data context.
  85.      */
  86.     GravityFields getGravityFields();

  87.     /**
  88.      * Get a factory constructing {@link org.orekit.models.earth.GeoMagneticField}s based on the auxiliary
  89.      * data in this context.
  90.      *
  91.      * @return the geomagnetic fields using this data context.
  92.      */
  93.     GeoMagneticFields getGeoMagneticFields();

  94. }