Commit 382fa8ba authored by Naum Spaseski's avatar Naum Spaseski
Browse files

Added serviceSubscribeAppRule type and template and added mcc port to config function

parent f68c216d
......@@ -33,6 +33,7 @@ module OneM2M_Functions {
// Map
map(self:mcaPort, system:mcaPort);
map(self:mccPort, system:mccPort);
map(self:acPort, system:acPort);
activate(a_default());
......@@ -113,13 +114,13 @@ module OneM2M_Functions {
var M2MResponsePrimitive v_response;
var integer v_cseBaseAuxIndex := -1;
var integer v_acpAuxIndex := -1;
var ServiceSubscribedAppRule v_serviceSubscribedAppRule;
var ServiceSubscribedAppRule_optional v_serviceSubscribedAppRule;
v_serviceSubscribedAppRule.applicableCredIDs := {"None"};
v_serviceSubscribedAppRule.allowedApp_IDs := {PX_APP_ID};
v_serviceSubscribedAppRule.allowedAEs := valueof(p_allowedAEs);
mcaPort.send(m_request(m_createCSEBase(v_serviceSubscribedAppRule)));
mcaPort.send(m_request(m_createServiceSubscribedAppRule(v_serviceSubscribedAppRule)));
tc_ac.start;
alt {
......@@ -197,7 +198,8 @@ module OneM2M_Functions {
function f_postamble_default() runs on M2M {
unmap(self:mcaPort, system:mcaPort);
unmap(self:mcaPort, system:mcaPort);
unmap(self:mccPort, system:mccPort);
unmap(self:acPort, system:acPort);
//stop;
}
......
......@@ -785,6 +785,32 @@ module OneM2M_Templates {
discoveryResultType := omit
};
//Added by @Naum
template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ServiceSubscribedAppRule_optional p_serviceSubscribedAppRule) := {
operation := int1,
to_ := "NotInitialized",
from_ := PX_AE_ID_STEM,
requestIdentifier := "m_createCSE" & f_rnd(1, 1000000),
resourceType := int1,
primitiveContent := {
any_1 := {{ServiceSubscribedAppRule_optional := m_contentCreateServiceSubscribedAppRule (p_serviceSubscribedAppRule)}}
},
role := 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
};
template (value) RequestPrimitive m_createSubscriptionBase := {
operation := int1,
......@@ -1044,6 +1070,22 @@ module OneM2M_Templates {
scheduleElement := p_scheduleElement,//M
choice := omit//NP
};
template (value) ServiceSubscribedAppRule_optional m_contentCreateServiceSubscribedAppRule (in template (value) ServiceSubscribedAppRule_optional serviceSubscribedAppRule := omit) := {
resourceName := omit,
resourceType := omit,
resourceID := omit,
parentID := omit,
creationTime := omit,
lastModifiedTime := omit,
labels := omit,
accessControlPolicyIDs := omit,
expirationTime := omit,
applicableCredIDs := serviceSubscribedAppRule.applicableCredIDs,
allowedApp_IDs := serviceSubscribedAppRule.allowedApp_IDs,
allowedAEs := serviceSubscribedAppRule.allowedAEs,
choice := omit
}
template (value) Subscription_optional m_contentCreateSubscription (in template (value) ListOfURIs p_notificationURI) := {
resourceName := c_defaultResourceName,//O
......
......@@ -4350,6 +4350,38 @@ group optionalResourceTypes {
variant (choice.choice_list[-]) "untagged";
};
//Added by @Naum
type record ServiceSubscribedAppRule_optional
{
XSD.NCName 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,
ListOfM2MID applicableCredIDs optional,
ListOfM2MID allowedApp_IDs optional,
ListOfM2MID allowedAEs 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 (allowedApp_IDs) "name as 'allowedApp-IDs'";
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 Subscription_optional
{
XSD.NCName resourceName optional,
......
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