/* * [PC.java] * * Summary: Calculate Pass Control control variables. * * Copyright: (c) 2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2017-03-21 initial version *//** * [PC.java] *

* Summary: Calculate Pass Control control variables *

* Copyright: (c) 2017 Roedy Green, Canadian Mind Products, http://mindprod.com *

* Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html *

* Requires: JDK 1.8+ *

* Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ *

* Version History: * 1.0 2017-03-21 initial version. */ package com.mindprod.brokenlinks; import com.mindprod.http.Get; /** * Calculate Pass Control control variables. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2017-03-21 initial version * @since 2017-03-21 */ public class PC { /** * true if should probe http: on this pass */ final boolean probeNonSSL; /** * true if should probe https: SNI on this pass */ final boolean probeSNI; /** * if fail, should we update the badTimestamp */ final boolean shouldWeUpdateBadTimestamp; /** * constructor */ PC( final int pass ) { switch ( pass ) { case 0: probeNonSSL = true; probeSNI = false; shouldWeUpdateBadTimestamp = true; Get.disableSNI(); break; case 1: probeNonSSL = false; probeSNI = false; shouldWeUpdateBadTimestamp = false; Get.disableSNI(); break; case 2: probeNonSSL = false; probeSNI = true; shouldWeUpdateBadTimestamp = false; Get.enableSNI(); break; case 3: probeNonSSL = false; probeSNI = false; shouldWeUpdateBadTimestamp = true; Get.disableSNI(); break; case 4: probeNonSSL = false; probeSNI = true; shouldWeUpdateBadTimestamp = true; Get.enableSNI(); break; default: throw new IllegalArgumentException( "Invalid pass number" ); } } }