Class ArchiveHelper

java.lang.Object
org.deltava.beans.acars.ArchiveHelper

public class ArchiveHelper extends Object
A utility class to handle ACARS position archive hash buckets.
Since:
6.2
Version:
11.2
Author:
Luke
  • Method Details

    • getBucket

      public static String getBucket(int id)
      Calculates the bucket for a given flight ID.
      Parameters:
      id - the flight ID
      Returns:
      the bucket name
    • getPositions

      public static File getPositions(int id)
      Returns the File containing archived ACARS position data.
      Parameters:
      id - the ACARS Flight ID
      Returns:
      a File, which may or may not exist
    • getRoute

      public static File getRoute(int id)
      Returns the File containing archived route data.
      Parameters:
      id - the Flight ID
      Returns:
      a File, which may or may not exist
    • getOnline

      public static File getOnline(int id)
      Returns the File containing archived online data.
      Parameters:
      id - the Flight ID
      Returns:
      a File, which may or may not exist
    • load

      public static byte[] load(ArchiveMetadata md) throws ArchiveValidationException
      Loads and validates a Position Archive.
      Parameters:
      md - an ArchiveMetadata bean
      Returns:
      the loaded and uncompressed data
      Throws:
      ArchiveValidationException - if a validation error occurs
    • load

      public static byte[] load(ArchiveMetadata md, File f) throws ArchiveValidationException
      Loads and validates a Position Archive.
      Parameters:
      md - an ArchiveMetadata bean
      f - the File to use, overriding the default for testing
      Returns:
      the loaded and uncompressed data
      Throws:
      ArchiveValidationException - if a validation error occurs