## 3.5 SIF Infrastructure Services

### 3.5.1 environment

The Consumer Environment Service is the gateway to all other services. It scopes the Consumer's possible interactions with the infrastructure and any Provider Services accessible from it. The Environment Service provides the set of (possibly customized) information the Application needs to interoperate successfully.

SIF_Events are not reported for this object.

Figure 3.5.1-1: environment

| Element/@Attribute | Char | Privacy Rating | Description | Type
--- | --- | --- | --- | --- | ---
| environment |  |  | The Consumer Environment Service is the gateway to all other services. It scopes the Consumer's possible interactions with the infrastructure and any Provider Services accessible from it. The Environment Service provides the set of (possibly customized) information the Application needs to interoperate successfully. |
@ | type | O |  |  | environmentTypeType values: DIRECT BROKERED
@ | id | O |  |  | uuidType
| fingerprint | O nillable="false" |  | Unique environment identifier that can be safely shared with others. In order to not compromise security it MUST NOT match the environment's refId, sessionToken, userToken, or applicationKey. | xs:token
| sessionToken | O nillable="false" |  |  | xs:token
| solutionId | O nillable="false" |  | The solution the Application would like to participate in. This is optional only, is advisory, and may be ignored by the Administrator. If processed it may be reflected in the URLs of the infrastructure services which are provided in the consumerEnvironment. | xs:token
| defaultZone | O nillable="false" |  |  | defaultZoneType
| authenticationMethod | O nillable="false" |  | Defines the way in which the applicationKey can be used to enforce security. | xs:token
| instanceId | O nillable="false" |  |  | xs:token
| userToken | O nillable="false" |  |  | xs:string
| consumerName | O nillable="false" |  | A descriptive name for the application that will be readily identifiable to Zone Administrators if it becomes a Registered Consumer | xs:string
| applicationInfo | O nillable="false" |  |  | applicationInfoType
| infrastructureServices | O nillable="false" |  |  | infrastructureServicesType
| provisionedZones | O nillable="false" |  |  | provisionedZonesType

Table 3.5.1-1: environment
JSON
[ { "environment": { "type": "DIRECT", "id": "B5Fd5DfB-ca3b-162a-5657-dDf31E32cE92", "fingerprint": "f5688c40-97d2-11e6-ae22-56b6b6499611", "sessionToken": "a579ff69-0148-1000-007f-14109fdcaf83", "solutionId": "production", "defaultZone": { "id": "District", "description": "The zone for the local school district.", "properties": { "property": [ { "name": "email", "value": "john.smith@district.k12.wa.us" }, { "name": "phone", "value": "(360)555-1234" } ] } }, "authenticationMethod": "SIF_HMACSHA256", "instanceId": "1", "userToken": "MmZkMjVmODItYjAxMC00NTFiLWFjZTEtNmRjNTI4MWYwZjdlOmhpdHNAbnNpcA==", "consumerName": "Example Consumer", "applicationInfo": { "applicationKey": "Example", "supportedInfrastructureVersion": "3.1", "dataModelNamespace": "http://www.sifassociation.org/datamodel/na/3.3", "transport": "REST", "applicationProduct": { "vendorName": "SIF Association", "productName": "Fingertips Classroom App", "productVersion": "1.0.4", "iconURI": "https://www.sifassociation.org/PublishingImages/SIF%20Assoc%20symbol_LARGE.png " } }, "infrastructureServices": { "infrastructureService": [ { "name": "environment", "value": "https://testharness.sifassociation.org/SIFConnector/AdaptorServer/0f 21cf0b-014c-1000-007f-00505686707f/environment/0f21cf0b-014c-1000-007f00505686707f" }, { "name": "requestsConnector", "value": "https://testharness.sifassociation.org/SIFConnector/AdaptorSer ver/0f21cf0b-014c-1000-007f-00505686707f/requests" } ] }, "provisionedZones": { "provisionedZone": [ { "id": "District", "services": { "service": [ { "name": "students", "contextId": "DEFAULT", "type": "OBJECT", "rights": { "right": [ { "type": "QUERY", "value": "APPROVED" } ] } }, { "name": "sections", "contextId": "DEFAULT", "type": "OBJECT", "rights": { "right": [ { "type": "QUERY", "value": "APPROVED" } ] } } ] } } ] } } } ]
XML
<environment type="DIRECT" id="B5Fd5DfB-ca3b-162a-5657-dDf31E32cE92"> <fingerprint>f5688c40-97d2-11e6-ae22-56b6b6499611</fingerprint> <sessionToken>a579ff69-0148-1000-007f-14109fdcaf83</sessionToken> <solutionId>production</solutionId> <defaultZone id="District"> <description>The zone for the local school district.</description> <properties> <property name="email">john.smith@district.k12.wa.us</property> <property name="phone">(360)555-1234</property> </properties> </defaultZone> <authenticationMethod>SIF_HMACSHA256</authenticationMethod> <instanceId>1</instanceId> <userToken>MmZkMjVmODItYjAxMC00NTFiLWFjZTEtNmRjNTI4MWYwZjdlOmhpdHNAbnNpcA==</userToken> <consumerName>Example Consumer</consumerName> <applicationInfo> <applicationKey>Example</applicationKey> <supportedInfrastructureVersion>3.1</supportedInfrastructureVersion> <dataModelNamespace>http://www.sifassociation.org/datamodel/na/3.3</dataModelNamespace> <transport>REST</transport> <applicationProduct> <vendorName>SIF Association</vendorName> <productName>Fingertips Classroom App</productName> <productVersion>1.0.4</productVersion> <iconURI>https://www.sifassociation.org/PublishingImages/SIF%20Assoc%20symbol_LARGE.png </iconURI> </applicationProduct> </applicationInfo> <infrastructureServices> <infrastructureService name="environment">https://testharness.sifassociation.org/SIFConnector/AdaptorServer/0f 21cf0b-014c-1000-007f-00505686707f/environment/0f21cf0b-014c-1000-007f00505686707f</infrastructureService> <infrastructureService name="requestsConnector">https://testharness.sifassociation.org/SIFConnector/AdaptorSer ver/0f21cf0b-014c-1000-007f-00505686707f/requests</infrastructureService> </infrastructureServices> <provisionedZones> <provisionedZone id="District"> <services> <service name="students" contextId="DEFAULT" type="OBJECT"> <rights> <right type="QUERY">APPROVED</right> </rights> </service> <service name="sections" contextId="DEFAULT" type="OBJECT"> <rights> <right type="QUERY">APPROVED</right> </rights> </service> </services> </provisionedZone> </provisionedZones> </environment>
Example 3.5.1-1: environment

### 3.5.2 job

All functional services must use this object design to track state. While Events may be published back to the objects creator, they must not be published to the Consumer when the event was generated based on its request (since results were included in the response). Each functional service should define the expectations of how management of the job is managed for both the Consumer and Provider. For instance, certain optional fields may need to be included in-order-to successfully cause a job to be created.

SIF_Events are reported for this object.

Figure 3.5.2-1: job

| Element/@Attribute | Char | Privacy Rating | Description | Type
--- | --- | --- | --- | --- | ---
| job |  |  | All functional services must use this object design to track state. While Events may be published back to the objects creator, they must not be published to the Consumer when the event was generated based on its request (since results were included in the response). Each functional service should define the expectations of how management of the job is managed for both the Consumer and Provider. For instance, certain optional fields may need to be included in-order-to successfully cause a job to be created. |
@ | id | O |  |  | uuidType
| name | M |  | The name of the job, e.g. "grading" or "sre". | xs:token
| description | O nillable="false" |  | A description of the job, e.g. "Bowers Elementary School Final Marks" | xs:string
| state | O nillable="false" |  | The current enumerable state of the job. | jobStateType values: NOTSTARTED INPROGRESS COMPLETED FAILED
| stateDescription | O nillable="false" |  | A descriptive message elaborating on the current state, e.g. if the current state is "FAILED" the stateDescription may be "Timeout occured". | xs:string
| created | O nillable="false" |  | The datetime this job was created. | xs:dateTime
| lastModified | O nillable="false" |  | The datetime this job was last modified. | xs:dateTime
| timeout | O nillable="false" |  | The ammount of time after creation before this job is automatically deleted. | xs:duration
| phases | O nillable="false" |  | The phases that make up this job. | phaseCollectionType
| initialization | O nillable="false" |  |  | initializationType

Table 3.5.2-1: job
JSON
[ { "job": { "id": "8dc59f05-4ed6-48e1-9985-f0ef27fed09d", "name": "rolloverStudent", "description": "Rollover Student from year X to year Y", "state": "NOTSTARTED", "stateDescription": "Not Started", "created": "2018-09-03T18:06:56.362-07:00", "timeout": "P30D", "phases": { "phase": [ { "name": "oldYearEnrolment", "states": { "state": [ { "type": "NOTSTARTED" } ] }, "required": true, "rights": { "right": [ { "type": "UPDATE", "value": "APPROVED" } ] }, "statesRights": { "right": [ { "type": "QUERY", "value": "APPROVED" }, { "type": "CREATE", "value": "APPROVED" } ] } }, { "name": "newYearEnrolment", "states": { "state": [ { "type": "NOTSTARTED" } ] }, "required": true, "rights": { "right": [ { "type": "CREATE", "value": "APPROVED" } ] }, "statesRights": { "right": [ { "type": "QUERY", "value": "APPROVED" }, { "type": "CREATE", "value": "APPROVED" } ] } } ] } } } ]
XML
<job id="8dc59f05-4ed6-48e1-9985-f0ef27fed09d"> <name>rolloverStudent</name> <description>Rollover Student from year X to year Y</description> <state>NOTSTARTED</state> <stateDescription>Not Started</stateDescription> <created>2018-09-04T09:06:56.362+08:00</created> <timeout>P30D</timeout> <phases> <phase> <name>oldYearEnrolment</name> <states> <state> <type>NOTSTARTED</type> </state> </states> <required>true</required> <rights> <right type="UPDATE">APPROVED</right> </rights> <statesRights> <right type="QUERY">APPROVED</right> <right type="CREATE">APPROVED</right> </statesRights> </phase> <phase> <name>newYearEnrolment</name> <states> <state> <type>NOTSTARTED</type> </state> </states> <required>true</required> <rights> <right type="CREATE">APPROVED</right> </rights> <statesRights> <right type="QUERY">APPROVED</right> <right type="CREATE">APPROVED</right> </statesRights> </phase> </phases> </job>
Example 3.5.2-1: job

### 3.5.3 provisionRequest

If an Environment supports self-provisioning Consumers than either this section must initially contain all the rights the Consumer has to all Services in all Zones, or the provisionRequests Infrastructure Service must be present in the Consumer's Environment to allow additional rights to be obtained.

SIF_Events are not reported for this object.

Figure 3.5.3-1: provisionRequest

| Element/@Attribute | Char | Privacy Rating | Description | Type
--- | --- | --- | --- | --- | ---
| provisionRequest |  |  | If an Environment supports self-provisioning Consumers than either this section must initially contain all the rights the Consumer has to all Services in all Zones, or the provisionRequests Infrastructure Service must be present in the Consumer's Environment to allow additional rights to be obtained. |
@ | id | O | Low |  | uuidType
@ | completionStatus | O |  |  | values: ACCEPTED MIXED REJECTED
| provisionedZones | M |  | A specific Zone defined for this environment. | provisionedZonesType

Table 3.5.3-1: provisionRequest
JSON
[ { "provisionRequest": { "id": "D3E34B39-9D79-4019-8C39-00AA001A1659", "provisionedZones": { "provisionedZone": [ { "id": "SuffolkMiddleSchool", "services": { "service": [ { "type": "OBJECT", "name": "students", "contextId": "DEFAULT", "rights": { "right": [ { "type": "CREATE", "value": "REQUESTED" }, { "type": "UPDATE", "value": "REQUESTED" } ] } } ] } } ] } } } ]
XML
<provisionRequest id="D3E34B39-9D79-4019-8C39-00AA001A1659"> <provisionedZones> <provisionedZone id="SuffolkMiddleSchool"> <services> <service type="OBJECT" name="students" contextId="DEFAULT"> <rights> <right type="CREATE">REQUESTED</right> <right type="UPDATE">REQUESTED</right> </rights> </service> </services> </provisionedZone> </provisionedZones> </provisionRequest>
Example 3.5.3-1: provisionRequest
JSON
[ { "provisionRequest": { "id": "4c7cbebc-71e6-11e9-a923-1681be663d3e", "completionStatus": "MIXED", "provisionedZones": { "provisionedZone": [ { "id": "SuffolkMiddleSchool", "services": { "service": [ { "type": "OBJECT", "name": "students", "contextId": "DEFAULT", "rights": { "right": [ { "type": "CREATE", "value": "REJECTED" }, { "type": "UPDATE", "value": "APPROVED" } ] } } ] } } ] } } } ]
XML
<provisionRequest id="4c7cbebc-71e6-11e9-a923-1681be663d3e" completionStatus="MIXED"> <provisionedZones> <provisionedZone id="SuffolkMiddleSchool"> <services> <service type="OBJECT" name="students" contextId="DEFAULT"> <rights> <right type="CREATE">REJECTED</right> <right type="UPDATE">APPROVED</right> </rights> </service> </services> </provisionedZone> </provisionedZones> </provisionRequest>
Example 3.5.3-2: provisionRequest2

### 3.5.4 queue

The Queues Service supports creation, deletion and querying of Queue (Instance) / Queue Messages Service pairs.

SIF_Events are not reported for this object.

Figure 3.5.4-1: queue

| Element/@Attribute | Char | Privacy Rating | Description | Type
--- | --- | --- | --- | --- | ---
| queue |  |  | The Queues Service supports creation, deletion and querying of Queue (Instance) / Queue Messages Service pairs. |
@ | id | O |  |  | uuidType
| polling | O nillable="false" |  | Determines, when no messages are queued, whether the Consumer will have to periodically reissue Polling Requests at timed intervals or can reissue a Polling Request immediately. | values: IMMEDIATE LONG
| ownerId | C nillable="false" |  | The Environment ID of the owning Consumer for which this Queue is buffering messages. It is not specified at Queue create time, but is returned as part of the response to a query operation, and serves to allow an administrative application to identify which application the Queue instance is assigned to. | uuidType
| name | O nillable="false" |  | A name which the Consumer assigns to the Queue. It is useful for reporting purposes, but is not guaranteed to be unique. | xs:token
| queueUri | O nillable="false" |  | The URI of the Messages Service associated with the Queue instance. This is the endpoint where the 'get next message' requests are issued. | xs:anyURI
| ownerUri | O nillable="false" |  | When present, this contains the URL which the Queue instance will use when it determines the owner needs to be asynchronously alerted that a new message has arrived in the Queue. | xs:anyURI
| idleTimeout | O nillable="false" |  | Is the maximum time in seconds the Messages Service will wait for a message to arrive, before returning an HTTPS Response of 'no message seen' to the Consumer. | xs:unsignedInt
| minWaitTime | C nillable="false" |  | indicates the minimum time in seconds that the Consumer should wait after receiving a 'no message seen' response to a previous query, before posting another. | xs:unsignedInt
| maxConcurrentConnections | O nillable="false" |  | Number of (properly identified) concurrent connections supported by (the consumer, if suggested, and) the queue. | xs:unsignedInt
| created | O nillable="false" |  | Time that Queue Instance was Created | xs:dateTime
| lastAccessed | O nillable="false" |  | Time that Queue Instance was last Accessed and a message was dequeued. | xs:dateTime
| lastModified | O nillable="false" |  | Time that Queue Instance was last Modified by receiving a new incoming message. | xs:dateTime
| messageCount | O nillable="false" |  | The number of messages currently residing in the Queue. | xs:unsignedInt

Table 3.5.4-1: queue
JSON
[ { "queue": { "id": "4c7cc042-71e6-11e9-a923-1681be663d3e", "polling": "IMMEDIATE", "name": "StudentConsumer", "maxConcurrentConnections": 3 } } ]
XML
<queue id="4c7cc042-71e6-11e9-a923-1681be663d3e"> <polling>IMMEDIATE</polling> <name>StudentConsumer</name> <maxConcurrentConnections>3</maxConcurrentConnections> </queue>
Example 3.5.4-1: queue Request
JSON
[ { "queue": { "id": "e23fce44-7871-48eb-8952-e27733f59b30", "polling": "IMMEDIATE", "ownerId": "545c31ac-85c7-4360-bd63-24d425be1532", "name": "StudentConsumer", "queueUri": "http://localhost:9080/SIF3InfraREST/sif3/queues/e23fce44-7871-48eb-8952-e27733f59b30/messages", "idleTimeout": 0, "minWaitTime": 30, "maxConcurrentConnections": 3, "created": "2019-02-06T17:09:04.421-08:00", "lastAccessed": "2019-02-06T17:09:04.424-08:00", "lastModified": "2019-02-06T17:09:04.424-08:00", "messageCount": 0 } } ]
XML
<queue id="e23fce44-7871-48eb-8952-e27733f59b30"> <polling>IMMEDIATE</polling> <ownerId>545c31ac-85c7-4360-bd63-24d425be1532</ownerId> <name>StudentConsumer</name> <queueUri>http://localhost:9080/SIF3InfraREST/sif3/queues/e23fce44-7871-48eb-8952-e27733f59b30/messages</queueUri> <idleTimeout>0</idleTimeout> <minWaitTime>30</minWaitTime> <maxConcurrentConnections>3</maxConcurrentConnections> <created>2019-02-07T09:09:04.421+08:00</created> <lastAccessed>2019-02-07T09:09:04.424+08:00</lastAccessed> <lastModified>2019-02-07T09:09:04.424+08:00</lastModified> <messageCount>0</messageCount> </queue>
Example 3.5.4-2: queue Response

### 3.5.5 state

For states updatable by the Consumer, it creates a new state much like it would a single object. The actual result (state or error) is included in the response. Each functional service should define the expectations for which Adaptor is responsible for updating the phase status. NOTE: The "states" collection represented here is reserved for future capabilities.

SIF_Events are reported for this object.

Figure 3.5.5-1: state

| Element/@Attribute | Char | Privacy Rating | Description | Type
--- | --- | --- | --- | --- | ---
| state |  |  | For states updatable by the Consumer, it creates a new state much like it would a single object. The actual result (state or error) is included in the response. Each functional service should define the expectations for which Adaptor is responsible for updating the phase status. NOTE: The "states" collection represented here is reserved for future capabilities. | Extension of stateCommonType
@ | id | O |  |  | uuidType
| type | M |  | The type of this State object. | phaseStateType values: NOTAPPLICABLE NOTSTARTED PENDING SKIPPED INPROGRESS COMPLETED FAILED
| created | O nillable="false" |  | The datetime this job was created. | xs:dateTime
| lastModified | O nillable="false" |  | The datetime this job was last modified. | xs:dateTime
| description | O nillable="false" |  | A descriptive message ellaborating the condition of this state, e.g. if the state is "FAILED" the stateDescription may be "Timeout occured". | xs:string

Table 3.5.5-1: state
JSON
[ { "state": { "id": "B8A255AD-DE11-4376-BD54-EAA4C8871F59", "type": "COMPLETED", "created": "2022-07-02T13:43:57.236Z", "lastModified": "2022-07-02T13:43:57.236Z", "description": "All assessments have been scored and are finalized." } } ]
XML
<state id="B8A255AD-DE11-4376-BD54-EAA4C8871F59"> <type>COMPLETED</type> <created>2022-07-02T13:43:57.236Z</created> <lastModified>2022-07-02T13:43:57.236Z</lastModified> <description>All assessments have been scored and are finalized.</description> </state>
Example 3.5.5-1: state

### 3.5.6 subscription

A Consumer uses the Subscriptions Infrastructure Service to subscribe to Events published by one or more Service Providers.

SIF_Events are not reported for this object.

Figure 3.5.6-1: subscription

| Element/@Attribute | Char | Privacy Rating | Description | Type
--- | --- | --- | --- | --- | ---
| subscription |  |  | A Consumer uses the Subscriptions Infrastructure Service to subscribe to Events published by one or more Service Providers. |
@ | id | O |  |  | uuidType
| zoneId | M |  |  | xs:token
| contextId | O nillable="false" |  | The unique identity of a context element, which is associated with a Provider of this name and type operating in a Zone with this ID. | xs:token
| serviceType | M |  | The type of the service | serviceTypeType values: UTILITY OBJECT FUNCTIONAL SERVICEPATH XQUERYTEMPLATE SERVICE
| serviceSubType | O |  | The subtype of the Service | serviceSubTypeType values: adminDirective
| messageType | O |  | The type of the message | messageTypeType values: EVENT REQUEST
| serviceName | M |  | The name of the Service. For utilities, this is fixed to one of the defined set of Utility Service Names. For objects and functions, it is defined by the Data Model. | xs:token
| queueId | M |  | Specifies which queues you want data associated with this subscription published to. | xs:token

Table 3.5.6-1: subscription
JSON
[ { "subscription": { "id": "4c7cc1f0-71e6-11e9-a923-1681be663d3e", "zoneId": "auSchoolTestingZone", "contextId": "DEFAULT", "serviceType": "OBJECT", "serviceName": "StudentPersonals", "queueId": "e23fce44-7871-48eb-8952-e27733f59b30" } } ]
XML
<subscription id="4c7cc1f0-71e6-11e9-a923-1681be663d3e"> <zoneId>auSchoolTestingZone</zoneId> <contextId>DEFAULT</contextId> <serviceType>OBJECT</serviceType> <serviceName>StudentPersonals</serviceName> <queueId>e23fce44-7871-48eb-8952-e27733f59b30</queueId> </subscription>
Example 3.5.6-1: subscription Create
JSON
[ { "subscription": { "id": "625124a3-1f8f-4d3a-b014-701404d94c6b", "zoneId": "auSchoolTestingZone", "contextId": "DEFAULT", "serviceType": "OBJECT", "serviceName": "StudentPersonals", "queueId": "e23fce44-7871-48eb-8952-e27733f59b30" } } ]
XML
<subscription id="625124a3-1f8f-4d3a-b014-701404d94c6b"> <zoneId>auSchoolTestingZone</zoneId> <contextId>DEFAULT</contextId> <serviceType>OBJECT</serviceType> <serviceName>StudentPersonals</serviceName> <queueId>e23fce44-7871-48eb-8952-e27733f59b30</queueId> </subscription>
Example 3.5.6-2: subscription Create Response