changed logging
[lispflowmapping.git] / mappingservice / implementation / src / main / java / org / opendaylight / lispflowmapping / implementation / authentication / LispAuthenticationFactory.java
index 57804f4255be1f6d5b377d59e5b2a0ad1765e674..9536c2c4da94538f6d3a8df03258f22c03c63c6a 100644 (file)
@@ -1,27 +1,33 @@
+/*
+ * Copyright (c) 2014 Contextream, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.lispflowmapping.implementation.authentication;
 
 import java.util.HashMap;
 import java.util.Map;
 
 public class LispAuthenticationFactory {
-       
-       private static Map<LispKeyIDEnum, ILispAuthentication> keyIDToAuthenticationMap;
-       
-       private static void initializeMap() {
-               keyIDToAuthenticationMap = new HashMap<LispKeyIDEnum, ILispAuthentication>();
-               keyIDToAuthenticationMap.put(LispKeyIDEnum.NONE, LispNoAuthentication.getInstance());
-               keyIDToAuthenticationMap.put(LispKeyIDEnum.SHA1, new LispMACAuthentication(LispKeyIDEnum.SHA1.getAuthenticationName()));
-               keyIDToAuthenticationMap.put(LispKeyIDEnum.SHA256, new LispMACAuthentication(LispKeyIDEnum.SHA256.getAuthenticationName()));
-               keyIDToAuthenticationMap.put(LispKeyIDEnum.UNKNOWN, LispNoAuthentication.getInstance());
-               
-       }
-       
-       public static ILispAuthentication getAuthentication(LispKeyIDEnum keyID) {
-               if (keyIDToAuthenticationMap == null) {
-                       initializeMap();
-               }
-               return keyIDToAuthenticationMap.get(keyID);
-       }
-       
+
+    private static Map<LispKeyIDEnum, ILispAuthentication> keyIDToAuthenticationMap;
+
+    private static void initializeMap() {
+        keyIDToAuthenticationMap = new HashMap<LispKeyIDEnum, ILispAuthentication>();
+        keyIDToAuthenticationMap.put(LispKeyIDEnum.NONE, LispNoAuthentication.getInstance());
+        keyIDToAuthenticationMap.put(LispKeyIDEnum.SHA1, new LispMACAuthentication(LispKeyIDEnum.SHA1.getAuthenticationName()));
+        keyIDToAuthenticationMap.put(LispKeyIDEnum.SHA256, new LispMACAuthentication(LispKeyIDEnum.SHA256.getAuthenticationName()));
+        keyIDToAuthenticationMap.put(LispKeyIDEnum.UNKNOWN, LispNoAuthentication.getInstance());
+
+    }
+
+    public static ILispAuthentication getAuthentication(LispKeyIDEnum keyID) {
+        if (keyIDToAuthenticationMap == null) {
+            initializeMap();
+        }
+        return keyIDToAuthenticationMap.get(keyID);
+    }
 
 }