Coverage Report - sk.baka.webvm.config.EncryptionEnum
 
Classes in this File Line Coverage Branch Coverage Complexity
EncryptionEnum
100%
4/4
N/A
1
EncryptionEnum$1
25%
1/4
N/A
1
EncryptionEnum$2
25%
1/4
N/A
1
EncryptionEnum$3
25%
1/4
N/A
1
 
 1  
 /**
 2  
  * Copyright 2009 Martin Vysny.
 3  
  *
 4  
  * This file is part of WebVM.
 5  
  *
 6  
  * WebVM is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License, or
 9  
  * (at your option) any later version.
 10  
  *
 11  
  * WebVM is distributed in the hope that it will be useful,
 12  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 14  
  * GNU General Public License for more details.
 15  
  *
 16  
  * You should have received a copy of the GNU General Public License
 17  
  * along with WebVM.  If not, see <http://www.gnu.org/licenses/>.
 18  
  */
 19  
 package sk.baka.webvm.config;
 20  
 
 21  
 import org.apache.commons.mail.Email;
 22  
 
 23  
 /**
 24  
  * The encryption enum.
 25  
  * @author Martin Vysny
 26  
  */
 27  8
 public enum EncryptionEnum {
 28  
 
 29  
         /**
 30  
          * No security.
 31  
          */
 32  1
         NONE {
 33  
 
 34  
                 @Override
 35  
                 public void activate(final Email mail) {
 36  0
                         mail.setSSL(false);
 37  0
                         mail.setTLS(false);
 38  0
                 }
 39  
         },
 40  
         /**
 41  
          * TLS security.
 42  
          */
 43  1
         TLS {
 44  
 
 45  
                 @Override
 46  
                 public void activate(final Email mail) {
 47  0
                         mail.setSSL(false);
 48  0
                         mail.setTLS(true);
 49  0
                 }
 50  
         },
 51  
         /**
 52  
          * SSL security.
 53  
          */
 54  1
         SSL {
 55  
 
 56  
                 @Override
 57  
                 public void activate(final Email mail) {
 58  0
                         mail.setSSL(true);
 59  0
                         mail.setTLS(false);
 60  0
                 }
 61  
         };
 62  
 
 63  
         /**
 64  
          * Activates given security on given mail.
 65  
          * @param mail activate security on this mail.
 66  
          */
 67  
         public abstract void activate(final Email mail);
 68  
 }