OneM2M_Templates.ttcn 134 KB
Newer Older
1 2 3 4 5 6 7
/**
 *  Copyright Notification
 *  No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
 *  The copyright and the foregoing restriction extend to reproduction in all media.
 *  © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
 *  All rights reserved.
 *  
8 9 10
 *  @author     ETSI
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
 *              $Id: OneM2M_Templates.ttcn 347 2017-08-11 08:48:20Z reinaortega $
11 12 13 14 15 16 17 18 19 20
 *  @desc       Module containing templates for oneM2M
 *
 */
module OneM2M_Templates {

	import from XSD all;
	import from OneM2M_Types all;
	import from OneM2M_TypesAndValues all;
	//import from OneM2M_AdditionalTypes all;
	import from OneM2M_Pixits all;
21
	//import from OneM2M_Functions all;
22

23
		
24 25 26 27 28 29
	/**
	 * @desc Get a converted to string random number 
	 * @param p_lower Lower limit 
	 * @param p_upper Upper limit
	 * @return Random number converted to string
	 * @verdict 
30
	 */
31 32 33 34 35
	function f_rnd(in integer p_lower, in integer p_upper) return charstring {
		
		return int2str(float2int(rnd() * int2float(p_upper - p_lower + 1)) + p_lower);	
	}

36 37

	/* Templates */
38
	
39
	group Primitives {
40 41 42 43
		/** 
		 * @desc Base template for request sending operations
		 * @param p_requestPrimitive
		 */
44
		template (value) MsgOut m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
45 46 47 48 49
			primitive := { requestPrimitive := p_requestPrimitive},
			host := PX_SUT_ADDRESS,
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := PX_PROTOCOL_BINDING,
			serialization := PX_SERIALIZATION, 
50
			forcedFields := p_forcedFields
51
		};
52 53 54 55 56
    	
		/** 
		 * @desc Base template for response sending operations
		 * @param p_responsePrimitive
		 */
57
		template (value) MsgOut m_response(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
58
			primitive := { responsePrimitive := p_responsePrimitive},
59
			host := PX_SUT_ADDRESS,
60 61 62
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := PX_PROTOCOL_BINDING,
			serialization := PX_SERIALIZATION, 
63
			forcedFields := p_forcedFields
64
		};
65 66 67 68 69 70 71 72 73 74 75 76 77 78
		
		/** 
		 * @desc Base template for response sending operations
		 * @param p_responsePrimitive
		 */
		template (value) MsgOut m_httpResponse(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
			primitive := { responsePrimitive := p_responsePrimitive},
			host := PX_SUT_ADDRESS,
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := "HTTP",
			serialization := PX_SERIALIZATION, 
			forcedFields := p_forcedFields
		};
		
79 80 81
		template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive, template AttributeList_1 p_nullFields := *) := {
			primitive := { requestPrimitive := p_requestPrimitive}, 
			nullFields := p_nullFields
82
		};
83 84 85 86 87
    	
		/** 
		 * @desc Base template for response receiving operations
		 * @param p_responsePrimitive
		 */
88 89 90
		template MsgIn mw_response(in template (present) ResponsePrimitive p_responsePrimitive := ?, template AttributeList_1 p_nullFields := *) := {
			primitive := { responsePrimitive := p_responsePrimitive}, 
			nullFields := p_nullFields
91 92
		};
    	
93
	}//end of group primitives
94 95 96 97
	
	group RequestPrimitives { 
		
		group Retrieve {
98

99 100 101 102
			/**
			 * @desc Base RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
103
			 */
104
			template (value) RequestPrimitive m_retrieve(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
105
				operation := int2,
106
				to_ := p_targetResourceAddress,
107
				from_ := p_originator,
108
				requestIdentifier := "m_retrieve" & f_rnd(1, 1000000),
109
				resourceType := omit,
110
				primitiveContent := omit,
111
				role := omit, 
112 113 114 115 116 117 118 119 120 121 122
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
123
				discoveryResultType := omit
124
			};
125
			
126 127 128 129
			/**
			 * @desc Base Receive RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 */
130
			template RequestPrimitive mw_retrieve(template XSD.ID p_targetResourceAddress) := {
131 132 133 134
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := ?,
				requestIdentifier := ?,
135
				resourceType := omit,
136
				primitiveContent := *,
137
				role := *, 
138 139 140 141 142 143 144 145 146 147 148
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
149
				discoveryResultType := *
150 151
			};
        	
152 153 154 155 156
			/**
			 * @desc RETRIEVE request primitive for a single attribute in To field ("targetResourceAddress#AttributeName")
			 * @param p_targetResourceAddress Target resource address (including "#AttributeName")
			 * @param p_originator Originator (from)
			 */
157
			template (value) RequestPrimitive m_retrieveAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
158 159 160 161 162
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := p_originator,
				requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
				resourceType := omit,
163
				primitiveContent := omit, 
164
				role := omit,
165 166 167 168 169 170 171 172 173 174 175
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
176
				discoveryResultType := omit
177
			};
178
        	
179 180 181 182 183
			/**
			 * @desc RETRIEVE request primtive containing the target attributes in the primitiveContent field
			 * @param p_targetResourceAddress Target resource address 
			 * @param p_attributeList Target attribute list
			 * @param p_originator Originator (from)
184
			 */
185
			template (value) RequestPrimitive m_retrieveAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
186
				operation := int2,
187
				to_ := p_targetResourceAddress,
188
				from_ := p_originator,
189 190
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
191
				primitiveContent := {attributeList := p_attributeList},
192
				role := omit,
193 194 195 196 197 198 199 200 201 202 203
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
204
				discoveryResultType := omit
205
			};
206 207 208 209 210 211
			
			/**
			  * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
212
			 */
213
			template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
214 215
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
216 217 218 219 220 221 222 223 224 225 226 227 228 229
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
230 231
					filterUsage := p_filterUsage, 
					limit := omit
232 233 234
				}
			};
			
235 236 237 238 239 240 241 242 243 244 245
			/**
			  * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
			template (value) RequestPrimitive m_retrieveFilterCriteria(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterCriteria p_filterCriteria) modifies m_retrieve := {
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := p_filterCriteria
			};
			
Pramod Kulkarni's avatar
Pramod Kulkarni committed
246 247 248 249 250 251 252
			/**
			  * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_originator Originator (from)
			  * @param p_filterUsage FilterUsage
			  * @param p_labels Labels
			 */
253
			template (value) RequestPrimitive m_retrieveFilterUsageOptionLabel(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage, in Labels p_labels) modifies m_retrieve := {
Pramod Kulkarni's avatar
Pramod Kulkarni committed
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
				requestIdentifier := "m_retrieveResourceFilterUsageOptionLabel" & f_rnd(1, 1000000),
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := p_labels,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
					filterUsage := p_filterUsage, 
271
					limit := omit
Pramod Kulkarni's avatar
Pramod Kulkarni committed
272 273
				}
			};
274
			
275 276 277 278 279 280
			/**
			  * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
281
			template (value) RequestPrimitive m_retrieveDiscResTypeFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) DiscResType p_discResType, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
282 283
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
284 285 286 287 288 289 290 291 292 293 294 295 296 297
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
298
					filterUsage := p_filterUsage,
299
					limit := omit
300 301 302 303 304
				},
				discoveryResultType := p_discResType
			};
			
			/**
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
			  * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
			template (value) RequestPrimitive m_retrieveInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieve := {
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
					filterUsage := omit,
328
					limit := omit
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
				}
			};
			
			/**
			  * @desc FilterCriteria empty template
			 */
			template (value) FilterCriteria m_filterCriteria := {
				createdBefore := omit,
				createdAfter := omit,
				modifiedSince := omit,
				unmodifiedSince := omit,
				stateTagSmaller := omit,
				stateTagBigger := omit,
				expireBefore := omit,
				expireAfter := omit,
				labels := omit,
				resourceType := omit,
				sizeAbove := omit,
				sizeBelow := omit,
				contentType_list := {},
				attribute_list := {},
				filterUsage := omit,
				limit := omit
			}
			
354
			
355
			
356
		}//end group Retrieve
357

358
		group Update {
359
    		
360
			template (value) RequestPrimitive m_update := {
361 362
				operation := int3,
				to_ := "NotInitialized",
363
				from_ := "NotInitialized",
364
				requestIdentifier := "m_update",
365
				resourceType := omit,
366
				primitiveContent:= omit,
367
				role := omit, 
368 369 370 371 372 373 374 375 376 377 378
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
379
				discoveryResultType := omit
380
			};
381
			
382 383 384 385 386 387
						
			template RequestPrimitive mw_update(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int3,
				to_ := p_to,
				from_ := p_from,
				requestIdentifier := ?,
388
				resourceType := omit,
389
				primitiveContent:= ?,
390
				role := *, 
391 392 393 394 395 396 397 398 399 400 401
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
402
				discoveryResultType := omit
403 404
			};
        	
405 406 407 408
			/**
			 * @desc Base UPDATE request primitive for Ae resource
			 */
			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
409
				requestIdentifier := "m_updateAe",
410
				primitiveContent:= {aE := m_contentUpdateAe}
411
			};
412
						
413 414 415 416 417 418 419 420 421
			/**
			 * @desc Reception template for update Ae resource
			 */
			template RequestPrimitive mw_updateAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int2,
				primitiveContent:= {aE := ?}
			};
			 
        	
422 423 424 425
			/**
			 * @desc Base UPDATE request primitive for Container resource
			 */
			template (value) RequestPrimitive m_updateContainerBase modifies m_update:= {
426
				requestIdentifier := "m_updateContainer",
427
				primitiveContent:= {container := m_contentUpdateContainer}
428
			};
429
			
430 431 432 433 434 435 436 437
			/**
			 * @desc Base Reception template for update Container
			 */
			template RequestPrimitive mw_updateContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int3,
				primitiveContent := {container := ?}
			}; 
			
438 439 440 441
			/**
			 * @desc Base UPDATE request primitive for ContentInstance resource
			 */
			template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= {
442
				requestIdentifier := "m_updateContentInstance",
443
				primitiveContent:= {contentInstance := m_contentUpdateContentInstance}
444 445
			};
			
446 447 448
			/**
			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
			 */        				
449
			template (value) RequestPrimitive m_updateAcpBase modifies m_update := {
450
				requestIdentifier := "m_updateAcp",
451
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcp}
452 453
			};
			
454
			template (value) RequestPrimitive m_updateAcpPrivileges(in template(omit) SetOfAcrs p_privileges := omit, in template(omit) SetOfAcrs p_selfPrivileges := omit) modifies m_update := {
455
				requestIdentifier := "m_updateAcp",
456
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}
457 458
			};
			
459 460 461
			/**
			 * @desc Base UPDATE request primitive for Group resource
			 */
462
			template (value) RequestPrimitive m_updateGroupBase modifies m_update := {
463
				requestIdentifier := "m_updateGroup",
464
				primitiveContent:= {group_ := m_contentUpdateGroup}
465 466
			};
			
467 468 469 470
			/**
			 * @desc Base UPDATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := {
471
				requestIdentifier := "m_updateGroup",
472
				primitiveContent:= {cSEBase := m_contentUpdateCSEBase}
473 474
			};
			
475 476 477
			/**
			 * @desc Base UPDATE request primitive for Schedule resource
			 */
478
			template (value) RequestPrimitive m_updateScheduleBase modifies m_update := {
479
				requestIdentifier := "m_updateSchedule",
480
				primitiveContent:= {schedule := m_contentUpdateSchedule}
481 482
			};
			
483 484 485
			/**
			 * @desc Base UPDATE request primitive for PollingChannel resource
			 */
486
			template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := {
487
				requestIdentifier := "m_updatePollingChannel",
488
				primitiveContent:= {pollingChannel := m_contentUpdatePollingChannel}
489 490
			};
			
491 492 493
			/**
			 * @desc Base UPDATE request primitive for Subscription resource
			 */
494
			template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := {
495
				requestIdentifier := "m_updateSubscription",
496
				primitiveContent:= {subscription := m_contentUpdateSubscription}
497
			};
498
			
499
			template (value) RequestPrimitive m_updateLocationPolicy(XSD.ID p_locResourceAddress, in template (omit) AcpType p_accessControlPolicyIds, in template (value) XSD.Duration p_locationUpdatePeriod) modifies m_update := {
500 501
				to_ 				:= p_locResourceAddress,
				requestIdentifier	:= "m_updateLocationPolicy",
502
				primitiveContent	:= {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)}
503
			  };
504
        	
505
			template (value) RequestPrimitive m_updateNodeBase modifies m_update := {
506
				requestIdentifier := "m_updateNode",
507
				primitiveContent:= {node := m_contentUpdateNode}
508
			}
509
        	
510
			template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := {
511
			   requestIdentifier := "m_updateRemoteCSEBase",
512 513
			   primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
			}
514
        	
515
			template (value) RequestPrimitive m_updateAEAnncBase modifies m_update:= {
516
				requestIdentifier := testcasename() & "-m_updateAEAnnc",
517
				resourceType := int10002,
518
				primitiveContent := {aEAnnc := m_contentUpdateAEAnnc}
519
			};
520
		}//end group Update
521
    	
522
		group Create {
523 524 525 526 527

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
528
				requestIdentifier := testcasename() & "-m_create",
529 530
				resourceType := omit,
				primitiveContent := omit,
531
				role := omit,
532 533 534 535 536 537 538 539 540 541 542
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
543
				discoveryResultType := omit
544
			};
545
        	
546 547 548 549 550
			/**
			 * @desc Base Reception template for create operation
			 */
			template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int1,
551
				to_ := p_to,
552 553 554
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
555
				primitiveContent := ?,
556
				role := *,
557 558 559 560 561 562 563 564 565 566
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
567 568
				filterCriteria := omit,
				discoveryResultType := omit
569 570
			}
			
571 572
			
			/**
573 574 575 576 577 578
			 * @desc Base CREATE request primitive for AEAnnc resource
			 * @param p_accessControlPolicyIds
			 * @param p_to
			 * @param p_from
			 * @param p_appId
			 * @param p_stemId
579
			 */
580
			template (value) RequestPrimitive m_createAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_link) modifies m_create:= {
581
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
582
				requestIdentifier := testcasename() & "-m_createAEAnnc",
583
				resourceType := int10002,
584
				primitiveContent := {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, p_link)}
585 586
			};
			
587
			/**
588
			 * @desc Reception template for CREATE AEAnnc
589
			 */
590
			template RequestPrimitive mw_createAEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := {
591
				resourceType := int10002,
592
				primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
593
			};
594

595
			template (value) RequestPrimitive m_createAe(XSD.ID p_appId, template (omit) AcpType p_accessControlPolicyIds := omit,template (omit) XSD.ID p_from := omit, template (omit) ResourceName p_resourceName :=  c_aeAuxName, in template (omit) PoaList p_poaList := omit) modifies m_create := {
596
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
597
				requestIdentifier := testcasename() & "-m_createAe",
598
				resourceType := int2,
599
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds,p_resourceName, p_appId, p_poaList)}
600
			};
601
        	
602 603 604
			/**
			 * @desc Reception template for AE registration
			 */
605
			template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?, template AE_optional p_ae := ?) modifies mw_create := {
606
				resourceType := int2,
607
				primitiveContent := {aE := p_ae}
608 609
			};  
			        	
610 611
			template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := {
				from_ := PX_AE1_ID_STEM,//TODO We should use omit, "s", or "c"
612
				requestIdentifier := testcasename() & "-m_createAe",
613 614
				resourceType := int2,
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds, c_aeAuxName, -, p_poaList)}
615
			};
616
        	
617 618 619
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource
			 */
620
			template (value) RequestPrimitive m_createAcpBase modifies m_create := {
621
				requestIdentifier := testcasename() & "-m_createAcp",
622
				resourceType := int1,
623
				primitiveContent := {accessControlPolicy := m_contentCreateAcp ()}
624 625
			};
				
626
			template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit)  XSD.String p_name := c_defaultAccessControlPolicyResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) modifies m_create := {
627
				to_ := p_parentResourceAddress,
628
				requestIdentifier := testcasename() & "-m_createAcp",
629
				resourceType := int1,
630 631
				primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)}
			};
632
        	
633 634 635 636 637 638
			/**
			 * @desc Reception template for CREATE AcpAnnc
			 */
			template RequestPrimitive mw_createAccessControlPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				to_ := p_to,
				from_ := p_from,
639
				resourceType := int10002,
640
				primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnnc(-)}
641 642
			};
        	
643 644 645 646
       	
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
			 */
647
			template (value) RequestPrimitive m_createAcpAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) modifies m_create := {
648
				requestIdentifier := testcasename() & "-m_createAcpAux",
649
				resourceType := int1,
650
				primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}
651
			};
652
        	
653
			/*template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
654
				from_ := PX_SUPER_USER,
655
				requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000),
656
				resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all
657
				primitiveContent := {cSEBase := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}
658 659 660 661 662 663
			};*/
			
			/**
			 * @desc Base CREATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := {
664
				requestIdentifier := testcasename() & "-m_createCSEBase",
665
				resourceType := int5,
666
				primitiveContent := {cSEBase := m_contentCreateCSEBase}
667 668
			};
        	
669 670 671 672
       	
			/**
			 * @desc Base CREATE request primitive for Container resource
			 */
673
			template (value) RequestPrimitive m_createContainerBase modifies m_create := {
674
				requestIdentifier := testcasename() & "-m_createContainer",
675
				resourceType := int3,
676
				primitiveContent := {container := m_contentCreateContainer}
677
			};
678 679 680 681 682 683 684 685 686
			       	
			/**
			 * @desc Base CREATE request primitive for Container resource using Container_update_invalid
			 */
			template (value) RequestPrimitive m_createContainerBaseInvalid modifies m_create := {
				requestIdentifier := testcasename() & "-m_createContainer",
				resourceType := int3,
				primitiveContent := {container_update_invalid := m_contentCreateContainerInvalid}
			};
687
			
688 689 690
			/**
			 * @desc Base CREATE request primitive for remoteCSE resource
			 */
691
			template (value) RequestPrimitive m_createRemoteCSEBase(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) ResourceName p_resourceName :=  c_defaultRemoteCSEResourceName, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE1_ID) modifies m_create := {
692
				requestIdentifier := testcasename() & "-m_createRemoteCSE",
693
				resourceType := int16,
694
				primitiveContent := {remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
695 696
			};
			
697
			/**
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
698 699 700 701 702
			 * @desc Reception template for CREATE RemoteCSE
			 */
			template RequestPrimitive mw_createRemoteCSE(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int16,
				primitiveContent := {remoteCSE := ?}	//{remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
703
			};
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
704
			
705
			/**
706
			 * @desc Base reception template for CREATE RemoteCSE
707 708 709
			 */
			template RequestPrimitive mw_createRemoteCSEBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int16,
710
				primitiveContent := {remoteCSE := mw_contentCreateRemoteCSEBase}
711 712
			};
			
713 714 715 716
			/**
			 * @desc CREATE request primitive for Container resource wiht no resourceName provided
			 */
			template (value) RequestPrimitive m_createContainer_noResourceName modifies m_createContainerBase := {
717
				primitiveContent := {container := m_contentCreateContainer(omit)}
718
			};
719
	
720
			template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultContainerResourceName) modifies m_create := {
721
				to_ := p_parentResourceAddress,
722
				requestIdentifier := testcasename() & "-m_createContainer",
723
				resourceType := int3,
724 725
				primitiveContent := {container := m_contentCreateContainer(p_resourceName)}
			};
726
        	
727 728 729 730 731
			/**
			 * @desc Reception template for CREATE Container
			 */
			template RequestPrimitive mw_createContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int3,
732
				primitiveContent := {container := ?}
733 734
			};  
			
735
			/**
736
			 * @desc Base Reception template for CREATE ContainerAnnc
737
			 */
738
			template RequestPrimitive mw_createContainerAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
739
				resourceType := int10003,
740
				primitiveContent := {containerAnnc := mw_contentCreateContainerAnncBase}
741
			};
742
        	
743 744 745 746
			/**
			 * @desc Base CREATE request primitive for Content Instance resource
			 */
			template (value) RequestPrimitive m_createContentInstanceBase modifies m_create := {
747
				requestIdentifier := testcasename() & "-m_createContentInstance",
748
				resourceType := int4,
749
				primitiveContent := {contentInstance := m_contentCreateContentInstance}
750
			};
751 752 753 754 755
				
			/**
			 * @desc CREATE request primitive for Content Instance resource with no resourceName provided
			 */
			template (value) RequestPrimitive m_createContentInstance_noResourceName modifies m_createContentInstanceBase := {
756
				primitiveContent := {contentInstance := m_contentCreateContentInstance(omit)}
757
			};
758
    		
759 760 761
			template (value) RequestPrimitive m_createContentInstance(XSD.ID p_parentResourceAddress, XSD.String p_primitiveContent) modifies m_create := {
				to_ := p_parentResourceAddress,
				from_ := "admin:admin",
762
				requestIdentifier := testcasename() & "-m_createContentInstance",
763
				resourceType := int4,
764
				primitiveContent := {contentInstance := m_contentCreateContentInstance(-, p_primitiveContent)}
765
			};
766
    		
767 768 769 770 771
			/**
			 * @desc Reception template for CREATE ContentInstanceAnnc
			 */
			template RequestPrimitive mw_createContentInstanceAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10014,
772
				primitiveContent := {contentInstanceAnnc := ?}
773 774
			}; 
		
775 776 777 778 779 780 781 782
			/**
			 * @desc Reception template for CREATE ContentInstance
			 */
			template RequestPrimitive mw_createContentInstance(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int4,
				primitiveContent := {contentInstance := ?}
			}; 
			
783 784 785 786 787
			/**
			 * @desc Base Reception template for CREATE ContentInstanceAnnc
			 */
			template RequestPrimitive mw_createContentInstanceAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10014,
788
				primitiveContent := {contentInstanceAnnc := mw_contentCreateContentInstanceAnncBase}
789
			};  
790 791 792 793 794 795 796 797 798
			
			/**
			 * @desc Base CREATE request primitive for Delivery resource
			 */
			/*template (value) RequestPrimitive m_createDeliveryBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createDelivery" & f_rnd(1, 1000000),
				resourceType := int6,
				primitiveContent := {delivery := m_contentCreateDelivery()}
			};*/
799
        	    		
800 801 802 803
       	
			/**
			 * @desc Base CREATE request primitive for Group resource
			 */
804
			template (value) RequestPrimitive m_createGroupBase modifies m_create := {
805
				requestIdentifier := testcasename() & "-m_createGroup",
806
				resourceType := int9,
807
				primitiveContent := {group_ := m_contentCreateGroup (1, {"NotInitialized"}, omit, omit)}	//TODO: p_resourceId
808
			};
809
        	
810
			template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
811
															in template (value) ListOfURIs p_memberIds := {"NotInitialized"},
812
															in template (omit) AcpType p_accessControlPolicyIds,
813 814 815 816
															in template (omit) MemberType p_memberType := omit,
															in template (omit) ConsistencyStrategy p_consistencyStrategy := omit,
															in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit,
															in template (omit) XSD.String p_name := "MyGroup") modifies m_create := {
817
				requestIdentifier := testcasename() & "-m_createGroup",
818 819 820
				resourceType := int9,
				primitiveContent := {group_ := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIds, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)}	//TODO: p_resourceId
			};
821
        	
822 823 824 825 826
			/**
			 * @desc Reception template for CREATE GroupAnnc
			 */
			template RequestPrimitive mw_createGroupAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10009,
827
				primitiveContent := {groupAnnc := ?}
828
			};  
829 830 831 832 833 834
			
			/**
			 * @desc Base Reception template for CREATE GroupAnnc
			 */
			template RequestPrimitive mw_createGroupAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10009,
835
				primitiveContent := {groupAnnc := mw_contentCreateGroupAnncBase}
836
			};
837
        	
838
			/**
839 840 841
			 * @desc Base CREATE request primitive for MgmtCmd resource
			 */
			template (value) RequestPrimitive m_createMgmtCmdBase modifies m_create := {
842
				requestIdentifier := testcasename() & "-m_createMgmtCmd",
843
				resourceType := int12,
844
				primitiveContent := {mgmtResource := m_contentCreateMgmtCmd (-,-)}
845 846
			};
			
847 848 849 850
			/**
			 * @desc Base CREATE request primitive for MgmtObj resource
			 */
			template (value) RequestPrimitive m_createMgmtObjBase modifies m_create := {
851
				requestIdentifier := testcasename() & "-m_createMgmtObj",
852
				resourceType := int13,
853
				primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-,-)}
854 855 856 857 858 859
			};
        	
			/**
			 * @desc CREATE request primitive for MgmtObj resource
			 */
			template (value) RequestPrimitive m_createMgmtObj modifies m_create := {
860
				requestIdentifier := testcasename() & "-m_createMgmtObj",
861
				resourceType := int13,
862
				primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-, -)}
863 864 865 866 867 868 869
			};
        	
			/**
			 * @desc Reception template for CREATE MgmtObjAnnc
			 */
			template RequestPrimitive mw_createMgmtObjAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10013,
870
				primitiveContent := {announcedMgmtResource := ?}
871 872
			};  
			
873 874 875 876 877
			/**
			 * @desc Base Reception template for CREATE MgmtObjAnnc
			 */
			template RequestPrimitive mw_createMgmtObjAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10013,
878
				primitiveContent := {announcedMgmtResource := mw_contentCreateMgmtObjAnncBase}
879 880
			};  
			
881 882 883 884
			/**
			 * @desc Base CREATE request primitive for Node resource
			 */
			template (value) RequestPrimitive m_createNodeBase modifies m_create := {
885
				requestIdentifier := testcasename() & "-m_createNode",
886
				resourceType := int14,
887
				primitiveContent := {node := m_contentCreateNode(-, -, -) }
888 889 890 891 892 893
			};
        	
			/**
			 * @desc CREATE request primitive for Node resource
			 */
			template (value) RequestPrimitive m_createNode modifies m_create := {
894
				requestIdentifier := testcasename() & "-m_createNode",
895
				resourceType := int14,
896
				primitiveContent := {node := m_contentCreateNode(-,-,-) }
897 898 899 900 901 902 903
			};
        	
			/**
			 * @desc Reception template for CREATE NodeAnnc
			 */
			template RequestPrimitive mw_createNodeAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10014,
904
				primitiveContent := {nodeAnnc := ?}
905
			};  
906 907 908 909
       	
			/**
			 * @desc Base CREATE request primitive for PollingChannel resource
			 */
910
			template (value) RequestPrimitive m_createPollingChannelBase modifies m_create := {
911
				requestIdentifier := testcasename() & "-m_createPollingChannel",
912
				resourceType := int15,
913
				primitiveContent := {pollingChannel := m_contentCreatePollingChannel (-)}
914
			};
915
        	
916
			template (value) RequestPrimitive m_createPollingChannel(XSD.ID p_parentResourceAddress, in template (value)XSD.ID p_originatorId) modifies m_create := {
917 918
				to_ := p_parentResourceAddress,
				from_ := p_originatorId,
919
				requestIdentifier := testcasename() & "-m_createPollingChannel",
920
				resourceType := int15,
921
				primitiveContent := {pollingChannel := m_contentCreatePollingChannel ()}
922
			};
923
        	
924 925 926
			/**
			 * @desc Base CREATE request primitive for Schedule resource
			 */
927
			template (value) RequestPrimitive m_createScheduleBase modifies m_create := {
928
				requestIdentifier := testcasename() & "-m_createSchedule",
929
				resourceType := int18,
930
				primitiveContent := {schedule := m_contentCreateSchedule ({{"0 0 0,1,2 1 1 *"}})}
931
			};
932
        	
933 934
			template (value) RequestPrimitive m_createSchedule(XSD.ID p_parentResourceAddress, in template (omit)  XSD.String p_name, in template (value) ScheduleEntries p_scheduleElement ) modifies m_create := {
				to_ := p_parentResourceAddress,
935
				requestIdentifier := testcasename() & "-m_createSchedule",
936
				resourceType := int18,
937
				primitiveContent := {schedule := m_contentCreateSchedule (p_scheduleElement, p_name)}
938
			};
939
        	
940 941 942 943 944
			/**
			 * @desc Reception template for CREATE ScheduleAnnc
			 */
			template RequestPrimitive mw_createScheduleAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10018,
945
				primitiveContent := {scheduleAnnc := ?}
946
			};  
947 948 949 950 951 952
			
			/**
			 * @desc Base Reception template for CREATE ScheduleAnnc
			 */
			template RequestPrimitive mw_createScheduleAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10018,
953
				primitiveContent := {scheduleAnnc := mw_contentCreateScheduleAnncBase}
954
			};  
955
        	
956
			template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) modifies m_create := {
957
				requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRule",
958
				resourceType := int19,//FIXME Is this the correct value?
959
				primitiveContent := {serviceSubscribedAppRule := m_contentCreateServiceSubscribedAppRule (p_applicableCredIDs, p_allowedAppIDs, p_allowedAEs)}
960
			};
961
        	
962 963 964 965
			/**
			 * @desc Base CREATE request primitive for ServiceSubscribedAppRule Resource
			 */
			template (value) RequestPrimitive m_createServiceSubscribedAppRuleBase modifies m_create := {
966
				requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRuleBase",
967
				resourceType := int19,
968
				primitiveContent := {serviceSubscribedAppRule := m_contentCreateServiceSubscribedAppRuleBase}
969
			};
970 971 972 973
       	
			/**
			 * @desc Base CREATE request primitive for Subscription resource
			 */
974
			template (value) RequestPrimitive m_createSubscriptionBase modifies m_create := {
975
				requestIdentifier := testcasename() & "-m_createSubscription",
976
				resourceType := int23,
977
				primitiveContent := {subscription := m_contentCreateSubscription ({"NotInitialized"})}
978 979
			};
        	
980 981
			template (value) RequestPrimitive m_createSubscription(XSD.ID p_parentResourceAddress, in template (omit)  XSD.String p_name, in template (value) ListOfURIs p_notificationURI := {"NotInitialized"}) modifies m_create := {
				to_ := p_parentResourceAddress,
982
				requestIdentifier := testcasename() & "-m_createSubscription",
983
				resourceType := int23,
984
				primitiveContent := {subscription := m_contentCreateSubscription (p_notificationURI, p_name)}
985
			};
986
			
987 988 989 990 991 992 993 994
        	/**
			 * @desc Reception template for CREATE Subscription
			 */
			template RequestPrimitive mw_createSubscription(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int23,
				primitiveContent := {subscription := ?}
			};
        	
995 996 997 998 999 1000 1001 1002
			template (value) RequestPrimitive m_createSubscriptionAdvanced(	XSD.ID p_parentResourceAddress, 
																		   in template (omit)  XSD.String p_name := omit,
																		   in template (value) ListOfURIs p_notificationURI,
																		   in template (omit) EventNotificationCriteria p_eventNotificationCriteria := omit,
																		   in template (omit) XSD.PositiveInteger p_expirationCounter := omit,
																		   in template (omit) BatchNotify p_batchNotify := omit,
																		   in template (omit) XSD.Boolean p_latestNotify := omit,
																		   in template (omit) XSD.AnyURI p_subscriberURI := omit,
1003
																		   in template (omit) NotificationContentType p_notificationContentType := int1, 
1004
																		   in template (omit) PendingNotification p_pendingNotification) modifies m_createSubscription := {
1005
				primitiveContent := {subscription := m_contentCreateSubscriptionAdvanced (p_notificationURI, p_name, p_eventNotificationCriteria, p_expirationCounter, p_batchNotify, p_latestNotify, p_subscriberURI, p_notificationContentType, p_pendingNotification)}
1006 1007
			};
        	
1008
			/**
1009 1010 1011
			 * @desc Base CREATE request primitive for Location Policy resource
			 */
			template (value) RequestPrimitive m_createLocationPolicyBase modifies m_create := {
1012
				requestIdentifier := testcasename() & "-m_createLocationPolicy",
1013
				resourceType := int10,
1014
				primitiveContent := {locationPolicy := m_contentCreateLocationPolicyBase}
1015 1016
			};
        	
1017
			template (value) RequestPrimitive m_createLocationPolicy(in template (value) LocationSource p_locationSource, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.Duration p_locationUpdatePeriod, in template (omit) NodeID p_locationTargetID, in template (omit) XSD.AnyURI p_locationServerAddress) modifies m_create := {
1018
        		
1019
				requestIdentifier	:= testcasename() & "-m_createLocationPolicy", //the requestIdentifier is supposed to be set similar as "C190XX7T/001"  by prepending the AE-ID-Stem and slash(‘/’) in front of it
1020
				resourceType		:= int10,
1021
				primitiveContent	:= {locationPolicy := m_contentCreateLocationPolicy(p_locationSource, p_accessControlPolicyIds, p_locationUpdatePeriod, p_locationTargetID, p_locationServerAddress) },
1022 1023
				resultContent := int1//default
			};
1024 1025 1026 1027 1028 1029
        	
			/**
			 * @desc Reception template for CREATE LocationPolicyAnnc
			 */
			template RequestPrimitive mw_createLocationPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10010,
1030
				primitiveContent := {locationPolicyAnnc := ?}
1031 1032 1033 1034 1035 1036 1037
			}; 
			
			/**
			 * @desc Base Reception template for CREATE LocationPolicyAnnc
			 */
			template RequestPrimitive mw_createLocationPolicyAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10010,
1038
				primitiveContent := {locationPolicyAnnc := mw_contentCreateLocationPolicyAnncBase}
1039 1040
			}; 
			
1041
			template (value) RequestPrimitive m_createNotification(in template (value) Representation p_resourcePresentation, in template (omit)NotificationEventType p_notifEventType, in template (omit) XSD.AnyURI p_subscriptionReference, in template (omit) XSD.AnyURI p_notifForwardingURI) modifies m_create := {
1042
			  requestIdentifier	:= testcasename() & "-m_createNotification",
1043
			  primitiveContent	:= {notification := m_contentCreateNotification(p_resourcePresentation, p_notifEventType, p_subscriptionReference, p_notifForwardingURI)},
1044
			  resultContent		:= int1 //default
1045
        	  
1046
			};
1047
			
1048 1049 1050 1051
			/**
			 * @desc Base CREATE request primitive for Stats Config resource
			 */
			template (value) RequestPrimitive m_createStatsConfigBase modifies m_create := {
1052
				requestIdentifier := testcasename() & "-m_createStatsConfig",
1053
				resourceType := int22,
1054
				primitiveContent := {statsConfig := m_contentCreateStatsConfigBase}
1055 1056 1057 1058 1059 1060
			};
			
			/**
			 * @desc Base CREATE request primitive for Stats Config resource
			 */
			template (value) RequestPrimitive m_createStatsCollectBase modifies m_create := {
1061
				requestIdentifier := testcasename() & "-m_createStatsCollect",
1062
				resourceType := int21,
1063
				primitiveContent := {statsCollect := m_contentCreateStatCollectBase}
1064 1065 1066 1067 1068 1069
			};
			
			/**
			 * @desc Base CREATE request primitive for M2mServiceSubscriptionProfile resource
			 */
			template (value) RequestPrimitive m_createM2mServiceSubscriptionProfileBase modifies m_create := {
1070
				requestIdentifier := testcasename() & "-m_createM2mServiceSubscriptionProfile",
1071
				resourceType := int11,
1072
				primitiveContent := {m2mServiceSubscriptionProfile := m_contentCreatem2mServiceSubscriptionProfileBase}
1073 1074
			};
			
1075
		}//end group Create
1076
    	
1077
		group Delete {
1078
    	
1079
			template (value) RequestPrimitive m_delete(XSD.ID p_resourceAddress, in XSD.ID p_originator := PX_SUPER_AE_ID) := {
1080 1081
				operation := int4,
				to_ := p_resourceAddress,
1082
				from_ := p_originator,
1083
				requestIdentifier := testcasename() & "-m_delete" & f_rnd(1, 1000000),
1084 1085
				resourceType := omit,
				primitiveContent := omit, 
1086
				role := omit, 
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
1098
				discoveryResultType := omit
1099
			};
1100
			
1101
			template RequestPrimitive mw_delete(template XSD.ID p_resourceAddress := ?, template XSD.ID p_from := *) := {
1102 1103
				operation := int4,
				to_ := p_resourceAddress,
1104
				from_ := p_from,
1105
				requestIdentifier := ?,
1106 1107
				resourceType := omit,
				primitiveContent := omit, 
1108
				role := *, 
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
1120
				discoveryResultType := omit
1121
			};
1122
        	
1123
		}//end group Delete
1124
    	
1125
		group Notify {
1126 1127
			
    		/**
1128 1129
			 * @desc Base NOTIFY request primitive
			 */
1130
			template RequestPrimitive m_notify := {
1131 1132 1133
				operation := int5,
				to_ := "NotInitialized",
				from_ := omit,
1134
				requestIdentifier := testcasename() & "-m_notify" & f_rnd(1, 1000000),
1135 1136
				resourceType := omit,
				primitiveContent := {notification := m_contentCreateNotification_allOmit},
1137
				role := omit,
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
1149
				discoveryResultType := omit
1150 1151 1152 1153 1154
			};
			
			/**
			 * @desc Base NOTIFY Aggregated request primitive
			 */
1155
			template RequestPrimitive m_notifyAggregatedNotification := {
1156 1157 1158
				operation := int5,
				to_ := "NotInitialized",
				from_ := omit,
1159
				requestIdentifier := testcasename() & "-m_notifyAggregatedNotification" & f_rnd(1, 1000000),
1160 1161
				resourceType := omit,
				primitiveContent := {aggregatedNotification := {notification_list := {m_contentCreateNotification_allOmit,m_contentCreateNotification_allOmit}}},
1162
				role := omit,
1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
1174
				discoveryResultType := omit
1175 1176 1177 1178 1179
			};
    		
    		/**
			* @desc Base NOTIFY request primitive
			*/
1180
			template RequestPrimitive mw_notify := {
1181 1182 1183 1184
				operation := int5,
				to_ := ?,
				from_ := *,
				requestIdentifier := ?,
1185
				resourceType := omit,
1186
				primitiveContent := {notification := mw_contentNotificationBase},
1187
				role := *,
1188 1189 1190 1191 1192
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
1193 1194
				resultPersistence := omit,
				resultContent := omit,
1195 1196 1197
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
1198 1199
				filterCriteria := omit,
				discoveryResultType := omit
1200 1201 1202 1203 1204
			};
			
			/**
			 * @desc Base NOTIFY request primitive
			 */
1205 1206
			template RequestPrimitive mw_notifyAggregatedNotification (in template (present) AggregatedNotification p_aggregatedNotification := ?) modifies mw_notify := {
				primitiveContent := { aggregatedNotification := p_aggregatedNotification}
1207 1208 1209 1210 1211 1212
			};
			
			/**
			 * @desc Base NOTIFY request primitive
			 */
			
1213
			template RequestPrimitive mw_notifyNotification(in template (present) Notification p_notification) modifies mw_notify := {
1214
				primitiveContent := {notification := p_notification}
1215 1216 1217 1218 1219
			};
			

			
    		
1220
		}//end of group Notify
1221 1222 1223
	}//end group RequestPrimitives
	
	group ContentCreate {
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239
		
		template PrimitiveContent m_primitiveContentAe(template AE_optional p_ae) := {
			aE := p_ae
		}
		
		template PrimitiveContent m_primitiveContentContainer(template Container_optional p_container) := {
			container := p_container
		}
		
		template PrimitiveContent m_primitiveContentContentInstance(template ContentInstance_optional p_contentInstance) := {
			contentInstance := p_contentInstance
		}
		            
        template PrimitiveContent m_primitiveContentCSEBase(template CSEBase_optional p_cSEBase) := {
	        cSEBase := p_cSEBase
		}
1240
		
1241 1242 1243 1244
		template PrimitiveContent m_primitiveContentRemoteCSE(template RemoteCSE_optional p_remoteCSE) := {
			remoteCSE := p_remoteCSE
		}
		
1245
		 template PrimitiveContent mw_primitiveContent := ?;
1246
		 
1247 1248 1249 1250 1251 1252 1253
		/**
		 * @desc Base primitiveContent for CREATE operation for AEAnnc resource
		 * @param p_labels Labels
		 * @param p_accessControlPolicyIds AcpIDs
		 * @param p_appId App ID
		 * @param p_nodeLink Node link
		 */
1254
		template AEAnnc_optional m_contentCreateAEAnnc (in template (omit)  Labels p_labels, in template (omit) AcpType p_accessControlPolicyIds, XSD.ID p_appId := PX_APP_ID, in template (omit) XSD.AnyURI p_link := omit) := {
1255 1256 1257 1258 1259 1260 1261 1262
			resourceName := omit,//O TODO 
			resourceType := omit,//NP
			resourceID := omit,//NP
			parentID := omit,//NP
			creationTime := omit,//NP
			lastModifiedTime := omit,//NP
			labels := p_labels,//O
			accessControlPolicyIDs := p_accessControlPolicyIds,//O
1263
			expirationTime := "20301231T012345",//O
1264
			link := p_link,//M TODO Put the right value
1265 1266 1267 1268 1269
			appName := omit,//O
			app_ID := p_appId,//M
			aE_ID := omit,//NP
			pointOfAccess := omit, //{"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
			ontologyRef := omit,//O
1270
			nodeLink := omit,//NP
1271 1272 1273 1274
			requestReachability := true,//M
			contentSerialization := omit,//O
			choice := omit//NP
		};	
1275

1276 1277 1278 1279 1280 1281 1282
		/**
		 * @desc Base reception template of primitiveContent for CREATE operation for AEAnnc resource
		 * @param p_labels Labels
		 * @param p_accessControlPolicyIds AcpIDs
		 * @param p_appId App ID
		 * @param p_nodeLink Node link
		 */
1283
		template AEAnnc_optional mw_contentCreateAEAnnc (in template  Labels p_labels := ?, in template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) := {
1284 1285 1286 1287 1288 1289 1290 1291 1292
			resourceName := omit,//NA M
			resourceType := omit,//NA M
			resourceID := omit,//NA M
			parentID := omit,//NA M
			creationTime := omit,//NA M
			lastModifiedTime := omit,//NA M
			labels := p_labels,//MA
			accessControlPolicyIDs := p_accessControlPolicyIds,//MA
			expirationTime := ?,//MA M
1293
			link := p_link,//M
1294 1295 1296 1297 1298 1299 1300 1301 1302
			appName := *,//OA
			app_ID := *,//OA
			aE_ID := *,//OA
			pointOfAccess := *, //OA {"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
			ontologyRef := *,//OA
			nodeLink := *,//OA
			requestReachability := *,//OA
			contentSerialization := *,//OA
			choice := *//NA
1303
		};	
1304
		
1305 1306 1307
		/**
		 * @desc Base primitiveContent for CREATE operation for AE resource
		 * @param p_name Resource name
1308
		 * @param p_accessControlPolicyIds ACP IDs for the AE
1309
		 */
1310
		template (value) AE_optional m_contentCreateAe (in template (omit) AcpType p_accessControlPolicyIds, in template (omit)  XSD.String p_name := c_defaultAeResourceName, in template (omit) XSD.ID p_appId := PX_APP_ID, in template (omit) PoaList p_poaList) := {
1311

1312 1313 1314 1315 1316 1317 1318
			resourceName := p_name,//O
			resourceType := omit,//NP
			resourceID := omit,//NP
			parentID := omit,//NP
			creationTime := omit,//NP
			lastModifiedTime := omit,//NP
			labels := omit,//O
1319
			accessControlPolicyIDs := p_accessControlPolicyIds,//O
1320
			expirationTime := omit,//O
1321 1322 1323
			announceTo := omit,//O
			announcedAttribute := omit,//O
			appName := omit,//O
1324
			app_ID := p_appId,//M
1325 1326 1327