blob: be8686aa2f99e93d170f7d79eb57d71715b15d4d [file] [log] [blame]
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Priyanka Bb977f562016-07-22 13:02:03 +053016package org.onosproject.pcerest;
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +053017
Ray Milkeyd84f89b2018-08-17 14:54:17 -070018import org.osgi.service.component.annotations.Activate;
19import org.osgi.service.component.annotations.Component;
20import org.osgi.service.component.annotations.Deactivate;
21import org.osgi.service.component.annotations.Reference;
22import org.osgi.service.component.annotations.ReferenceCardinality;
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +053023import org.onosproject.codec.CodecService;
24import org.onosproject.pce.pceservice.PcePath;
25import org.slf4j.Logger;
26import org.slf4j.LoggerFactory;
27
28/**
29 * Implementation of the json codec brokering service for pce app.
30 */
31@Component(immediate = true)
32public class PceCodecRegistrator {
33
34 private static Logger log = LoggerFactory.getLogger(PceCodecRegistrator.class);
35
Ray Milkeyd84f89b2018-08-17 14:54:17 -070036 @Reference(cardinality = ReferenceCardinality.MANDATORY)
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +053037 protected CodecService codecService;
38
39 @Activate
40 public void activate() {
41 codecService.registerCodec(PcePath.class, new PcePathCodec());
42 log.info("Started");
43 }
44
45 @Deactivate
46 public void deactivate() {
47 log.info("Stopped");
48 }
49}