2 * Copyright (c) 2013 Contextream, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.lispflowmapping.implementation.authentication;
10 import java.util.HashMap;
13 public class LispAuthenticationFactory {
15 private static Map<LispKeyIDEnum, ILispAuthentication> keyIDToAuthenticationMap;
17 private static void initializeMap() {
18 keyIDToAuthenticationMap = new HashMap<LispKeyIDEnum, ILispAuthentication>();
19 keyIDToAuthenticationMap.put(LispKeyIDEnum.NONE, LispNoAuthentication.getInstance());
20 keyIDToAuthenticationMap.put(LispKeyIDEnum.SHA1, new LispMACAuthentication(LispKeyIDEnum.SHA1.getAuthenticationName()));
21 keyIDToAuthenticationMap.put(LispKeyIDEnum.SHA256, new LispMACAuthentication(LispKeyIDEnum.SHA256.getAuthenticationName()));
22 keyIDToAuthenticationMap.put(LispKeyIDEnum.UNKNOWN, LispNoAuthentication.getInstance());
26 public static ILispAuthentication getAuthentication(LispKeyIDEnum keyID) {
27 if (keyIDToAuthenticationMap == null) {
30 return keyIDToAuthenticationMap.get(keyID);