Commit 5166a31a authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Preparation of announcement handling (types, templates, etc..) (NOT FINALIZED)


Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent 4aab2e6e
This diff is collapsed.
......@@ -7,7 +7,7 @@
*
* @author oneM2M
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
* $Id: OneM2M_Templates.ttcn 234 2017-03-20 16:37:29Z reinaortega $
* $Id: OneM2M_Templates.ttcn 238 2017-03-23 17:39:11Z reinaortega $
* @desc Module containing templates for oneM2M
*
*/
......@@ -367,7 +367,7 @@ module OneM2M_Templates {
*/
template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
operation := int1,
to_ := ?,
to_ := p_to,
from_ := p_from,
requestIdentifier := ?,
resourceType := ?,
......@@ -395,66 +395,31 @@ module OneM2M_Templates {
/**
* @desc Base CREATE request primitive for AE resource (AUX)
* @desc Base CREATE request primitive for AEAnnc resource
* @param p_accessControlPolicyIds
* @param p_to
* @param p_from
* @param p_appId
* @param p_stemId
*/
template RequestPrimitive m_createAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_to := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_stemId := "") := {
operation := int1,
template (value) RequestPrimitive m_createAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_to := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_stemId := "") modifies m_create:= {
to_ := p_to,
from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
requestIdentifier := testcasename() & "-m_createAEAnnc" & f_rnd(1, 1000000),
resourceType := int10002,
primitiveContent := {
any_1 := {{AEAnnc_optional := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, valueof(p_to) & "/" & p_stemId)}}
},
roleIDs := omit,
originatingTimestamp := omit,
requestExpirationTimestamp := omit,
resultExpirationTimestamp := omit,
operationExecutionTime := omit,
responseType := omit,
resultPersistence := omit,
resultContent := omit,
eventCategory := omit,
deliveryAggregation := omit,
groupRequestIdentifier := omit,
filterCriteria := omit,
discoveryResultType := omit,
tokens := omit,
tokenIDs := omit,
localTokenIDs := omit,
tokenRequestIndicator := omit
}
};
/**
* @desc Base CREATE request primitive for AE resource (AUX)
* @desc Reception template for CREATE AEAnnc
*/
//Added by @Naum
template RequestPrimitive mw_createAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_to := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_stemId := "") := {
operation := int1,
to_ := p_to,
from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
requestIdentifier := ?,
template RequestPrimitive mw_createAEAnnc(template (omit) XSD.ID p_from := omit, template (omit) XSD.ID p_to := omit, template (omit) AcpType p_accessControlPolicyIds := omit) modifies mw_create := {
resourceType := int10002,
primitiveContent := {
any_1 := {{AEAnnc_optional := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, valueof(p_to) & "/" & p_stemId)}}
},
roleIDs := *,
originatingTimestamp := *,
requestExpirationTimestamp := *,
resultExpirationTimestamp := *,
operationExecutionTime := *,
responseType := *,
resultPersistence := *,
resultContent := *,
eventCategory := *,
deliveryAggregation := *,
groupRequestIdentifier := *,
filterCriteria := *,
discoveryResultType := *,
tokens := *,
tokenIDs := *,
localTokenIDs := *,
tokenRequestIndicator := *
any_1 := {{AEAnnc_optional := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}}
}
};
//Added by @Naum
......@@ -507,6 +472,18 @@ module OneM2M_Templates {
}
};
/**
* @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,
resourceType := int10002,
primitiveContent := {
any_1 := {{AccessControlPolicyAnnc_optional := mw_contentCreateAcpAnnc(-)}}
}
};
/**
* @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
......@@ -563,6 +540,16 @@ module OneM2M_Templates {
}
};
/**
* @desc Reception template for CREATE ContainerAnnc
*/
template RequestPrimitive mw_createContainerAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
resourceType := int10003,
primitiveContent := {
any_1 := {{ContainerAnnc_optional := ?}}
}
};
/**
* @desc Reception template for CREATE FlexContainer
*/
......@@ -605,6 +592,16 @@ module OneM2M_Templates {
}
};
/**
* @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,
primitiveContent := {
any_1 := {{ContentInstanceAnnc_optional := ?}}
}
};
/**
* @desc Base CREATE request primitive for Group resource
......@@ -631,6 +628,79 @@ module OneM2M_Templates {
}
};
/**
* @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,
primitiveContent := {
any_1 := {{GroupAnnc_optional := ?}}
}
};
/**
* @desc Base CREATE request primitive for MgmtObj resource
*/
template (value) RequestPrimitive m_createMgmtObjBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createMgmtObj" & f_rnd(1, 1000000),
resourceType := int13,
primitiveContent := {
any_1 := {{MgmtObj_optional := m_contentCreateMgmtObj (-,-)}}
}
};
/**
* @desc CREATE request primitive for MgmtObj resource
*/
template (value) RequestPrimitive m_createMgmtObj modifies m_create := {
requestIdentifier := testcasename() & "-m_createMgmtObj" & f_rnd(1, 1000000),
resourceType := int13,
primitiveContent := {
any_1 := {{MgmtObj_optional := m_contentCreateMgmtObj (-, -)}}
}
};
/**
* @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,
primitiveContent := {
any_1 := {{MgmtObjAnnc_optional := ?}}
}
};
/**
* @desc Base CREATE request primitive for Node resource
*/
template (value) RequestPrimitive m_createNodeBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createNode" & f_rnd(1, 1000000),
resourceType := int14,
primitiveContent := {
any_1 := {{Node_optional := m_contentCreateNode(-, -, -) }}
}
};
/**
* @desc CREATE request primitive for Node resource
*/
template (value) RequestPrimitive m_createNode modifies m_create := {
requestIdentifier := testcasename() & "-m_createNode" & f_rnd(1, 1000000),
resourceType := int14,
primitiveContent := {
any_1 := {{Node_optional := m_contentCreateNode(-,-,-) }}
}
};
/**
* @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,
primitiveContent := {
any_1 := {{NodeAnnc_optional := ?}}
}
};
/**
* @desc Base CREATE request primitive for PollingChannel resource
......@@ -674,6 +744,16 @@ module OneM2M_Templates {
}
};
/**
* @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,
primitiveContent := {
any_1 := {{ScheduleAnnc_optional := ?}}
}
};
//Added by @Naum
template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) modifies m_create := {
from_ := PX_AE_ID_STEM,
......@@ -730,6 +810,16 @@ module OneM2M_Templates {
},
resultContent := int1//default
};
/**
* @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,
primitiveContent := {
any_1 := {{LocationPolicyAnnc_optional := ?}}
}
};
//@Martin
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 := {
requestIdentifier := testcasename() & "-m_createNotification" & f_rnd(1, 1000000),
......@@ -887,7 +977,13 @@ module OneM2M_Templates {
}//end group RequestPrimitives
group ContentCreate {
/**
* @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
*/
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_nodeLink := omit) := {
resourceName := omit,//O TODO
resourceType := omit,//NP
......@@ -912,28 +1008,35 @@ module OneM2M_Templates {
choice := omit//NP
};
template AEAnnc_optional mw_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_nodeLink := omit) := {
resourceName := *,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := p_labels,//O
accessControlPolicyIDs := p_accessControlPolicyIds,//O
expirationTime := *,//O
dynamicAuthorizationConsultationIDs := omit, //TODO Check whether it is optional or mandatory for create operation
link := *,//O
appName := *,//O
app_ID := p_appId,//M
aE_ID := omit,//NP
pointOfAccess := *, //{"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
ontologyRef := *,//O
nodeLink := p_nodeLink,//NP
requestReachability := ?,//M
contentSerialization := *,//O
e2eSecInfo := omit, //O TODO Check whether it is optional or mandatory for create operation
choice := omit//NP
/**
* @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
*/
template AEAnnc_optional mw_contentCreateAEAnnc (in template Labels p_labels := ?, in template AcpType p_accessControlPolicyIds := ?) := {
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
dynamicAuthorizationConsultationIDs := omit, //OA
link := ?,//M
appName := omit,//OA
app_ID := omit,//OA
aE_ID := omit,//OA
pointOfAccess := omit, //OA {"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
ontologyRef := omit,//OA
nodeLink := omit,//OA
requestReachability := omit,//OA
contentSerialization := omit,//OA
e2eSecInfo := ?, //MA
choice := omit//NA
};
/**
......@@ -993,6 +1096,25 @@ module OneM2M_Templates {
choice := omit //NP
};
/**
* @desc Base reception template of primitiveContent for CREATE operation for AccessControlPolicyAnnc resource
* @param p_labels Labels
*/
template AccessControlPolicyAnnc_optional mw_contentCreateAcpAnnc (in template (omit) Labels p_labels := omit) := {
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
expirationTime := ?,//MA M
link := ?,//M
privileges := *,//MA
selfPrivileges := *,//MA
choice := omit//NA
};
template (value) AccessControlRule m_createAcr (in template (value) ListOfURIs p_acor, in template (value) AccessControlOperations p_allowedOperations) := {
accessControlOriginators := p_acor,//{"*"},//{PX_AE_ID_STEM}, //{"admin:admin"},
accessControlOperations := p_allowedOperations,
......@@ -1060,7 +1182,57 @@ module OneM2M_Templates {
consistencyStrategy := p_consistencyStrategy,//O
groupName := omit,//O
choice := omit//NP
};
};
/**
* @desc Base primitiveContent for CREATE operation for MgmtObj resource
* @param p_name Resource name
* @param p_accessControlPolicyIds ACP IDs for the AE
*/
template (value) MgmtObj_optional m_contentCreateMgmtObj (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultResourceName) := {
resourceName := p_name,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O
accessControlPolicyIDs := p_accessControlPolicyIds,//O
expirationTime := omit,//O
dynamicAuthorizationConsultationIDs := omit, //O
announceTo := omit,//O
announcedAttribute := omit,//O
mgmtDefinition := omit,//O
objectIDs := omit,//O
objectPaths := omit,//O
description := omit//O
};
/**
* @desc Base primitiveContent for CREATE operation for Node resource
* @param p_name Resource name
* @param p_accessControlPolicyIds ACP IDs for the AE
*/
template (value) Node_optional m_contentCreateNode (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultResourceName, in template (omit) XSD.ID p_nodeId := "NodeID") := {//TODO Create PX for NodeID
resourceName := p_name,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O
accessControlPolicyIDs := p_accessControlPolicyIds,//O
expirationTime := omit,//O
dynamicAuthorizationConsultationIDs := omit, //O
announceTo := omit,//O
announcedAttribute := omit,//O
nodeID := p_nodeId,//M
hostedCSELink := omit,//O
choice := omit//O
};
/**
* @desc Base primitiveContent for CREATE operation for PollingChannel resource
......
......@@ -7,7 +7,7 @@
*
* @author oneM2M
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Types.ttcn $
* $Id: OneM2M_Types.ttcn 234 2017-03-20 16:37:29Z reinaortega $
* $Id: OneM2M_Types.ttcn 238 2017-03-23 17:39:11Z reinaortega $
* @desc OneM2M data types module
*
*/
......@@ -41,6 +41,9 @@ import from XSD all;
charstring serialization optional,
AttributeAux_list forcedFields optional
}
with {
encode ""
}
/**
* @desc Type for the oneM2M primitives exchange
......@@ -52,6 +55,9 @@ import from XSD all;
ResponsePrimitive responsePrimitive
} primitive
}
with {
encode ""
}
type record AcRequestPrimitive {
charstring event,
......@@ -6671,6 +6677,37 @@ group OptionalResourceTypes {
variant (choice.subscription_list) "untagged";
variant (choice.subscription_list[-]) "name as 'subscription'";
};
type record AccessControlPolicyAnnc_optional
{
ResourceName resourceName optional,
ResourceType resourceType optional,
XSD.ID resourceID optional,
NhURI parentID optional,
Timestamp creationTime optional,
Timestamp lastModifiedTime optional,
Labels labels optional,
Timestamp expirationTime optional,
XSD.AnyURI link optional,
SetOfAcrs privileges optional,
SetOfAcrs selfPrivileges optional,
union {
record length(1 .. infinity) of ChildResourceRef childResource_list,
record length(1 .. infinity) of Subscription subscription_list
} choice optional
}
with {
variant "name as uncapitalized";
variant "element";
variant (resourceName) "attribute";
variant (choice) "untagged";
variant (choice.childResource_list) "untagged";
variant (choice.childResource_list[-]) "name as 'childResource'";
variant (choice.subscription_list) "untagged";
variant (choice.subscription_list[-]) "name as 'subscription'";
};
type record ContentInstance_optional
{
......@@ -6750,6 +6787,57 @@ group OptionalResourceTypes {
variant (choice.choice_list[-]) "untagged";
};
type record ContainerAnnc_optional
{
ResourceName resourceName optional,
ResourceType resourceType optional,
XSD.ID resourceID optional,
NhURI parentID optional,
Timestamp creationTime optional,
Timestamp lastModifiedTime optional,
Labels labels optional,
AcpType accessControlPolicyIDs optional,
Timestamp expirationTime optional,
XSD.AnyURI link optional,
ListOfURIs dynamicAuthorizationConsultationIDs optional,
XSD.NonNegativeInteger stateTag optional,
XSD.NonNegativeInteger maxNrOfInstances optional,
XSD.NonNegativeInteger maxByteSize optional,
XSD.NonNegativeInteger maxInstanceAge optional,
XSD.NonNegativeInteger currentNrOfInstances optional,
XSD.NonNegativeInteger currentByteSize optional,
XSD.AnyURI locationID optional,
XSD.AnyURI ontologyRef optional,
XSD.Boolean disableRetrieval optional,
union {
record length(1 .. infinity) of ChildResourceRef childResource_list,
record length(1 .. infinity) of union {
ContentInstance contentInstance,
ContentInstanceAnnc contentInstanceAnnc,
Container container,
ContainerAnnc containerAnnc,
Subscription subscription,
SemanticDescriptor semanticDescriptor,
SemanticDescriptorAnnc semanticDescriptorAnnc,
Sg_flexContainerResource_group sg_flexContainerResource,
Sg_announcedFlexContainerResource_group sg_announcedFlexContainerResource
} choice_list
} choice optional
}
with {
variant "name as uncapitalized";
variant "element";
variant (resourceName) "attribute";
//variant (disableRetrieval) "text 'true' as '1'";
//variant (disableRetrieval) "text 'false' as '0'";
variant (choice) "untagged";
variant (choice.childResource_list) "untagged";
variant (choice.childResource_list[-]) "name as 'childResource'";
variant (choice.choice_list) "untagged";
variant (choice.choice_list[-]) "untagged";
};
type record FlexContainer_optional
{
ResourceName resourceName optional,
......@@ -6772,7 +6860,40 @@ group OptionalResourceTypes {
with {
variant "name as uncapitalized";
variant (resourceName) "attribute";
};
};
type record ContentInstanceAnnc_optional
{
ResourceName resourceName optional,
ResourceType resourceType optional,
XSD.ID resourceID optional,
NhURI parentID optional,
Timestamp creationTime optional,
Timestamp lastModifiedTime optional,
Labels labels optional,
Timestamp expirationTime optional,
XSD.AnyURI link optional,
XSD.NonNegativeInteger stateTag optional,
ContentInfo contentInfo optional,
XSD.NonNegativeInteger contentSize optional,
XSD.AnyURI ontologyRef optional,
XSD.AnyType content optional,
union {
record length(1 .. infinity) of ChildResourceRef childResource_list,
record length(1 .. infinity) of SemanticDescriptor semanticDescriptor_list
} choice optional
}
with {
variant "name as uncapitalized";
variant "element";
variant (resourceName) "attribute";
variant (choice) "untagged";
variant (choice.childResource_list) "untagged";
variant (choice.childResource_list[-]) "name as 'childResource'";
variant (choice.semanticDescriptor_list) "untagged";
variant (choice.semanticDescriptor_list[-]) "name as 'semanticDescriptor'";
};
//added by @Naum
type record CSEBase_optional
......@@ -6879,6 +7000,178 @@ group OptionalResourceTypes {
variant (choice.choice_list[-].semanticDescriptor) "name as 'semanticDescriptor'";
};
type record LocationPolicyAnnc_optional
{
ResourceName resourceName optional,
ResourceType resourceType optional,
XSD.ID resourceID optional,
NhURI parentID optional,
Timestamp creationTime optional,
Timestamp lastModifiedTime optional,
Labels labels optional,
AcpType accessControlPolicyIDs optional,
Timestamp expirationTime optional,
XSD.AnyURI link optional,
ListOfURIs dynamicAuthorizationConsultationIDs optional,
LocationSource locationSource optional,
ListOfDuration locationUpdatePeriod optional,
NodeID locationTargetID optional,
XSD.AnyURI locationServer optional,
XSD.AnyURI locationContainerID optional,
XSD.String locationContainerName optional,
XSD.String locationStatus optional
}
with {
variant "name as uncapitalized";
variant "element";
variant (resourceName) "attribute";
};
type record MgmtObj_optional //MgmtResource