NetworkRecord.java

  1. /* Copyright 2002-2024 CS GROUP
  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.gnss.metric.ntrip;

  18. /** Network record in source table.
  19.  * @author Luc Maisonobe
  20.  * @since 11.0
  21.  */
  22. public class NetworkRecord extends Record {

  23.     /** Authentication method. */
  24.     private final Authentication authentication;

  25.     /** Indicator for required fees. */
  26.     private final boolean fees;

  27.     /** Build a data stream record by parsing a source table line.
  28.      * @param line source table line
  29.      */
  30.     public NetworkRecord(final String line) {
  31.         super(line);
  32.         this.authentication = Authentication.getAuthentication(getField(3));
  33.         this.fees           = getField(4).equals("Y");
  34.     }

  35.     /** {@inheritDoc} */
  36.     @Override
  37.     public RecordType getRecordType() {
  38.         return RecordType.NET;
  39.     }

  40.     /** Get the network identifier.
  41.      * @return network identifier
  42.      */
  43.     public String getNetworkIdentifier() {
  44.         return getField(1);
  45.     }

  46.     /** Get the institution/agency/company operating the caster.
  47.      * @return institution/agency/company operating the caster
  48.      */
  49.     public String getOperator() {
  50.         return getField(2);
  51.     }

  52.     /** Get the authentication method.
  53.      * @return authentication method
  54.      */
  55.     public Authentication getAuthentication() {
  56.         return authentication;
  57.     }

  58.     /** Check if fees are required.
  59.      * @return true if fees are required
  60.      */
  61.     public boolean areFeesRequired() {
  62.         return fees;
  63.     }

  64.     /** Get the web address for network information.
  65.      * @return web address for network information
  66.      */
  67.     public String getNetworkInfoAddress() {
  68.         return getField(5);
  69.     }

  70.     /** Get the web address for stream information.
  71.      * @return web address for stream information
  72.      */
  73.     public String getStreamInfoAddress() {
  74.         return getField(6);
  75.     }

  76.     /** Get the web or mail address for registration.
  77.      * @return web or mail address for registration
  78.      */
  79.     public String getRegistrationAddress() {
  80.         return getField(7);
  81.     }

  82. }