[RICPLT-2157] Restructure handlers and converters.......
[ric-plt/e2mgr.git] / E2Manager / handlers / rmrmsghandlers / setup_response_notification_handler_bak.go
1 //
2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //      http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 package rmrmsghandlers
19
20 import (
21         "e2mgr/logger"
22         "time"
23 )
24
25 //import "C"
26
27 //type SetupResponseNotificationHandler struct{}
28 //
29 //func (src SetupResponseNotificationHandler) Handle(logger *logger.Logger, e2Sessions sessions.E2Sessions,
30 //      request *models.NotificationRequest, messageChannel chan<- *models.NotificationResponse) {
31 //
32 //      refinedResponse, err := UnpackX2apPduAndRefine(logger, e2pdus.MaxAsn1CodecAllocationBufferSize, request.Len, request.Payload, e2pdus.MaxAsn1CodecMessageBufferSize)
33 //      if err != nil {
34 //              logger.Errorf("#setup_response_notification_handler_bak.Handle - unpack failed. Error: %v", err)
35 //      }
36 //
37 //      e2session, ok := e2Sessions[request.TransactionId]
38 //      printHandlingSetupResponseElapsedTimeInMs(logger, fmt.Sprintf("#setupResponseNotificationHandler.handle - transactionId %s: Summary: Elapsed time for receiving and handling setup response from E2 terminator", request.TransactionId), request.StartTime)
39 //      if ok {
40 //              printHandlingSetupResponseElapsedTimeInMs(logger, fmt.Sprintf("#setupResponseNotificationHandler.handle - transactionId %s: Summary: Total roundtrip elapsed time", request.TransactionId), e2session.SessionStart)
41 //              delete(e2Sessions, request.TransactionId) // Avoid pinning memory (help GC)
42 //      }
43 //      logger.Debugf("#setupResponseNotificationHandler.handle - transactionId %s: PDU: %v", request.TransactionId, refinedResponse.PduPrint)
44 //}
45 //
46 func printHandlingSetupResponseElapsedTimeInMs(logger *logger.Logger, msg string, startTime time.Time) {
47         logger.Infof("%s: %f ms", msg, float64(time.Since(startTime))/float64(time.Millisecond))
48 }