/*
 * Copyright 2018 The Data Transfer Project Authors.
 *
 * Licensed 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
 *
 * https://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.
 */
package org.datatransferproject.transfer;

import com.google.common.base.Preconditions;

import java.security.KeyPair;
import java.util.UUID;

/**
 * A class that contains metadata for a transfer worker's job.
 *
 * <p>
 *
 * <p>This class is completely static to ensure it is a singleton within each transfer worker
 * instance.
 */
public final class JobMetadata {
  private static KeyPair keyPair = null;
  private static UUID jobId = null;
  private static String dataType = null;
  private static String exportService = null;
  private static String importService = null;

  static boolean isInitialized() {
    return (jobId != null
        && keyPair != null
        && dataType != null
        && exportService != null
        && importService != null);
  }

  static void init(
      UUID initJobId,
      KeyPair initKeyPair,
      String initDataType,
      String initExportService,
      String initImportService) {
    Preconditions.checkState(!isInitialized(), "JobMetadata cannot be initialized twice");
    jobId = initJobId;
    keyPair = initKeyPair;
    dataType = initDataType;
    exportService = initExportService;
    importService = initImportService;
  }

  // TODO: remove this
  static synchronized void reset() {
    jobId = null;
    keyPair = null;
    dataType = null;
    exportService = null;
    importService = null;
  }

  static KeyPair getKeyPair() {
    Preconditions.checkState(isInitialized(), "JobMetadata must be initialized");
    return keyPair;
  }

  static UUID getJobId() {
    Preconditions.checkState(isInitialized(), "JobMetadata must be initialized");
    return jobId;
  }

  static String getDataType() {
    Preconditions.checkState(isInitialized(), "JobMetadata must be initialized");
    return dataType;
  }

  static String getExportService() {
    Preconditions.checkState(isInitialized(), "JobMetadata must be initialized");
    return exportService;
  }

  static String getImportService() {
    Preconditions.checkState(isInitialized(), "JobMetadata must be initialized");
    return importService;
  }
}

@@ -942,16 +942,136 @@
 ce.%0A */%0A
+@SuppressWarnings(%22WeakerAccess%22)%0A// We make the class and various methods public so they can be accessed from Monitors%0A
 public f
@@ -1304,24 +1304,31 @@
  = null;%0A%0A  
+public 
 static boole
@@ -2230,24 +2230,31 @@
 air;%0A  %7D%0A%0A  
+public 
 static UUID 
@@ -2262,24 +2262,24 @@
 etJobId() %7B%0A
-
     Precondi
@@ -2365,32 +2365,39 @@
 n jobId;%0A  %7D%0A%0A  
+public 
 static String ge
@@ -2512,32 +2512,39 @@
 ataType;%0A  %7D%0A%0A  
+public 
 static String ge
@@ -2671,26 +2671,33 @@
 rvice;%0A  %7D%0A%0A
-
   
+public 
 static Strin

Make methods on JobMetadata public