Neeta Meshram
Neeta Meshram

Reputation: 11

Query regarding update of eventNotificationCriteria of <subscription> resource

If there is an update request on a <subscription> resource to modify some of the conditions (like createdBefore, createdAfter etc.) of the eventNotificationCriteria attribute (enc), then are all the existing conditions of eventNotificationCriteria attribute be replaced or are just the conditions present in the request been modified?

For example

  1. The <subscription> resource is created with enc attribute as follows:

    "enc": {
        "crb": "20191130T142810",
        "cra": "20191129T140000",
        "net": [
            1,
            2,
            3,
            4,
            5
        ]
    }
    
  2. Update the <subscription>'s enc attribute:

    "enc": {
        "ms": "20191129T140000",
        "us": "20191130T142810",
        "net": [
            1,
            2,
            3,
            4,
            5
        ]
    }
    

Possible responses on the UPDATE of the enc in the <subscription> resource:

RESPONSE 1:

"enc": {
    "crb": "20191130T142810",
    "cra": "20191129T140000",
    "ms": "20191129T140000",
    "us": "20191130T142810"
    "net": [
        1,
        2,
        3,
        4,
        5
    ]
}

RESPONSE 2:

"enc": {
    "ms": "20191129T140000",
    "us": "20191130T142810",
    "net": [
        1,
        2,
        3,
        4,
        5
    ]
}

Which is correct, RESPONSE 1 or RESPONSE 2?

Upvotes: 1

Views: 56

Answers (1)

Andreas Kraft
Andreas Kraft

Reputation: 3843

TL;DR
Applying the specifications mentioned below to your example, Response 2 would be correct. The update to the eventNotificationCriteria attribute of the <subscription> resource would replace the existing value with the updated value.

TS;WM
Sometimes, it is not easy to determine what happens during an update. If not stated otherwise the general procedure specified in TS-0001 - Functional Architecture, secion 8.1.2: Request applies:

Update (U): the content of an existing To addressable resource is replaced with the new content as in Content parameter. If some attributes in the Content parameter do not exist at the target resource, such attributes are created with the assigned values. If some attributes in the Content parameter are set to NULL, such attributes are deleted from the addressed resource.

And for operation dependent Parameters:

Update (U): Content is the content to be replaced in an existing resource. For attributes to be updated at the resource, Content includes the names of such attributes with their new values. For attributes to be created at the resource, Content includes names of such attributes with their associated values. For attributes to be deleted at the resource, Content includes the names of such attributes with their value set to NULL.

But, you should always also have a look at TS-0004 - Service Layer Core Protocol. For example, in section 7.4.8.2: <subscription> resource specific and very detailed procedures for CRUD operations you will find the specifics for CRUD operations on <subscription> resources.

Update

I think some further discussion is warranted to highlight that the reason #1 is not correct is because enc is a complex attribute. Since all of those values are part of a single attribute, the mentioned rule applies. If a similar update operation is performed, with simple attributes, then a "merge" of the attributes is correct, similar to response #1.

Upvotes: 1

Related Questions