description "This module contains the PCMM Converged Cable Access Platform (CCAP) definitions";
organization "OpenDaylight Project";
-
+
+ revision 2015-10-26 {
+ description "Corrected pluralization of containers/lists and added containers around lists where needed";
+ }
revision 2015-03-27 {
description "Initial revision of PCMM CCAP definitions";
}
// CCAP devices
- container ccap {
- list ccaps {
+ container ccaps {
+ list ccap {
description "
CCAP devices are known by their network name which is any string.
Each CCAP device has a network address:port, a list of subscriber IP subnets,
}
grouping pcmm-qos-gates {
- list apps {
- key "appId";
- leaf appId {
- type string;
- description "Application Identity";
- }
- list subs {
- key "subId";
- leaf subId {
- type string;
- description "Subscriber Identity -- must be a CM or CPE IP address";
+ container apps {
+ list app {
+ key "appId";
+ leaf appId {
+ type string;
+ description "Application Identity";
}
- list gates {
- key "gateId";
- leaf gateId {
- type string;
- description "Qos Gate Identity";
- }
- uses pcmm-qos-gate-attributes;
- }
- }
+ container subscribers {
+ list subscriber {
+ key "subscriberId";
+ leaf subscriberId {
+ type string;
+ description "Subscriber Identity -- must be a CM or CPE IP address";
+ }
+ container gates {
+ list gate {
+ key "gateId";
+ leaf gateId {
+ type string;
+ description "Qos Gate Identity";
+ }
+ uses pcmm-qos-gate-attributes;
+ }
+ }
+ }
+ }
+ }
}
}
{
- "id": "ea685ec8-aa6d-22e9-e501-b608a6705634",
+ "id": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
"name": "ODL-PCMM",
"description": "Sample PCMM REST configuration calls.",
"order": [],
"folders": [
{
- "id": "70229253-b083-d28b-aa49-5b4aa4a5f603",
+ "id": "f9e5223f-35d2-95a8-4cfe-b250938e6c12",
"name": "CCAP/CMTS",
"description": "Sample PUT, GET, & DELETE of CMTS into ODL",
- "write": true,
"order": [
- "e54c5cfc-1b5d-498b-a341-00297488427b",
- "81287e06-ee1c-1ab3-ac6c-a5c0e7ef304b",
- "351b4a09-547a-bcca-7209-a9ce69e3c041",
- "e72c8671-ea27-6bbe-800f-3e16d4af4e46",
- "1f72bd2d-9ffc-da53-adad-2a664b9c30b2",
- "a104537c-f394-388f-aa75-4bd5026b60d7"
+ "44ba6dfe-ca0c-376a-0322-b3db2af6eb2f",
+ "0c1e6f25-e33b-e3ed-fc59-02f2b569a9ed",
+ "a817933b-9398-23d1-b269-68f81ba51bc7",
+ "f403ebfd-d7d7-c94e-0ee5-3bc864098250",
+ "672adfee-68a5-5281-d638-72c2964b35cc",
+ "1142817c-9007-f0a1-92cd-644935c1fa85",
+ "07f16f27-6ef1-b022-1921-02a3baf40d91",
+ "1f68f1dc-1d2b-8d04-b7be-0e6fc03fd90a"
],
- "collection_name": "ODL-PCMM",
- "collection_owner": 0,
- "collection_id": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "collection": "ea685ec8-aa6d-22e9-e501-b608a6705634",
"owner": 0
},
{
- "id": "b49599b4-7506-16dd-6128-b57a71263441",
+ "id": "8454f1d3-bf11-01d5-3c17-1c635512818b",
"name": "Gates",
"description": "Sample PUT, GET, DELETE for PCMM Gates",
- "write": true,
"order": [
- "2b0350e0-0c15-0546-6b67-51b5b75247b6",
- "c6a3ffc4-b4dd-6b53-016c-41efaf165197",
- "890d8808-c924-6ae4-7d4e-48ecffe18cbd",
- "69836325-d4ed-671c-309c-a766df3307f7",
- "69ae25d5-9c99-2a26-ab69-68b6f15cfa56",
- "975c6bd4-76bc-8a72-c9a6-2f6a9306dd9f",
- "338ae37d-fbe3-8c1f-f49e-7670c76c58fd",
- "73c2e665-bd3e-8406-92a4-fecadf23b922",
- "dcc4b130-7f5c-1247-678c-cb2f44ae4eaa"
+ "0f01c73b-c17a-b53b-3694-1d746edcd2a2",
+ "11ef539e-26d3-77ab-3828-321c3f7bf6a3",
+ "03bebe64-27ff-1df3-5b6b-9237f6c8e229",
+ "611db01a-e1e3-51fc-606d-5364477f8983",
+ "fbf5671a-ae7d-4413-a22b-8334c4f5c35e",
+ "a782c414-e6ad-a247-63f8-f1353e462870",
+ "ec1b0f8c-371d-a0bd-ce5f-d30aa31237cb",
+ "dc932ee9-1acd-9efe-cc83-de07894516bb",
+ "9d80f0da-4500-e843-31c5-808c91d9249b",
+ "b8031ee0-b6e0-dcbe-fff3-a924cbe295a4"
],
- "collection_name": "ODL-PCMM",
- "collection_owner": 0,
- "collection_id": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "collection": "ea685ec8-aa6d-22e9-e501-b608a6705634",
"owner": 0,
"collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634"
}
],
"timestamp": 1431957020452,
- "synced": false,
"owner": 0,
- "sharedWithTeam": false,
- "subscribed": false,
"remoteLink": "",
"public": false,
- "write": true,
"requests": [
{
- "id": "1f72bd2d-9ffc-da53-adad-2a664b9c30b2",
+ "id": "03bebe64-27ff-1df3-5b6b-9237f6c8e229",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccap/ccaps/{{ccapId-1}}",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-classifier}}/subscribers/subscriber/{{subId-classifier}}/gates/gate/{{gateId-classifier}}/",
"preRequestScript": "",
"pathVariables": {},
"method": "DELETE",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431959545466,
- "name": "Delete CCAP 1",
- "description": "Deletes a specific managed CCAP/CMTS",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false
+ "time": 1445872033293,
+ "name": "Gate w/ classifier",
+ "description": "Delete QoS gate with classifier",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
},
{
- "id": "2b0350e0-0c15-0546-6b67-51b5b75247b6",
+ "id": "07f16f27-6ef1-b022-1921-02a3baf40d91",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-classifier}}/subs/{{subId-classifier}}/gates/{{gateId-classifier}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccaps/ccap/{{ccapId-1}}",
"preRequestScript": "",
"pathVariables": {},
"method": "PUT",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431970132797,
- "name": "Gate w/ classifier",
- "description": "PUT gate with standard classifier",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
+ "time": 1445618651730,
+ "name": "Add CCAP 1 - Bad",
+ "description": "tries to add a CCAP/CMTS to manage with out providing all the required fields",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
"responses": [],
- "synced": false,
- "rawModeData": "{\n \"gates\": [{\n \"gateId\": \"{{gateId-classifier}}\",\n \"gate-spec\": {\n \"dscp-tos-overwrite\": \"0xa0\",\n \"dscp-tos-mask\": \"0xff\"\n },\n \"traffic-profile\": {\n \"service-class-name\": \"{{scnUp}}\"\n },\n \"classifier\": {\n \"srcIp\": \"{{srcIp-1a}}\",\n \"dstIp\": \"{{dstIp-1a}}\",\n \"protocol\": \"0\",\n \"srcPort\": \"{{srcPort-1a}}\",\n \"dstPort\": \"{{dstPort-1a}}\",\n \"tos-byte\": \"0xa0\",\n \"tos-mask\": \"0xe0\"\n }\n }]\n}\n"
+ "rawModeData": "{\n \"ccap\": [{\n \"ccapId\": \"{{ccapId-1}}\",\n \"amId\": {\n \"am-type\": \"1\"\n },\n \"connection\": {\n \"ipAddress\": \"{{ccapIp-1}}\",\n \"port\": \"{{ccapPort-1}}\"\n },\n \"subscriber-subnets\": [\n \"10.32.110.1/24\"\n ],\n \"downstream-scns\": [\n \"extrm_dn\"\n ],\n \"upstream-scns\": [\n \"extrm_up\"\n ]\n }]\n}\n"
},
{
- "id": "338ae37d-fbe3-8c1f-f49e-7670c76c58fd",
+ "id": "0c1e6f25-e33b-e3ed-fc59-02f2b569a9ed",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-ipv6}}/subs/{{subId-ipv6}}/gates/{{gateId-ipv6}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccaps",
"preRequestScript": "",
"pathVariables": {},
- "method": "PUT",
+ "method": "DELETE",
"data": [],
- "dataMode": "raw",
+ "dataMode": "params",
"version": 2,
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431970170183,
- "name": "Gate w/ IPv6 classifier",
- "description": "PUT gate with IPv6 classifier",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false,
- "rawModeData": "{\n \"gates\": [{\n \"gateId\": \"{{gateId-ipv6}}\",\n \"gate-spec\": {\n \"dscp-tos-overwrite\": \"0xa0\",\n \"dscp-tos-mask\": \"0xff\"\n },\n \"traffic-profile\": {\n \"service-class-name\": \"{{scnDn}}\"\n },\n \"ipv6-classifier\": {\n \"srcIp6\": \"{{srcIp-IPv6}}\",\n \"dstIp6\": \"{{dstIp-IPv6}}\",\n \"flow-label\": \"101\",\n \"tc-low\": \"0xa0\",\n \"tc-high\": \"0xc0\",\n \"tc-mask\": \"0xe0\",\n \"next-hdr\": \"256\",\n \"srcPort-start\": \"{{srcPort-1a}}\",\n \"srcPort-end\": \"{{srcPort-1b}}\",\n \"dstPort-start\": \"{{dstPort-1a}}\",\n \"dstPort-end\": \"{{dstPort-1b}}\"\n }\n }]\n}\n"
+ "time": 1445616322776,
+ "name": "Delete All CCAPs",
+ "description": "Removes all managed CCAPs/CMTSs",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
},
{
- "id": "351b4a09-547a-bcca-7209-a9ce69e3c041",
+ "id": "0f01c73b-c17a-b53b-3694-1d746edcd2a2",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccap/ccaps/{{ccapId-1}}",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-classifier}}/subscribers/subscriber/{{subId-classifier}}/gates/gate/{{gateId-classifier}}/",
"preRequestScript": "",
"pathVariables": {},
"method": "PUT",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431959533066,
- "name": "Add CCAP 1",
- "description": "Adds a CCAP/CMTS to manage",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
+ "time": 1445871971575,
+ "name": "Gate w/ classifier",
+ "description": "PUT gate with standard classifier",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
"responses": [],
- "synced": false,
- "rawModeData": "{\n \"ccaps\": [{\n \"ccapId\": \"{{ccapId-1}}\",\n \"amId\": {\n \"am-tag\": \"0xcada\",\n \"am-type\": \"1\"\n },\n \"connection\": {\n \"ipAddress\": \"{{ccapIp-1}}\",\n \"port\": \"{{ccapPort-1}}\"\n },\n \"subscriber-subnets\": [\n \"10.32.110.1/24\"\n ],\n \"downstream-scns\": [\n \"extrm_dn\"\n ],\n \"upstream-scns\": [\n \"extrm_up\"\n ]\n }]\n}\n"
+ "rawModeData": "{\n \"gate\": [{\n \"gateId\": \"{{gateId-classifier}}\",\n \"gate-spec\": {\n \"dscp-tos-overwrite\": \"0xa0\",\n \"dscp-tos-mask\": \"0xff\"\n },\n \"traffic-profile\": {\n \"service-class-name\": \"{{scnUp}}\"\n },\n \"classifier\": {\n \"srcIp\": \"{{srcIp-1a}}\",\n \"dstIp\": \"{{dstIp-1a}}\",\n \"protocol\": \"0\",\n \"srcPort\": \"{{srcPort-1a}}\",\n \"dstPort\": \"{{dstPort-1a}}\",\n \"tos-byte\": \"0xa0\",\n \"tos-mask\": \"0xe0\"\n }\n }]\n}\n"
},
{
- "id": "69836325-d4ed-671c-309c-a766df3307f7",
+ "id": "1142817c-9007-f0a1-92cd-644935c1fa85",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-ext}}/subs/{{subId-ext}}/gates/{{gateId-ext}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccaps",
"preRequestScript": "",
"pathVariables": {},
"method": "PUT",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431970160007,
- "name": "Gate w/ ext classifier",
- "description": "PUT gate with ext classifier",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
+ "time": 1445618622845,
+ "name": "PUT Multiple",
+ "description": "Adds 2 CCAPs/CMTSs to manage",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
"responses": [],
- "synced": false,
- "rawModeData": "{\n \"gates\": [{\n \"gateId\": \"{{gateId-ext}}\",\n \"gate-spec\": {\n \"dscp-tos-overwrite\": \"0xa0\",\n \"dscp-tos-mask\": \"0xff\"\n },\n \"traffic-profile\": {\n \"service-class-name\": \"{{scnDn}}\"\n },\n \"ext-classifier\": {\n \"srcIp\": \"{{srcIp-1a}}\",\n \"srcIpMask\": \"{{srcIpMask}}\",\n \"dstIp\": \"{{dstIp-1a}}\",\n \"dstIpMask\": \"{{dstIpMask}}\",\n \"tos-byte\": \"0xa0\",\n \"tos-mask\": \"0xe0\",\n \"protocol\": \"0\",\n \"srcPort-start\": \"{{srcPort-1a}}\",\n \"srcPort-end\": \"{{srcPort-1b}}\",\n \"dstPort-start\": \"{{dstPort-1a}}\",\n \"dstPort-end\": \"{{dstPort-1b}}\"\n }\n }]\n}\n"
+ "rawModeData": "{ \"ccaps\": {\n \"ccap\": [\n { \"ccapId\": \"{{ccapId-1}}\",\n \"amId\": {\n \"am-tag\": \"0xcada\",\n \"am-type\": \"1\"\n },\n \"connection\": {\n \"ipAddress\": \"{{ccapIp-1}}\",\n \"port\": \"{{ccapPort-1}}\"\n },\n \"subscriber-subnets\": [\n \"44.137.0.0/16\",\n \"2001:4978:030d:1000:0:0:0:0/52\"\n ],\n \"downstream-scns\": [\n \"ipvideo_dn\",\n \"extrm_dn\",\n \"SCNC\"\n ],\n \"upstream-scns\": [\n \"SCNA\",\n \"extrm_up\"\n ]\n },\n { \"ccapId\": \"{{ccapId-2}}\",\n \"amId\": {\n \"am-tag\": \"0xcada\",\n \"am-type\": \"1\"\n },\n \"connection\": {\n \"ipAddress\": \"{{ccapIp-2}}\",\n \"port\": \"{{ccapPort-2}}\"\n },\n \"subscriber-subnets\": [\n \"44.133.0.0/19\"\n ],\n \"downstream-scns\": [\n \"ipvideo_dn\",\n \"extrm_dn\",\n \"SCNC\"\n ],\n \"upstream-scns\": [\n \"SCNA\",\n \"extrm_up\"\n ]\n }]\n}}\n"
},
{
- "id": "69ae25d5-9c99-2a26-ab69-68b6f15cfa56",
+ "id": "11ef539e-26d3-77ab-3828-321c3f7bf6a3",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-ext}}/subs/{{subId-ext}}/gates/{{gateId-ext}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-classifier}}/subscribers/subscriber/{{subId-classifier}}/gates/gate/{{gateId-classifier}}/",
"preRequestScript": "",
"pathVariables": {},
"method": "GET",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431968587699,
- "name": "Gate w/ ext classifier",
- "description": "Retrieves the gate with ext classifier.",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false
+ "time": 1445872017430,
+ "name": "Gate w/ classifier",
+ "description": "Retrieves the gate with classifier.",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
},
{
- "id": "73c2e665-bd3e-8406-92a4-fecadf23b922",
+ "id": "1f68f1dc-1d2b-8d04-b7be-0e6fc03fd90a",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-ipv6}}/subs/{{subId-ipv6}}/gates/{{gateId-ipv6}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/operational/packetcable:ccaps",
"preRequestScript": "",
"pathVariables": {},
"method": "GET",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431968601897,
- "name": "Gate w/ IPv6 classifier",
- "description": "Retrieves the gate with IPv6 classifier.",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
+ "time": 1445616352829,
+ "name": "Operational - Get All CCAPs",
+ "description": "Retrieves all managed CCAPs/CMTSs",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
+ },
+ {
+ "id": "44ba6dfe-ca0c-376a-0322-b3db2af6eb2f",
+ "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccaps",
+ "preRequestScript": "",
+ "pathVariables": {},
+ "method": "GET",
+ "data": [],
+ "dataMode": "params",
+ "version": 2,
+ "tests": "",
+ "currentHelper": "normal",
+ "helperAttributes": {},
+ "time": 1445616319736,
+ "name": "Get All CCAPs",
+ "description": "Retrieves all managed CCAPs/CMTSs",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
+ },
+ {
+ "id": "611db01a-e1e3-51fc-606d-5364477f8983",
+ "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-ext}}/subscribers/subscriber/{{subId-ext}}/gates/gate/{{gateId-ext}}/",
+ "preRequestScript": "",
+ "pathVariables": {},
+ "method": "PUT",
+ "data": [],
+ "dataMode": "raw",
+ "version": 2,
+ "tests": "",
+ "currentHelper": "normal",
+ "helperAttributes": {},
+ "time": 1445872070412,
+ "name": "Gate w/ ext classifier",
+ "description": "PUT gate with ext classifier",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
"responses": [],
- "synced": false
+ "rawModeData": "{\n \"gate\": [{\n \"gateId\": \"{{gateId-ext}}\",\n \"gate-spec\": {\n \"dscp-tos-overwrite\": \"0xa0\",\n \"dscp-tos-mask\": \"0xff\"\n },\n \"traffic-profile\": {\n \"service-class-name\": \"{{scnDn}}\"\n },\n \"ext-classifier\": {\n \"srcIp\": \"{{srcIp-1a}}\",\n \"srcIpMask\": \"{{srcIpMask}}\",\n \"dstIp\": \"{{dstIp-1a}}\",\n \"dstIpMask\": \"{{dstIpMask}}\",\n \"tos-byte\": \"0xa0\",\n \"tos-mask\": \"0xe0\",\n \"protocol\": \"0\",\n \"srcPort-start\": \"{{srcPort-1a}}\",\n \"srcPort-end\": \"{{srcPort-1b}}\",\n \"dstPort-start\": \"{{dstPort-1a}}\",\n \"dstPort-end\": \"{{dstPort-1b}}\"\n }\n }]\n}\n"
},
{
- "id": "81287e06-ee1c-1ab3-ac6c-a5c0e7ef304b",
+ "id": "672adfee-68a5-5281-d638-72c2964b35cc",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccap",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccaps/ccap/{{ccapId-1}}",
"preRequestScript": "",
"pathVariables": {},
"method": "DELETE",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431959527893,
- "name": "Delete All CCAPs",
- "description": "Removes all managed CCAPs/CMTSs",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false
+ "time": 1445616338656,
+ "name": "Delete CCAP 1",
+ "description": "Deletes a specific managed CCAP/CMTS",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
},
{
- "id": "890d8808-c924-6ae4-7d4e-48ecffe18cbd",
+ "id": "9d80f0da-4500-e843-31c5-808c91d9249b",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-classifier}}/subs/{{subId-classifier}}/gates/{{gateId-classifier}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-ipv6}}/subscribers/subscriber/{{subId-ipv6}}/gates/gate/{{gateId-ipv6}}/",
"preRequestScript": "",
"pathVariables": {},
"method": "DELETE",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431968580172,
- "name": "Gate w/ classifier",
- "description": "Delete QoS gate with classifier",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false
+ "time": 1445872203499,
+ "name": "Gate w/ IPv6 classifier",
+ "description": "Delete QoS gate with IPv6 classifier",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
},
{
- "id": "975c6bd4-76bc-8a72-c9a6-2f6a9306dd9f",
+ "id": "a782c414-e6ad-a247-63f8-f1353e462870",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-ext}}/subs/{{subId-ext}}/gates/{{gateId-ext}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-ext}}/subscribers/subscriber/{{subId-ext}}/gates/gate/{{gateId-ext}}/",
"preRequestScript": "",
"pathVariables": {},
"method": "DELETE",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431968592188,
+ "time": 1445872124553,
"name": "Gate w/ ext classifier",
"description": "Delete QoS gate with ext classifier",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
},
{
- "id": "a104537c-f394-388f-aa75-4bd5026b60d7",
+ "id": "a817933b-9398-23d1-b269-68f81ba51bc7",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccap",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccaps/ccap/{{ccapId-1}}",
"preRequestScript": "",
"pathVariables": {},
"method": "PUT",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431959551170,
- "name": "PUT Multiple",
- "description": "Adds 2 CCAPs/CMTSs to manage",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
+ "time": 1445616876070,
+ "name": "Add CCAP 1",
+ "description": "Adds a CCAP/CMTS to manage",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
"responses": [],
- "synced": false,
- "rawModeData": "{ \"ccap\": {\n \"ccaps\": [\n { \"ccapId\": \"{{ccapId-1}}\",\n \"amId\": {\n \"am-tag\": \"0xcada\",\n \"am-type\": \"1\"\n },\n \"connection\": {\n \"ipAddress\": \"{{ccapIp-1}}\",\n \"port\": \"{{ccapPort-1}}\"\n },\n \"subscriber-subnets\": [\n \"44.137.0.0/16\",\n \"2001:4978:030d:1000:0:0:0:0/52\"\n ],\n \"downstream-scns\": [\n \"ipvideo_dn\",\n \"extrm_dn\",\n \"SCNC\"\n ],\n \"upstream-scns\": [\n \"SCNA\",\n \"extrm_up\"\n ]\n },\n { \"ccapId\": \"{{ccapId-2}}\",\n \"amId\": {\n \"am-tag\": \"0xcada\",\n \"am-type\": \"1\"\n },\n \"connection\": {\n \"ipAddress\": \"{{ccapIp-2}}\",\n \"port\": \"{{ccapPort-2}}\"\n },\n \"subscriber-subnets\": [\n \"44.133.0.0/19\"\n ],\n \"downstream-scns\": [\n \"ipvideo_dn\",\n \"extrm_dn\",\n \"SCNC\"\n ],\n \"upstream-scns\": [\n \"SCNA\",\n \"extrm_up\"\n ]\n }]\n}}\n"
+ "rawModeData": "{\n \"ccap\": [{\n \"ccapId\": \"{{ccapId-1}}\",\n \"amId\": {\n \"am-tag\": \"0xcada\",\n \"am-type\": \"1\"\n },\n \"connection\": {\n \"ipAddress\": \"{{ccapIp-1}}\",\n \"port\": \"{{ccapPort-1}}\"\n },\n \"subscriber-subnets\": [\n \"10.32.110.1/24\"\n ],\n \"downstream-scns\": [\n \"extrm_dn\"\n ],\n \"upstream-scns\": [\n \"extrm_up\"\n ]\n }]\n}\n"
},
{
- "id": "c6a3ffc4-b4dd-6b53-016c-41efaf165197",
+ "id": "b8031ee0-b6e0-dcbe-fff3-a924cbe295a4",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-classifier}}/subs/{{subId-classifier}}/gates/{{gateId-classifier}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/",
"preRequestScript": "",
"pathVariables": {},
"method": "GET",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431968576112,
- "name": "Gate w/ classifier",
- "description": "Retrieves the gate with classifier.",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false
+ "time": 1445372731369,
+ "name": "All Gates",
+ "description": "Retrieves all gates.",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
},
{
- "id": "dcc4b130-7f5c-1247-678c-cb2f44ae4eaa",
+ "id": "dc932ee9-1acd-9efe-cc83-de07894516bb",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/{{appId-ipv6}}/subs/{{subId-ipv6}}/gates/{{gateId-ipv6}}/",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-ipv6}}/subscribers/subscriber/{{subId-ipv6}}/gates/gate/{{gateId-ipv6}}/",
"preRequestScript": "",
"pathVariables": {},
- "method": "DELETE",
+ "method": "GET",
"data": [],
"dataMode": "params",
"version": 2,
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431968605935,
+ "time": 1445872183035,
"name": "Gate w/ IPv6 classifier",
- "description": "Delete QoS gate with IPv6 classifier",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false
+ "description": "Retrieves the gate with IPv6 classifier.",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
},
{
- "id": "e54c5cfc-1b5d-498b-a341-00297488427b",
+ "id": "ec1b0f8c-371d-a0bd-ce5f-d30aa31237cb",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccap",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-ipv6}}/subscribers/subscriber/{{subId-ipv6}}/gates/gate/{{gateId-ipv6}}/",
"preRequestScript": "",
"pathVariables": {},
- "method": "GET",
+ "method": "PUT",
"data": [],
- "dataMode": "params",
+ "dataMode": "raw",
"version": 2,
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431959521698,
- "name": "Get All CCAPs",
- "description": "Retrieves all managed CCAPs/CMTSs",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
+ "time": 1445872149650,
+ "name": "Gate w/ IPv6 classifier",
+ "description": "PUT gate with IPv6 classifier",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
"responses": [],
- "synced": false
+ "rawModeData": "{\n \"gate\": [{\n \"gateId\": \"{{gateId-ipv6}}\",\n \"gate-spec\": {\n \"dscp-tos-overwrite\": \"0xa0\",\n \"dscp-tos-mask\": \"0xff\"\n },\n \"traffic-profile\": {\n \"service-class-name\": \"{{scnDn}}\"\n },\n \"ipv6-classifier\": {\n \"srcIp6\": \"{{srcIp-IPv6}}\",\n \"dstIp6\": \"{{dstIp-IPv6}}\",\n \"flow-label\": \"101\",\n \"tc-low\": \"0xa0\",\n \"tc-high\": \"0xc0\",\n \"tc-mask\": \"0xe0\",\n \"next-hdr\": \"256\",\n \"srcPort-start\": \"{{srcPort-1a}}\",\n \"srcPort-end\": \"{{srcPort-1b}}\",\n \"dstPort-start\": \"{{dstPort-1a}}\",\n \"dstPort-end\": \"{{dstPort-1b}}\"\n }\n }]\n}\n"
},
{
- "id": "e72c8671-ea27-6bbe-800f-3e16d4af4e46",
+ "id": "f403ebfd-d7d7-c94e-0ee5-3bc864098250",
"headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccap/ccaps/{{ccapId-1}}",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:ccaps/ccap/{{ccapId-1}}",
"preRequestScript": "",
"pathVariables": {},
"method": "GET",
"tests": "",
"currentHelper": "normal",
"helperAttributes": {},
- "time": 1431959538008,
+ "time": 1445616333775,
"name": "Get CCAP 1",
"description": "Retrieves a specific managed CCAP/CMTS",
- "collectionId": "ea685ec8-aa6d-22e9-e501-b608a6705634",
- "responses": [],
- "synced": false
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
+ },
+ {
+ "id": "fbf5671a-ae7d-4413-a22b-8334c4f5c35e",
+ "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+ "url": "http://{{odlHost}}:{{odlPort}}/restconf/config/packetcable:qos/apps/app/{{appId-ext}}/subscribers/subscriber/{{subId-ext}}/gates/gate/{{gateId-ext}}/",
+ "preRequestScript": "",
+ "pathVariables": {},
+ "method": "GET",
+ "data": [],
+ "dataMode": "params",
+ "version": 2,
+ "tests": "",
+ "currentHelper": "normal",
+ "helperAttributes": {},
+ "time": 1445872097422,
+ "name": "Gate w/ ext classifier",
+ "description": "Retrieves the gate with ext classifier.",
+ "collectionId": "5c57b040-54e7-d5bf-296d-d5a4afdd39bc",
+ "responses": []
}
]
}
\ No newline at end of file
*/
package org.opendaylight.controller.packetcable.provider;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceFlowDirection;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.TosByte;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.attributes.AmId;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.classifier.Classifier;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.ext.classifier.ExtClassifier;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gate.spec.GateSpec;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.ipv6.classifier.Ipv6Classifier;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.traffic.profile.TrafficProfile;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceFlowDirection;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.TosByte;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccap.attributes.AmId;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.classifier.Classifier;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.ext.classifier.ExtClassifier;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gate.spec.GateSpec;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.ipv6.classifier.Ipv6Classifier;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.traffic.profile.TrafficProfile;
import org.pcmm.gates.IClassifier;
import org.pcmm.gates.IClassifier.Protocol;
import org.pcmm.gates.IExtendedClassifier.ActivationState;
private IClassifier classifier = null;
private PCMMError error = null;
- public PCMMGateReq getGateReq() {
+ public PCMMGateReq build() {
return new PCMMGateReq(amid, subscriberID, transactionID, gateSpec, trafficProfile, classifier, gateID, error);
}
- public void build(final AmId qosAmId) {
+ public void setAmId(final AmId qosAmId) {
amid = new AMID(qosAmId.getAmType().shortValue(), qosAmId.getAmTag().shortValue());
}
- public void build(final InetAddress qosSubId) {
+ public void setSubscriberId(final InetAddress qosSubId) {
subscriberID = new SubscriberID(qosSubId);
}
- public void build(final GateSpec qosGateSpec, final ServiceFlowDirection scnDirection) {
+ public void setGateSpec(final GateSpec qosGateSpec, final ServiceFlowDirection scnDirection) {
final ServiceFlowDirection qosDir;
if (scnDirection != null) {
gateSpec = new org.pcmm.gates.impl.GateSpec(gateDir, dscptos, gateTosMask);
}
- public void build(final TrafficProfile qosTrafficProfile) {
+ public void setTrafficProfile(final TrafficProfile qosTrafficProfile) {
if (qosTrafficProfile.getServiceClassName() != null) {
trafficProfile =
new DOCSISServiceClassNameTrafficProfile(qosTrafficProfile.getServiceClassName().getValue());
return null;
}
- public void build(final Classifier qosClassifier) {
+ public void setClassifier(final Classifier qosClassifier) {
// TODO - try and make these variables immutable
Protocol protocol = null;
byte tosOverwrite = 0;
dstPort, priority);
}
- public void build(final ExtClassifier qosExtClassifier) {
+ public void setExtClassifier(final ExtClassifier qosExtClassifier) {
// Extended classifier
final byte priority = (byte) 64;
final ActivationState activationState = ActivationState.ACTIVE;
return null;
}
- public void build(final Ipv6Classifier qosIpv6Classifier) {
+ public void setIpv6Classifier(final Ipv6Classifier qosIpv6Classifier) {
// Next Header
final short nextHdr;
if (qosIpv6Classifier.getNextHdr() != null) {
package org.opendaylight.controller.packetcable.provider;
import com.google.common.collect.Maps;
+import java.net.InetAddress;
+import java.util.Map;
+import javax.annotation.concurrent.ThreadSafe;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceClassName;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceFlowDirection;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.Ccaps;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.subs.Gates;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceClassName;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceFlowDirection;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccaps.Ccap;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.app.subscribers.subscriber.gates.Gate;
import org.pcmm.PCMMPdpAgent;
import org.pcmm.PCMMPdpDataProcess;
import org.pcmm.PCMMPdpMsgSender;
import org.umu.cops.stack.COPSError;
import org.umu.cops.stack.COPSError.ErrorTypes;
-import javax.annotation.concurrent.ThreadSafe;
-import java.net.InetAddress;
-import java.util.Map;
-
/**
* Class responsible for managing the gates for a single CCAP.
*/
public class PCMMService {
private Logger logger = LoggerFactory.getLogger(PCMMService.class);
- private final Ccaps ccap;
+ private final Ccap ccap;
private final IpAddress ipAddr;
private final PortNumber portNum;
protected final CcapClient ccapClient;
private final short clientType;
- public PCMMService(final short clientType, final Ccaps ccap) {
+ public PCMMService(final short clientType, final Ccap ccap) {
this.clientType = clientType;
this.ccap = ccap;
ipAddr = ccap.getConnection().getIpAddress();
}
// TODO - Consider creating an object to return that contains a success flag, message, and gate ID or gate object
- public String sendGateSet(final String gatePathStr, final InetAddress subId, final Gates qosGate,
+ public String sendGateSet(final String gatePathStr, final InetAddress subId, final Gate qosGate,
final ServiceFlowDirection scnDir) {
logger.info("Sending gate to CCAP with ID - " + ccap.getCcapId());
// assemble the gate request for this subId
final PCMMGateReqBuilder gateBuilder = new PCMMGateReqBuilder();
- gateBuilder.build(ccap.getAmId());
- gateBuilder.build(subId);
+ gateBuilder.setAmId(ccap.getAmId());
+ gateBuilder.setSubscriberId(subId);
// force gateSpec.Direction to align with SCN direction
final ServiceClassName scn = qosGate.getTrafficProfile().getServiceClassName();
if (scn != null) {
- gateBuilder.build(qosGate.getGateSpec(), scnDir);
+ gateBuilder.setGateSpec(qosGate.getGateSpec(), scnDir);
} else {
// not an SCN gate
- gateBuilder.build(qosGate.getGateSpec(), null);
+ gateBuilder.setGateSpec(qosGate.getGateSpec(), null);
}
- gateBuilder.build(qosGate.getTrafficProfile());
+ gateBuilder.setTrafficProfile(qosGate.getTrafficProfile());
// pick a classifier type (only one for now)
if (qosGate.getClassifier() != null) {
- gateBuilder.build(qosGate.getClassifier());
+ gateBuilder.setClassifier(qosGate.getClassifier());
} else if (qosGate.getExtClassifier() != null) {
- gateBuilder.build(qosGate.getExtClassifier());
+ gateBuilder.setExtClassifier(qosGate.getExtClassifier());
} else if (qosGate.getIpv6Classifier() != null) {
- gateBuilder.build(qosGate.getIpv6Classifier());
+ gateBuilder.setIpv6Classifier(qosGate.getIpv6Classifier());
}
// assemble the final gate request
- final PCMMGateReq gateReq = gateBuilder.getGateReq();
+ final PCMMGateReq gateReq = gateBuilder.build();
if (gateRequests.get(gatePathStr) == null) {
// and remember it
package org.opendaylight.controller.packetcable.provider;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutionException;
+import javax.annotation.concurrent.ThreadSafe;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.Ccap;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.Qos;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceClassName;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceFlowDirection;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.Ccaps;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.CcapsKey;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.attributes.Connection;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.Apps;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.AppsKey;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.Subs;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.SubsKey;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.subs.Gates;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.subs.GatesKey;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.Ccaps;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.Qos;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceClassName;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceFlowDirection;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccap.attributes.Connection;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccaps.Ccap;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccaps.CcapKey;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.App;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.AppKey;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.app.subscribers.Subscriber;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.app.subscribers.SubscriberKey;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.app.subscribers.subscriber.gates.Gate;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.app.subscribers.subscriber.gates.GateKey;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.annotation.concurrent.ThreadSafe;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutionException;
-
/**
* Called by ODL framework to start this bundle.
*
private static final Logger logger = LoggerFactory.getLogger(PacketcableProvider.class);
// keys to the /restconf/config/packetcable:ccap and /restconf/config/packetcable:qos config datastore
- public static final InstanceIdentifier<Ccap> ccapIID = InstanceIdentifier.builder(Ccap.class).build();
+ public static final InstanceIdentifier<Ccaps> ccapIID = InstanceIdentifier.builder(Ccaps.class).build();
public static final InstanceIdentifier<Qos> qosIID = InstanceIdentifier.builder(Qos.class).build();
/**
private ListenerRegistration<DataChangeListener> qosDataChangeListenerRegistration;
// TODO - Revisit these maps and remove the ones no longer necessary
- private final Map<String, Ccaps> ccapMap = new ConcurrentHashMap<>();
- private final Map<String, Gates> gateMap = new ConcurrentHashMap<>();
+ private final Map<String, Ccap> ccapMap = new ConcurrentHashMap<>();
+ private final Map<String, Gate> gateMap = new ConcurrentHashMap<>();
private final Map<String, String> gateCcapMap = new ConcurrentHashMap<>();
- private final Map<Subnet, Ccaps> subscriberSubnetsMap = new ConcurrentHashMap<>();
- private final Map<ServiceClassName, List<Ccaps>> downstreamScnMap = new ConcurrentHashMap<>();
- private final Map<ServiceClassName, List<Ccaps>> upstreamScnMap = new ConcurrentHashMap<>();
+ private final Map<Subnet, Ccap> subscriberSubnetsMap = new ConcurrentHashMap<>();
+ private final Map<ServiceClassName, List<Ccap>> downstreamScnMap = new ConcurrentHashMap<>();
+ private final Map<ServiceClassName, List<Ccap>> upstreamScnMap = new ConcurrentHashMap<>();
/**
* Holds a PCMMService object for each CCAP being managed.
}
}
- private void updateCcapMaps(final Ccaps ccap) {
+ private void updateCcapMaps(final Ccap ccap) {
// add ccap to the subscriberSubnets map
for (final IpPrefix ipPrefix : ccap.getSubscriberSubnets()) {
try {
if (upstreamScnMap.containsKey(scn)) {
upstreamScnMap.get(scn).add(ccap);
} else {
- final List<Ccaps> ccapList = new ArrayList<>();
+ final List<Ccap> ccapList = new ArrayList<>();
ccapList.add(ccap);
upstreamScnMap.put(scn, ccapList);
}
if (downstreamScnMap.containsKey(scn)) {
downstreamScnMap.get(scn).add(ccap);
} else {
- final List<Ccaps> ccapList = new ArrayList<>();
+ final List<Ccap> ccapList = new ArrayList<>();
ccapList.add(ccap);
downstreamScnMap.put(scn, ccapList);
}
}
}
- private void removeCcapFromAllMaps(final Ccaps ccap) {
+ private void removeCcapFromAllMaps(final Ccap ccap) {
// remove the ccap from all maps
// subscriberSubnets map
- for (final Map.Entry<Subnet, Ccaps> entry : subscriberSubnetsMap.entrySet()) {
+ for (final Map.Entry<Subnet, Ccap> entry : subscriberSubnetsMap.entrySet()) {
if (entry.getValue() == ccap) {
subscriberSubnetsMap.remove(entry.getKey());
}
}
// ccap to upstream SCN map
- for (final Map.Entry<ServiceClassName, List<Ccaps>> entry : upstreamScnMap.entrySet()) {
- final List<Ccaps> ccapList = entry.getValue();
+ for (final Map.Entry<ServiceClassName, List<Ccap>> entry : upstreamScnMap.entrySet()) {
+ final List<Ccap> ccapList = entry.getValue();
ccapList.remove(ccap);
if (ccapList.isEmpty()) {
upstreamScnMap.remove(entry.getKey());
}
}
// ccap to downstream SCN map
- for (final Map.Entry<ServiceClassName, List<Ccaps>> entry : downstreamScnMap.entrySet()) {
- final List<Ccaps> ccapList = entry.getValue();
+ for (final Map.Entry<ServiceClassName, List<Ccap>> entry : downstreamScnMap.entrySet()) {
+ final List<Ccap> ccapList = entry.getValue();
ccapList.remove(ccap);
if (ccapList.isEmpty()) {
downstreamScnMap.remove(entry.getKey());
if (service != null) service.disconect();
}
- private Ccaps findCcapForSubscriberId(final InetAddress inetAddr) {
- Ccaps matchedCcap = null;
+ private Ccap findCcapForSubscriberId(final InetAddress inetAddr) {
+ Ccap matchedCcap = null;
int longestPrefixLen = -1;
- for (final Map.Entry<Subnet, Ccaps> entry : subscriberSubnetsMap.entrySet()) {
+ for (final Map.Entry<Subnet, Ccap> entry : subscriberSubnetsMap.entrySet()) {
final Subnet subnet = entry.getKey();
if (subnet.isInNet(inetAddr)) {
int prefixLen = subnet.getPrefixLen();
return matchedCcap;
}
- private ServiceFlowDirection findScnOnCcap(final ServiceClassName scn, final Ccaps ccap) {
+ private ServiceFlowDirection findScnOnCcap(final ServiceClassName scn, final Ccap ccap) {
if (upstreamScnMap.containsKey(scn)) {
- final List<Ccaps> ccapList = upstreamScnMap.get(scn);
+ final List<Ccap> ccapList = upstreamScnMap.get(scn);
if (ccapList.contains(ccap)) {
return ServiceFlowDirection.Us;
}
} else if (downstreamScnMap.containsKey(scn)) {
- final List<Ccaps> ccapList = downstreamScnMap.get(scn);
+ final List<Ccap> ccapList = downstreamScnMap.get(scn);
if (ccapList.contains(ccap)) {
return ServiceFlowDirection.Ds;
}
private class InstanceData {
// CCAP Identity
- public final Map<InstanceIdentifier<Ccaps>, Ccaps> ccapIidMap = new HashMap<>();
+ public final Map<InstanceIdentifier<Ccap>, Ccap> ccapIidMap = new HashMap<>();
// Gate Identity
public String subId;
public final Map<String, String> gatePathMap = new HashMap<>();
public String gatePath;
- public final Map<InstanceIdentifier<Gates>, Gates> gateIidMap = new HashMap<>();
- // remove path for either CCAP or Gates
+ public final Map<InstanceIdentifier<Gate>, Gate> gateIidMap = new HashMap<>();
+ // remove path for either CCAP or Gate
public final Set<String> removePathList = new HashSet<>();
public final Set<InstanceIdentifier<?>> reqCcapIds = new HashSet<>();
private void getGatePathMap(final InstanceIdentifier<?> thisInstance) {
logger.info("onDataChanged().getGatePathMap(): " + thisInstance);
try {
- final InstanceIdentifier<Ccaps> ccapInstance = thisInstance.firstIdentifierOf(Ccaps.class);
+ final InstanceIdentifier<Ccap> ccapInstance = thisInstance.firstIdentifierOf(Ccap.class);
if (ccapInstance != null) {
- final CcapsKey ccapKey = InstanceIdentifier.keyOf(ccapInstance);
+ final CcapKey ccapKey = InstanceIdentifier.keyOf(ccapInstance);
if (ccapKey != null) {
gatePathMap.put("ccapId", ccapKey.getCcapId());
}
} else {
// get the gate path keys from the InstanceIdentifier Map key set if they are there
- final InstanceIdentifier<Apps> appsInstance = thisInstance.firstIdentifierOf(Apps.class);
- if (appsInstance != null) {
- final AppsKey appKey = InstanceIdentifier.keyOf(appsInstance);
+ final InstanceIdentifier<App> appInstance = thisInstance.firstIdentifierOf(App.class);
+ if (appInstance != null) {
+ final AppKey appKey = InstanceIdentifier.keyOf(appInstance);
if (appKey != null) {
gatePathMap.put("appId", appKey.getAppId());
}
}
- final InstanceIdentifier<Subs> subsInstance = thisInstance.firstIdentifierOf(Subs.class);
- if (subsInstance != null) {
- final SubsKey subKey = InstanceIdentifier.keyOf(subsInstance);
+ final InstanceIdentifier<Subscriber> subInstance = thisInstance.firstIdentifierOf(Subscriber.class);
+ if (subInstance != null) {
+ final SubscriberKey subKey = InstanceIdentifier.keyOf(subInstance);
if (subKey != null) {
- subId = subKey.getSubId();
+ subId = subKey.getSubscriberId();
gatePathMap.put("subId", subId);
}
}
- final InstanceIdentifier<Gates> gatesInstance = thisInstance.firstIdentifierOf(Gates.class);
+ final InstanceIdentifier<Gate> gatesInstance = thisInstance.firstIdentifierOf(Gate.class);
if (gatesInstance != null) {
- final GatesKey gateKey = InstanceIdentifier.keyOf(gatesInstance);
+ final GateKey gateKey = InstanceIdentifier.keyOf(gatesInstance);
if (gateKey != null) {
gatePathMap.put("gateId", gateKey.getGateId());
}
logger.info("onDataChanged().getCcaps(): " + thisData);
for (final Map.Entry<InstanceIdentifier<?>, DataObject> entry : thisData.entrySet()) {
- if (entry.getKey().getTargetType().equals(Ccaps.class)) {
- Ccaps ccaps = ((Ccaps) entry.getValue());
- InstanceIdentifier<Ccaps> ccapsIid = InstanceIdentifier.builder(Ccap.class).child(Ccaps.class, new CcapsKey(ccaps.getCcapId())).build();
+ if (entry.getKey().getTargetType().equals(Ccap.class)) {
+ Ccap ccaps = ((Ccap) entry.getValue());
+ InstanceIdentifier<Ccap> ccapsIid = InstanceIdentifier.builder(Ccaps.class).child(Ccap.class, new CcapKey(ccaps.getCcapId())).build();
ccapIidMap.put(ccapsIid, ccaps);
}
if (entry.getKey().getTargetType().equals(Connection.class) ||
- entry.getKey().getTargetType().equals(Ccaps.class)) {
+ entry.getKey().getTargetType().equals(Ccap.class)) {
reqCcapIds.add(entry.getKey());
}
}
private void getGates(final Map<InstanceIdentifier<?>, DataObject> thisData) {
logger.info("onDataChanged().getGates(): " + thisData);
for (final Map.Entry<InstanceIdentifier<?>, DataObject> entry : thisData.entrySet()) {
- if (entry.getValue() instanceof Gates) {
- final Gates gate = (Gates)entry.getValue();
+ if (entry.getValue() instanceof Gate) {
+ final Gate gate = (Gate)entry.getValue();
// TODO FIXME - Potential ClassCastException thrown here!!!
- final InstanceIdentifier<Gates> gateIID = (InstanceIdentifier<Gates>)entry.getKey();
+ final InstanceIdentifier<Gate> gateIID = (InstanceIdentifier<Gate>)entry.getKey();
getGatePathMap(gateIID);
if (!gateIidMap.containsKey(gateIID)){
gateIidMap.put(gateIID, gate);
// if (apps.getSubs() != null) {
// for (Subs subs : apps.getSubs()) {
// if (subs.getGates() != null) {
-// for (Gates gates : subs.getGates()) {
-// final InstanceIdentifier<Gates> gateIID = (InstanceIdentifier<Gates>)entry.getKey();
+// for (Gate gates : subs.getGates()) {
+// final InstanceIdentifier<Gate> gateIID = (InstanceIdentifier<Gate>)entry.getKey();
// getGatePathMap(gateIID);
// if (!gateIidMap.containsKey(gateIID)){
// gateIidMap.put(gateIID, gates);
// get the CCAP parameters
String message;
if (! thisData.reqCcapIds.isEmpty()) {
- for (Map.Entry<InstanceIdentifier<Ccaps>, Ccaps> entry : thisData.ccapIidMap.entrySet()) {
- final Ccaps thisCcap = entry.getValue();
+ for (Map.Entry<InstanceIdentifier<Ccap>, Ccap> entry : thisData.ccapIidMap.entrySet()) {
+ final Ccap thisCcap = entry.getValue();
// get the CCAP node identity from the Instance Data
final String ccapId = thisCcap.getCcapId();
}
} else {
// get the PCMM gate parameters from the ccapId/appId/subId/gateId path in the Maps entry (if new gate)
- for (final Map.Entry<InstanceIdentifier<Gates>, Gates> entry : thisData.gateIidMap.entrySet()) {
+ for (final Map.Entry<InstanceIdentifier<Gate>, Gate> entry : thisData.gateIidMap.entrySet()) {
message = null;
- final Gates gate = entry.getValue();
+ final Gate gate = entry.getValue();
final String gateId = gate.getGateId();
final String gatePathStr = thisData.gatePath + "/" + gateId ;
final InetAddress subId = getInetAddress(thisData.subId);
if (subId != null) {
- final Ccaps thisCcap = findCcapForSubscriberId(subId);
+ final Ccap thisCcap = findCcapForSubscriberId(subId);
if (thisCcap != null) {
final String ccapId = thisCcap.getCcapId();
// verify SCN exists on CCAP and force gateSpec.Direction to align with SCN direction
logger.info("onRemove(): " + thisData);
for (final String gatePathStr: thisData.removePathList) {
if (gateMap.containsKey(gatePathStr)) {
- final Gates thisGate = gateMap.remove(gatePathStr);
+ final Gate thisGate = gateMap.remove(gatePathStr);
final String gateId = thisGate.getGateId();
final String ccapId = gateCcapMap.remove(gatePathStr);
- final Ccaps thisCcap = ccapMap.get(ccapId);
+ final Ccap thisCcap = ccapMap.get(ccapId);
final PCMMService service = pcmmServiceMap.get(thisCcap.getCcapId());
if (service != null) {
service.sendGateDelete(gatePathStr);
}
for (final String ccapIdStr: thisData.removePathList) {
if (ccapMap.containsKey(ccapIdStr)) {
- final Ccaps thisCcap = ccapMap.remove(ccapIdStr);
+ final Ccap thisCcap = ccapMap.remove(ccapIdStr);
removeCcapFromAllMaps(thisCcap);
}
}
logger.info("onUpdate(): " + oldData);
// update operation not allowed -- restore the original config object and complain
if (! oldData.ccapIidMap.isEmpty()) {
- for (final Map.Entry<InstanceIdentifier<Ccaps>, Ccaps> entry : oldData.ccapIidMap.entrySet()) {
- final Ccaps ccap = entry.getValue();
+ for (final Map.Entry<InstanceIdentifier<Ccap>, Ccap> entry : oldData.ccapIidMap.entrySet()) {
+ final Ccap ccap = entry.getValue();
final String ccapId = ccap.getCcapId();
// restores the original data - although I don't think this is what is done here! I think the update data is put into the DS/config
mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, entry.getKey(), ccap);
logger.error("onDataChanged(): CCAP update not permitted {}/{}", ccapId, ccap);
}
} else {
- for (final Map.Entry<InstanceIdentifier<Gates>, Gates> entry : oldData.gateIidMap.entrySet()) {
- final Gates gate = entry.getValue();
+ for (final Map.Entry<InstanceIdentifier<Gate>, Gate> entry : oldData.gateIidMap.entrySet()) {
+ final Gate gate = entry.getValue();
final String gatePathStr = oldData.gatePath + "/" + gate.getGateId() ;
// restores the original data - although I don't think this is what is done here! I think the update data is put into the DS/config
mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, entry.getKey(), gate);
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceClassName;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceFlowDirection;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.TosByte;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.TpProtocol;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.Ccaps;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.CcapsBuilder;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.attributes.AmId;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.attributes.AmIdBuilder;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.attributes.Connection;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.attributes.ConnectionBuilder;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.classifier.Classifier;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.classifier.ClassifierBuilder;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.ext.classifier.ExtClassifier;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.ext.classifier.ExtClassifierBuilder;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gate.spec.GateSpec;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gate.spec.GateSpecBuilder;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.subs.Gates;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.subs.GatesBuilder;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.ipv6.classifier.Ipv6Classifier;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.ipv6.classifier.Ipv6ClassifierBuilder;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.traffic.profile.TrafficProfile;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.traffic.profile.TrafficProfileBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceClassName;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceFlowDirection;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.TosByte;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.TpProtocol;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccap.attributes.AmId;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccap.attributes.AmIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccap.attributes.Connection;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccap.attributes.ConnectionBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccaps.Ccap;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccaps.CcapBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.classifier.Classifier;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.classifier.ClassifierBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.ext.classifier.ExtClassifier;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.ext.classifier.ExtClassifierBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gate.spec.GateSpec;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gate.spec.GateSpecBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.app.subscribers.subscriber.gates.Gate;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.app.subscribers.subscriber.gates.GateBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.ipv6.classifier.Ipv6Classifier;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.ipv6.classifier.Ipv6ClassifierBuilder;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.traffic.profile.TrafficProfile;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.traffic.profile.TrafficProfileBuilder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
private final MdsalUtils mdsalUtils;
// Gate Identities
- private final Map<InstanceIdentifier<Gates>, Gates> gateIidMap;
+ private final Map<InstanceIdentifier<Gate>, Gate> gateIidMap;
// CCAP Identity
- private transient Ccaps ccap;
- private transient InstanceIdentifier<Ccaps> ccapIID;
+ private transient Ccap ccap;
+ private transient InstanceIdentifier<Ccap> ccapIID;
public ValidateInstanceData(final MdsalUtils mdsalUtils, final Map<InstanceIdentifier<?>, DataObject> thisData) {
this.mdsalUtils = mdsalUtils;
return false;
}
} else if (! gateIidMap.isEmpty()) {
- for (Map.Entry<InstanceIdentifier<Gates>, Gates> entry : gateIidMap.entrySet()) {
- InstanceIdentifier<Gates> gateIID = entry.getKey();
- Gates gate = entry.getValue();
+ for (Map.Entry<InstanceIdentifier<Gate>, Gate> entry : gateIidMap.entrySet()) {
+ InstanceIdentifier<Gate> gateIID = entry.getKey();
+ Gate gate = entry.getValue();
if (! validateGate(gate)) {
logger.error("Validate Gate {} failed - {}", gate.getGateId());
mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, gateIID);
private void getCcap(final Map<InstanceIdentifier<?>, DataObject> thisData) {
for (final Map.Entry<InstanceIdentifier<?>, DataObject> entry : thisData.entrySet()) {
- if (entry.getValue() instanceof Ccaps) {
- ccap = (Ccaps)entry.getValue();
+ if (entry.getValue() instanceof Ccap) {
+ ccap = (Ccap)entry.getValue();
// TODO FIXME - ClassCastException waiting to occur here!!!
- ccapIID = (InstanceIdentifier<Ccaps>) entry.getKey();
+ ccapIID = (InstanceIdentifier<Ccap>) entry.getKey();
}
}
}
private void getGates(final Map<InstanceIdentifier<?>, DataObject> thisData) {
for (final Map.Entry<InstanceIdentifier<?>, DataObject> entry : thisData.entrySet()) {
- if (entry.getValue() instanceof Gates) {
- final Gates gate = (Gates)entry.getValue();
+ if (entry.getValue() instanceof Gate) {
+ final Gate gate = (Gate)entry.getValue();
// TODO FIXME - ClassCastException waiting to occur here!!!
- final InstanceIdentifier<Gates> gateIID = (InstanceIdentifier<Gates>)entry.getKey();
+ final InstanceIdentifier<Gate> gateIID = (InstanceIdentifier<Gate>)entry.getKey();
gateIidMap.put(gateIID, gate);
}
}
return null;
}
- private boolean validateGateSpec(final Gates gate, final GatesBuilder gateBuilder) {
+ private boolean validateGateSpec(final Gate gate, final GateBuilder gateBuilder) {
// gate-spec
String message = "";
String error;
return valid;
}
- private boolean validateTrafficProfile(final Gates gate, final GatesBuilder gateBuilder) {
+ private boolean validateTrafficProfile(final Gate gate, final GateBuilder gateBuilder) {
// traffic-profile
String message = "";
boolean valid = true;
}
// TODO FIXME - Break this method apart
- private boolean validateClassifier(final Gates gate, final GatesBuilder gateBuilder) {
+ private boolean validateClassifier(final Gate gate, final GateBuilder gateBuilder) {
// validate classifier
String message = "";
boolean valid = true;
}
// TODO FIXME - breakup this method
- private boolean validateExtClassifier(final Gates gate, final GatesBuilder gateBuilder) {
+ private boolean validateExtClassifier(final Gate gate, final GateBuilder gateBuilder) {
// validate ext-classifier
String message = "";
String error;
}
// TODO FIXME - break apart this method.
- private boolean validateIpv6Classifier(final Gates gate, final GatesBuilder gateBuilder) {
+ private boolean validateIpv6Classifier(final Gate gate, final GateBuilder gateBuilder) {
// validate ipv6-classifier
String message = "";
String error;
}
// TODO FIXME - Do we really want the gate parameter object to be muted by this method?
- private boolean validateGate(Gates gate) {
+ private boolean validateGate(Gate gate) {
// validate gate elements and null out invalid elements as we go
- final GatesBuilder gateBuilder = new GatesBuilder();
+ final GateBuilder gateBuilder = new GateBuilder();
String message = "";
boolean rebuild = false;
// gate-spec
return (! rebuild);
}
- private boolean validateAmId(final Ccaps ccap, final CcapsBuilder ccapBuilder) {
+ private boolean validateAmId(final Ccap ccap, final CcapBuilder ccapBuilder) {
// amId
String message = "";
String error;
return valid;
}
- private boolean validateConnection(final Ccaps ccap, final CcapsBuilder ccapBuilder) {
+ private boolean validateConnection(final Ccap ccap, final CcapBuilder ccapBuilder) {
// connection
String message = "";
String error;
return valid;
}
- private boolean validateSubscriberSubnets(final Ccaps ccap, final CcapsBuilder ccapBuilder) {
+ private boolean validateSubscriberSubnets(final Ccap ccap, final CcapBuilder ccapBuilder) {
// subscriber-subnets
String message = "";
String error;
boolean valid = true;
List<IpPrefix> subnets = null;
- error = validateMethod(Ccaps.class, ccap, "getSubscriberSubnets");
+ error = validateMethod(Ccap.class, ccap, "getSubscriberSubnets");
if (error == null) {
subnets = ccap.getSubscriberSubnets();
if (subnets == null) {
return valid;
}
- private boolean validateUpstreamScns(final Ccaps ccap, final CcapsBuilder ccapBuilder) {
+ private boolean validateUpstreamScns(final Ccap ccap, final CcapBuilder ccapBuilder) {
// upstream-scns
String message = "";
String error;
boolean valid = true;
List<ServiceClassName> usScns = null;
- error = validateMethod(Ccaps.class, ccap, "getUpstreamScns");
+ error = validateMethod(Ccap.class, ccap, "getUpstreamScns");
if (error == null) {
usScns = ccap.getUpstreamScns();
if (usScns == null) {
return valid;
}
- private boolean validateDownstreamScns(final Ccaps ccap, final CcapsBuilder ccapBuilder) {
+ private boolean validateDownstreamScns(final Ccap ccap, final CcapBuilder ccapBuilder) {
// downstream-scns
String message = "";
boolean valid = true;
List<ServiceClassName> dsScns = null;
- final String error = validateMethod(Ccaps.class, ccap, "getDownstreamScns");
+ final String error = validateMethod(Ccap.class, ccap, "getDownstreamScns");
if (error == null) {
dsScns = ccap.getDownstreamScns();
if (dsScns == null) {
// TODO FIXME - Do we really want the ccap parameter object to be muted by this method?
- private boolean validateCcap(Ccaps ccap) {
+ private boolean validateCcap(Ccap ccap) {
// validate ccap and null out invalid elements as we go
- final CcapsBuilder ccapBuilder = new CcapsBuilder();
+ final CcapBuilder ccapBuilder = new CcapBuilder();
String message = "";
boolean rebuild = false;
// amId
package org.opendaylight.controller.packetcable.provider;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceClassName;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ServiceFlowDirection;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.TosByte;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.TpProtocol;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.Ccaps;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.attributes.AmId;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.ccap.attributes.Connection;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.classifier.Classifier;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gate.spec.GateSpec;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.gates.apps.subs.Gates;
-import org.opendaylight.yang.gen.v1.urn.packetcable.rev150327.pcmm.qos.traffic.profile.TrafficProfile;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceClassName;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ServiceFlowDirection;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.TosByte;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.TpProtocol;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccap.attributes.AmId;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccap.attributes.Connection;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.ccaps.Ccap;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.classifier.Classifier;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gate.spec.GateSpec;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.gates.apps.app.subscribers.subscriber.gates.Gate;
+import org.opendaylight.yang.gen.v1.urn.packetcable.rev151026.pcmm.qos.traffic.profile.TrafficProfile;
import org.pcmm.PCMMPdpAgent;
import org.pcmm.gates.IGateSpec.Direction;
import org.pcmm.gates.IPCMMGate;
import org.pcmm.rcd.IPCMMClient;
import org.pcmm.rcd.impl.CMTS;
-import org.umu.cops.stack.*;
+import org.umu.cops.stack.COPSClientSI;
+import org.umu.cops.stack.COPSContext;
import org.umu.cops.stack.COPSContext.RType;
+import org.umu.cops.stack.COPSData;
+import org.umu.cops.stack.COPSDecision;
import org.umu.cops.stack.COPSDecision.Command;
import org.umu.cops.stack.COPSDecision.DecisionFlag;
+import org.umu.cops.stack.COPSDecisionMsg;
+import org.umu.cops.stack.COPSHandle;
+import org.umu.cops.stack.COPSMsg;
+import org.umu.cops.stack.COPSMsgParser;
import org.umu.cops.stack.COPSObjHeader.CNum;
import org.umu.cops.stack.COPSObjHeader.CType;
-import java.io.*;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
/**
* Tests the PCMMService's ability to connect to a CMTS. Gate additions will not properly work as there is currently
* not any other means to receive acknowledgements. This functionality must be tested by the PCMMService's client
/**
* Defines the CMTS to add to the PCMMService
*/
- private Ccaps ccap;
+ private Ccap ccap;
/**
* The class under test
// Use me when testing against a CMTS or emulator not running in the same JVM
cmtsAddr = new Ipv4Address("10.32.10.3");
- ccap = makeCcapsObj(PCMMPdpAgent.WELL_KNOWN_PDP_PORT, cmtsAddr, ccapId);
+ ccap = makeCcapObj(PCMMPdpAgent.WELL_KNOWN_PDP_PORT, cmtsAddr, ccapId);
} else {
cmAddrInet = InetAddress.getByAddress(new byte[] {10, 32, 110, (byte)180});
invalidCmAddrInet = InetAddress.getByAddress(new byte[] {99, 99, 99, 99});
// Use me for automated testing and the CMTS emulator running in the same JVM
cmtsAddr = new Ipv4Address("127.0.0.1");
- final Set<String> upGates = new HashSet<>();
- upGates.add("extrm_up");
- final Set<String> dnGates = new HashSet<>();
- dnGates.add("extrm_dn");
+ final Set<String> upGate = new HashSet<>();
+ upGate.add("extrm_up");
+ final Set<String> dnGate = new HashSet<>();
+ dnGate.add("extrm_dn");
final Map<Direction, Set<String>> gates = new HashMap<>();
- gates.put(Direction.UPSTREAM, upGates);
- gates.put(Direction.DOWNSTREAM, dnGates);
+ gates.put(Direction.UPSTREAM, upGate);
+ gates.put(Direction.DOWNSTREAM, dnGate);
final Map<String, Boolean> cmStatus = new HashMap<>();
cmStatus.put(cmAddrInet.getHostAddress(), true);
icmts = new CMTS(gates, cmStatus);
icmts.startServer();
- ccap = makeCcapsObj(icmts.getPort(), cmtsAddr, ccapId);
+ ccap = makeCcapObj(icmts.getPort(), cmtsAddr, ccapId);
}
service = new PCMMService(IPCMMClient.CLIENT_TYPE, ccap);
final int port;
if (icmts != null) port = icmts.getPort() + 1;
else port = PCMMPdpAgent.WELL_KNOWN_PDP_PORT + 1;
- ccap = makeCcapsObj(port, cmtsAddr, ccapId);
+ ccap = makeCcapObj(port, cmtsAddr, ccapId);
service = new PCMMService(IPCMMClient.CLIENT_TYPE, ccap);
final String message = service.addCcap();
Assert.assertNotNull(message);
final Socket socket = new MockSocket();
final ServiceFlowDirection direction = ServiceFlowDirection.Us;
- final Gates gate = makeGateObj("extrm_up", cmtsAddr, direction, new Ipv4Address("127.0.0.1"));
+ final Gate gate = makeGateObj("extrm_up", cmtsAddr, direction, new Ipv4Address("127.0.0.1"));
final IPCMMGate gateReq = makeGateRequest(ccap, gate, InetAddress.getByName("localhost"), direction);
final byte[] data = gateReq.getData();
final Ipv4Address dstAddr, final ServiceFlowDirection direction,
final InetAddress cmAddrInet, final String gatePath,
final String expGateSetMsgStart) {
- final Gates gate = makeGateObj(scnName, srcAddr, direction, dstAddr);
+ final Gate gate = makeGateObj(scnName, srcAddr, direction, dstAddr);
final String gateSetMsg = service.sendGateSet(gatePath, cmAddrInet, gate, direction);
Assert.assertNotNull(gateSetMsg);
}
/**
- * Creates a mock Ccaps object that can be used for connecting to a CMTS
+ * Creates a mock Ccap object that can be used for connecting to a CMTS
* @param inPort - the CMTS port number
* @param ipAddr - the CMTS IPv4 address string
* @param ccapId - the ID of the CCAP
- * @return - the mock Ccaps object
+ * @return - the mock Ccap object
*/
- private Ccaps makeCcapsObj(final int inPort, final Ipv4Address ipAddr, final String ccapId) {
- final Ccaps ccap = Mockito.mock(Ccaps.class);
+ private Ccap makeCcapObj(final int inPort, final Ipv4Address ipAddr, final String ccapId) {
+ final Ccap ccap = Mockito.mock(Ccap.class);
final Connection conn = Mockito.mock(Connection.class);
Mockito.when(ccap.getConnection()).thenReturn(conn);
final PortNumber port = Mockito.mock(PortNumber.class);
}
/**
- * Creates a mock Gates object
+ * Creates a mock Gate object
* @param scnValue - the service class name defined on the CMTS
* @param dstAddr - the CM address this gate should be set against
* @return - the gate request
*/
- private Gates makeGateObj(final String scnValue, final Ipv4Address srcAddr, final ServiceFlowDirection direction,
+ private Gate makeGateObj(final String scnValue, final Ipv4Address srcAddr, final ServiceFlowDirection direction,
final Ipv4Address dstAddr) {
- final Gates gate = Mockito.mock(Gates.class);
+ final Gate gate = Mockito.mock(Gate.class);
final GateSpec gateSpec = Mockito.mock(GateSpec.class);
Mockito.when(gate.getGateSpec()).thenReturn(gateSpec);
Mockito.when(gateSpec.getDirection()).thenReturn(direction);
return gate;
}
- private IPCMMGate makeGateRequest(final Ccaps ccap, final Gates gateReq, final InetAddress addrSubId,
+ private IPCMMGate makeGateRequest(final Ccap ccap, final Gate gateReq, final InetAddress addrSubId,
final ServiceFlowDirection direction) {
final PCMMGateReqBuilder gateBuilder = new PCMMGateReqBuilder();
- gateBuilder.build(ccap.getAmId());
- gateBuilder.build(addrSubId);
+ gateBuilder.setAmId(ccap.getAmId());
+ gateBuilder.setSubscriberId(addrSubId);
// force gateSpec.Direction to align with SCN direction
final ServiceClassName scn = gateReq.getTrafficProfile().getServiceClassName();
if (scn != null) {
- gateBuilder.build(gateReq.getGateSpec(), direction);
+ gateBuilder.setGateSpec(gateReq.getGateSpec(), direction);
} else {
// not an SCN gate
- gateBuilder.build(gateReq.getGateSpec(), null);
+ gateBuilder.setGateSpec(gateReq.getGateSpec(), null);
}
- gateBuilder.build(gateReq.getTrafficProfile());
+ gateBuilder.setTrafficProfile(gateReq.getTrafficProfile());
// pick a classifier type (only one for now)
if (gateReq.getClassifier() != null) {
- gateBuilder.build(gateReq.getClassifier());
+ gateBuilder.setClassifier(gateReq.getClassifier());
} else if (gateReq.getExtClassifier() != null) {
- gateBuilder.build(gateReq.getExtClassifier());
+ gateBuilder.setExtClassifier(gateReq.getExtClassifier());
} else if (gateReq.getIpv6Classifier() != null) {
- gateBuilder.build(gateReq.getIpv6Classifier());
+ gateBuilder.setIpv6Classifier(gateReq.getIpv6Classifier());
}
// assemble the final gate request
- return gateBuilder.getGateReq();
+ return gateBuilder.build();
}
private class MockSocket extends Socket {