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

Integration of GMG group pre validation


Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent af4ac316
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Functions.ttcn $
* $Id: OneM2M_Functions.ttcn 175 2016-11-22 12:39:39Z reinaortega $
* $Id: OneM2M_Functions.ttcn 183 2016-11-25 13:31:34Z reinaortega $
* @desc Module containing functions for oneM2M
*
*/
......@@ -712,7 +712,7 @@ module OneM2M_Functions {
*/
function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on CseTester return RequestPrimitive {
var integer p_locresourceIndex := p_parentIndex;
var template ListOfURIs v_notificationURI := {"Not Initialized"};
var template ListOfURIs v_defaultListOfURIs := {"Not Initialized"};
p_request.from_ := f_getOriginator(p_parentIndex);
p_request.to_ := f_getResourceAddress(p_parentIndex);
......@@ -721,7 +721,9 @@ module OneM2M_Functions {
}
if (p_resourceType == int9) {//group
p_request.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(p_parentIndex)};
if(match(valueof(p_request.primitiveContent.any_1[0].Group_optional.memberIDs), v_defaultListOfURIs )){
p_request.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(p_parentIndex)};
}
}
if(p_resourceType == int3){//container
......@@ -741,7 +743,7 @@ module OneM2M_Functions {
}
if (p_resourceType == int23) {//subscription
if(match(valueof(p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI), v_notificationURI )){
if(match(valueof(p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI), v_defaultListOfURIs )){
p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(p_parentIndex)};
}
/*if(PX_FROM_IS_AE_ID) {
......
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
* $Id: OneM2M_Templates.ttcn 175 2016-11-22 12:39:39Z reinaortega $
* $Id: OneM2M_Templates.ttcn 183 2016-11-25 13:31:34Z reinaortega $
* @desc Module containing templates for oneM2M
*
*/
......@@ -473,15 +473,19 @@ module OneM2M_Templates {
}
};
template (value) RequestPrimitive m_createGroup(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name, in template (omit) AcpType p_accessControlPolicyIDs, in template (value) XSD.AnyURI p_memberId ) modifies m_create := {
to_ := p_parentResourceAddress,
from_ := PX_AE_ID_STEM,
requestIdentifier := "m_createGroup" & f_rnd(1, 1000000),
resourceType := int9,
primitiveContent := {
any_1 := {{Group_optional := m_contentCreateGroup (1, {"/" & PX_CSE_NAME & "/" & valueof(p_memberId)}, p_accessControlPolicyIDs)}} //TODO: p_resourceId
}
};
template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
in template (value) ListOfURIs p_memberIds := {"Not Initialized"},
in template (omit) AcpType p_accessControlPolicyIDs,
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 := {
requestIdentifier := "m_createGroup" & f_rnd(1, 1000000),
resourceType := int9,
primitiveContent := {
any_1 := {{Group_optional := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIDs, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)}} //TODO: p_resourceId
}
};
/**
......@@ -820,38 +824,41 @@ module OneM2M_Templates {
}
/**
* @desc Base primitiveContent for CREATE operation for Group resource
* @param p_maxNrOfMembers Max number of members
* @param p_memberIds Member IDs
* @param p_accessControlPolicyIDs ACP IDs for the Group
* @param p_name Resource name
*/
template (value) Group_optional m_contentCreateGroup ( in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
in template (value) ListOfURIs p_memberIds,
in template (omit) AcpType p_accessControlPolicyIDs,
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
announceTo := omit,//O
announcedAttribute := omit,//O
creator := omit,//O
memberType := omit,//O
currentNrOfMembers := omit,//NP
maxNrOfMembers := p_maxNrOfMembers,//M
memberIDs := p_memberIds,//M
membersAccessControlPolicyIDs := omit,//O
memberTypeValidated := omit,//NP
consistencyStrategy := omit,//O
groupName := omit,//O
choice := omit//NP
};
* @desc Base primitiveContent for CREATE operation for Group resource
* @param p_maxNrOfMembers Max number of members
* @param p_memberIds Member IDs
* @param p_accessControlPolicyIDs ACP IDs for the Group
* @param p_name Resource name
*/
template (value) Group_optional m_contentCreateGroup ( in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
in template (value) ListOfURIs p_memberIds,
in template (omit) AcpType p_accessControlPolicyIDs,
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 := 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
announceTo := omit,//O
announcedAttribute := omit,//O
creator := omit,//O
memberType := p_memberType,//O
currentNrOfMembers := omit,//NP
maxNrOfMembers := p_maxNrOfMembers,//M
memberIDs := p_memberIds,//M
membersAccessControlPolicyIDs := p_membersAccessControlPolicyIDs,//O
memberTypeValidated := omit,//NP
consistencyStrategy := p_consistencyStrategy,//O
groupName := omit,//O
choice := omit//NP
};
/**
* @desc Base primitiveContent for CREATE operation for PollingChannel resource
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment