In this scenario the client updates the verbage associated with a link type already registered on the service provider.
This scenario requires that the client has a reference (URI) to the link type definition resource on the service provider. This is obtained by requesting it from the service provider if the link type URI is only known (Example 1). The client will need to get the Link Type Service URI from the discovery documents the URI via the service catalog.
If the client already has the link type resource URI it can perform a GET and then a PUT directly on that resource URI (Example 2).
Example 1. Update Link Type Definition From Link Type URI
The client has a URI reference to an AM link type service ( https://am.acme.com/linktypes/project1
).
1: The client performs a GET on the link type service URI with an application/x-oslc-am-linktype+xml
accept header. If the link type has been registered, then the service provider returns the link type resource, and includes in the headers the ETag, and Location.
Request | GET https://am.acme.com/linktypes/project1?type=http://acme.com/linktypes/implements
Accept: application/x-oslc-am-linktype+xml
|
Response | 200 OK
Location: http://acme.com/linktypes/e3a78263cd917a
ETag: "_3Z3mxMD_Ed6YkqfTZH8hGg"
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<oslc:LinkType rdf:about="http://acme.com/linktypes/implements">
<dc:title>Implements</dc:title>
<dc:description>
The subject resource provides an implementation of the subject resource.
</dc:description>
</oslc:LinkType>
</rdf:RDF>
|
2: The client makes changes to the link type definition and PUTs back the resource to the URI specified in the Location header, and supplying the ETag value in the If-Match header.
Request | PUT http://acme.com/linktypes/e3a78263cd917a
Content-Type: application/x-oslc-am-linktype+xml
If-Match: "_3Z3mxMD_Ed6YkqfTZH8hGg"
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<oslc:LinkType rdf:about="http://acme.com/linktypes/implements">
<dc:title>Implements Interface</dc:title>
<dc:description>
The subject resource provides an implementation of the interface of the subject.
</dc:description>
</oslc:LinkType>
</rdf:RDF>
|
Response | 200 OK
Location: http://acme.com/linktypes/e3a78263cd917a
ETag: "_Txwpsfo1Ed6LKdTEwsKIAw"
|
Example 2. Update Link Type Definition From Link Type Description Resource URI
1: The client performs a GET on the link type description resource URI ( http://acme.com/linktypes/e3a78263cd917a
) with an application/x-oslc-am-linktype+xml
Accept header. The service provider returns the link type description resource, and includes the ETag with the response headers.
Request | GET http://acme.com/linktypes/e3a78263cd917a
Accept: application/x-oslc-am-linktype+xml
|
Response | 200 OK
Location: http://acme.com/linktypes/e3a78263cd917a
ETag: "_3Z3mxMD_Ed6YkqfTZH8hGg"
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<oslc:LinkType rdf:about="http://acme.com/linktypes/implements">
<dc:title>Implements</dc:title>
<dc:description>
The subject resource provides an implementation of the subject resource.
</dc:description>
</oslc:LinkType>
</rdf:RDF>
|
2: The client makes changes to the link type definition and PUTs back the resource to the same resource URI, supplying the ETag value in the If-Match header. If the server permits the update it will respond with a 200 OK, and the respones headers will include the new ETag value for the resource.
Request | PUT http://acme.com/linktypes/e3a78263cd917a
Content-Type: application/x-oslc-am-linktype+xml
If-Match: "_3Z3mxMD_Ed6YkqfTZH8hGg"
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<oslc:LinkType rdf:about="http://acme.com/linktypes/implements">
<dc:title>Implements Interface</dc:title>
<dc:description>
The subject resource provides an implementation of the interface of the subject.
</dc:description>
</oslc:LinkType>
</rdf:RDF>
|
Response | 200 OK
Location: http://acme.com/linktypes/e3a78263cd917a
ETag: "_Txwpsfo1Ed6LKdTEwsKIAw"
|