X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=acs%2Frequestprocessor%2Fsrc%2Fmain%2Fjava%2Forg%2Fcommscope%2Ftr069adapter%2Facs%2Frequestprocessor%2Fhandler%2FDeviceRPCRequestHandler.java;h=ddd41b725d8c2298aadc09705bab5c3deb69d41d;hb=76744e810f35c84ecbd1d9998e361052466e9483;hp=0f98e60a66aebd688578b5ae39dd0d8eac6619a3;hpb=ce4e2d38e3d42725f61c39dd172325d2def4bc44;p=oam%2Ftr069-adapter.git diff --git a/acs/requestprocessor/src/main/java/org/commscope/tr069adapter/acs/requestprocessor/handler/DeviceRPCRequestHandler.java b/acs/requestprocessor/src/main/java/org/commscope/tr069adapter/acs/requestprocessor/handler/DeviceRPCRequestHandler.java index 0f98e60..ddd41b7 100644 --- a/acs/requestprocessor/src/main/java/org/commscope/tr069adapter/acs/requestprocessor/handler/DeviceRPCRequestHandler.java +++ b/acs/requestprocessor/src/main/java/org/commscope/tr069adapter/acs/requestprocessor/handler/DeviceRPCRequestHandler.java @@ -1,68 +1,69 @@ -/* - * ============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.acs.requestprocessor.handler; - -import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.TR069_NBI_REQUEST_CF; -import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.TR069_NBI_REQUEST_Q; -import org.commscope.tr069adapter.acs.common.DeviceRPCRequest; -import org.commscope.tr069adapter.acs.common.exception.SessionConcurrentAccessException; -import org.commscope.tr069adapter.acs.common.exception.TR069EventProcessingException; -import org.commscope.tr069adapter.acs.requestprocessor.impl.TR069RequestProcessEngine; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jms.annotation.JmsListener; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -@Component -public class DeviceRPCRequestHandler { - - private static final Logger logger = LoggerFactory.getLogger(DeviceRPCRequestHandler.class); - - private static final String CLIENT_STR = "client"; - - @Autowired - private TR069RequestProcessEngine tr069RequestProcessEngine; - - @JmsListener(destination = TR069_NBI_REQUEST_Q, containerFactory = TR069_NBI_REQUEST_CF) - @Transactional(rollbackFor = Exception.class) - public void onMessage(DeviceRPCRequest mapperDeviceOperationRequest) - throws SessionConcurrentAccessException, TR069EventProcessingException { - logger.debug("Received a JMS message from Mapper for TR069 Device RPC operation"); - try { - if (mapperDeviceOperationRequest != null) { - MDC.put(CLIENT_STR, mapperDeviceOperationRequest.getDeviceDetails().getDeviceId()); - logger.debug("Received a TR069 operation request from Mapper with operation ID: {} ", - mapperDeviceOperationRequest.getOperationId()); - tr069RequestProcessEngine.processDeviceRPCRequest(mapperDeviceOperationRequest); - logger.debug("Processed a TR069 operation request from Mapper with operation ID: {} ", - mapperDeviceOperationRequest.getOperationId()); - - } - } finally { - MDC.remove(CLIENT_STR); - } - logger.debug("Processed JMS message from Mapper for TR069 Device RPC operation"); - - } - -} +/* + * ============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.acs.requestprocessor.handler; + +import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.TR069_NBI_REQUEST_CF; +import static org.commscope.tr069adapter.acs.common.utils.AcsConstants.TR069_NBI_REQUEST_Q; + +import org.commscope.tr069adapter.acs.common.DeviceRPCRequest; +import org.commscope.tr069adapter.acs.common.exception.SessionConcurrentAccessException; +import org.commscope.tr069adapter.acs.common.exception.TR069EventProcessingException; +import org.commscope.tr069adapter.acs.requestprocessor.impl.TR069RequestProcessEngine; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.MDC; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jms.annotation.JmsListener; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +@Component +public class DeviceRPCRequestHandler { + + private static final Logger logger = LoggerFactory.getLogger(DeviceRPCRequestHandler.class); + + private static final String CLIENT_STR = "client"; + + @Autowired + private TR069RequestProcessEngine tr069RequestProcessEngine; + + @JmsListener(destination = TR069_NBI_REQUEST_Q, containerFactory = TR069_NBI_REQUEST_CF) + @Transactional(rollbackFor = Exception.class) + public void onMessage(DeviceRPCRequest mapperDeviceOperationRequest) + throws SessionConcurrentAccessException, TR069EventProcessingException { + logger.debug("Received a JMS message from Mapper for TR069 Device RPC operation"); + try { + if (mapperDeviceOperationRequest != null) { + MDC.put(CLIENT_STR, mapperDeviceOperationRequest.getDeviceDetails().getDeviceId()); + logger.debug("Received a TR069 operation request from Mapper with operation ID: {} ", + mapperDeviceOperationRequest.getOperationId()); + tr069RequestProcessEngine.processDeviceRPCRequest(mapperDeviceOperationRequest); + logger.debug("Processed a TR069 operation request from Mapper with operation ID: {} ", + mapperDeviceOperationRequest.getOperationId()); + + } + } finally { + MDC.remove(CLIENT_STR); + } + logger.debug("Processed JMS message from Mapper for TR069 Device RPC operation"); + + } + +}