' Copyright 2002-2022 CS GROUP
' Licensed to CS GROUP (CS) under one or more
' contributor license agreements.  See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' CS licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License.  You may obtain a copy of the License at
'
'   http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
 
@startuml

  skinparam svek                  true
  skinparam ClassBackgroundColor  #F3EFEB/CCC9C5
  skinparam ClassArrowColor       #691616
  skinparam ClassBorderColor      #691616
  skinparam NoteBackgroundColor   #F3EFEB
  skinparam NoteBorderColor       #691616
  skinparam NoteFontColor         #691616
  skinparam ClassFontSize         11
  skinparam PackageFontSize       12
  skinparam linetype              ortho

  package org.orekit #ECEBD8 {

    package data #DDEBD8 {

      class FiltersManager {
        +addFilter(final DataFilter filter)
        +void clearFilters()
        +DataSource applyRelevantFilters(final DataSource original)
      }

      class DataSource {
        +String getName()
        +DataSource.Opener getOpener()
      }

      interface DataFilter {
         DataSource filter(DataSource original)
      }

      interface DataSource.Opener {
        +boolean rawDataIsBinary()
        +InputStream openStreamOnce()
        +Reader      openReaderOnce()
      }
      note left
        allows lazy opening of stream or reader
        beware it may fail if called more than once
        especially with network-based streams
      end note

      FiltersManager "1" o--> "*" DataFilter: applies
      DataSource <-down- DataFilter : filters
      DataSource --> DataSource.Opener
      DataFilter <|-- GzipFilter
      DataFilter <|-- UnixFilter

      UnixFilter --> DataSource.Opener : creates
      GzipFilter --> DataSource.Opener : creates
 
    }

    package gnss #DDEBD8 {
      class HatanakaCompressFilter
      DataFilter <|-- HatanakaCompressFilter
      DataSource.Opener <-left- HatanakaCompressFilter : creates
   }

  }

@enduml
