X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=mapper%2Fsrc%2Fmain%2Fjava%2Forg%2Fcommscope%2Ftr069adapter%2Fmapper%2Futil%2FFirwareUpgradeErrorCode.java;h=3d924aa512bb60330b801d7867a264c777b2b293;hb=HEAD;hp=823aa7e3ba8f03272fca69e647cbad2236536b06;hpb=c4ed11115cea02bb72770e74805081ddba12daef;p=oam%2Ftr069-adapter.git diff --git a/mapper/src/main/java/org/commscope/tr069adapter/mapper/util/FirwareUpgradeErrorCode.java b/mapper/src/main/java/org/commscope/tr069adapter/mapper/util/FirwareUpgradeErrorCode.java index 823aa7e..3d924aa 100644 --- a/mapper/src/main/java/org/commscope/tr069adapter/mapper/util/FirwareUpgradeErrorCode.java +++ b/mapper/src/main/java/org/commscope/tr069adapter/mapper/util/FirwareUpgradeErrorCode.java @@ -1,25 +1,47 @@ -package org.commscope.tr069adapter.mapper.util; - -import java.util.HashMap; -import java.util.Map; - -public class FirwareUpgradeErrorCode { - private static Map ErrorCodes = new HashMap();; - - static { - ErrorCodes.put(9019, "AUTHENTICATION_ERROR"); - ErrorCodes.put(9001, "AUTHENTICATION_ERROR"); - ErrorCodes.put(9016, "AUTHENTICATION_ERROR"); - ErrorCodes.put(9012, "AUTHENTICATION_ERROR"); - ErrorCodes.put(9015, "PROTOCOL_ERROR"); - ErrorCodes.put(9002, "APPLICATION_ERROR"); - ErrorCodes.put(9003, "APPLICATION_ERROR"); - ErrorCodes.put(9020, "TIMEOUT"); - ErrorCodes.put(0, "COMPLETED"); - } - - public static String getErrorCodeMapping(int errorCode) { - return ErrorCodes.get(errorCode) != null ? ErrorCodes.get(errorCode) : "APPLICATION_ERROR"; - } - -} +/* + * ============LICENSE_START======================================================================== + * ONAP : tr-069-adapter + * ================================================================================================= + * Copyright (C) 2020 CommScope Inc Intellectual Property. + * ================================================================================================= + * This tr-069-adapter software file is distributed by CommScope Inc 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * This file 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. + * ===============LICENSE_END======================================================================= + */ + +package org.commscope.tr069adapter.mapper.util; + +import java.util.HashMap; +import java.util.Map; + +public class FirwareUpgradeErrorCode { + private FirwareUpgradeErrorCode() {} + + private static Map errorCodes = new HashMap<>(); + private static final String AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR"; + private static final String APPLICATION_ERROR = "APPLICATION_ERROR"; + + static { + errorCodes.put(9019, AUTHENTICATION_ERROR); + errorCodes.put(9001, AUTHENTICATION_ERROR); + errorCodes.put(9016, AUTHENTICATION_ERROR); + errorCodes.put(9012, AUTHENTICATION_ERROR); + errorCodes.put(9015, "PROTOCOL_ERROR"); + errorCodes.put(9002, APPLICATION_ERROR); + errorCodes.put(9003, APPLICATION_ERROR); + errorCodes.put(9020, "TIMEOUT"); + errorCodes.put(0, "COMPLETED"); + } + + public static String getErrorCodeMapping(int errorCode) { + return errorCodes.get(errorCode) != null ? errorCodes.get(errorCode) : APPLICATION_ERROR; + } + +}