skip navigation
URC Consortium Logo

You are here: MyURC.org > TR > uch1.0-20091103 > Draft

Universal Control Hub 1.0 (DRAFT)

Draft Technical Report 2009-11-03

This version: http://myurc.org/TR/uch1.0-20091103/
Latest version: http://myurc.org/TR/uch1.0/
Previous draft version: http://myurc.org/TR/uch1.0-20090701/ (changes marked)
Latest approved version: (none)
Editor: Gottfried Zimmermann

Copyright 2008-2009, Universal Remote Console Consortium (URCC)

Abstract

This URCC Technical Report specifies the "Universal Control Hub" (short UCH) architecture. This approach is a profiling of the Universal Remote Console (URC) technology (as specified by ISO/IEC 24752) in the context of a Remote User Interface scenario (as specified by CEA-2014-A).

The UCH allows the application of the URC technology in an environment with non-URC compliant controllers and non-URC compliant targets. In this approach, the URC technology is implemented "in a box", with the Universal Control Hub acting as gateway between various controllers and various targets.

This document is intended to provide a specification for the development of Universal Control Hubs. It supersedes earlier attempts of describing the UCH approach, for example those posted on the MyURC website [UCH 2005][UCH 2006].

The reader of this document will benefit greatly if already familiar with the URC standards (ISO/IEC 24752, parts 1, 2, 4, and 5).

Status of this Document

This is a public Draft Technical Report, developed by the editor, hereby made available for review by URCC members and the public.

Comments on this document should be sent to the editor.

Publication as a Draft Technical Report does not imply endorsement by the URCC membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Change Log [to be removed before final release]

NOTE: The change log is in reverse chronological order.

2009-11-03 Gottfried Zimmermann:

2009-07-01 Gottfried Zimmermann:

2009-04-30 Gottfried Zimmermann:

2008-11-24 Gottfried Zimmermann:

2008-08-14 Gottfried Zimmermann:

Open Issues [to be removed before final release]

  1. addCompatibleUI: Maybe we should allow the use of arbitrary applicationIds if a UI does not exactly match to one target?
  2. Should we define error codes/messages for rejected open session requests?
  3. Should there be a separate method when a dynamic resource changes, without changing the value of the corresponding socket element?
  4. How can TAs deliver dynamic resources for values of external types? Would be useful for "friendly names" of networked devices being delivered as dynamic labels in play-1.uis and play-2.uis.
  5. Allow to specify a resDefaultProps map for resource preferences? Could be an additional argument to getResources().
  6. Make targetDescription and targetDescriptionUri a mandatory property of targetProps, and remove getTargetDescription() and getTargetDescriptionUri()?
  7. Should we care about <fork> and <lifetime> in a UIList? How would this affect addCompatibleUI()?
  8. The content of <protocolInfo> should just be a block of data, no subelements
  9. How can the UCH serve non-HTTP URIs through controllerRequest() and targetRequest()?
  10. Should the UCH take care of collecting updates if the UIPM wishes to poll for updates instead of receiving events? This would require an API change for UIPMs.
  11. Should we also allow for dynamic resources for socket-external type definitions?
  12. How to deal with descriptors when using the getResources() method?
  13. Should getValues() include parameters 'depth' and 'includeSets' (see URC-HTTP spec, open issues)?
  14. Duplicate properties in resProps for getResources() are interpreted as ANDed values. Should we also allow for alternative values in a query?
  15. What <uiID> should be used for control applications that control a subset of available targets?
  16. Should we retrieve resources from a resource server via a username and password as set in a user profile?
  17. Do we need more security for the functions on URI servicing? For example, could a malicious UIPM stop another UIPM's service URIs?
  18. Do we need the "update user context" command?

Table of Contents


1. Scope

This Technical Report specifies the "Universal Control Hub" (short UCH). It is a profiling of the Universal Remote Console framework, as specified in ISO/IEC 24752.

In this profile, a gateway ("control hub") is used as a middle layer between a controller and a target device or service. The gateway translates between any controller and any target; neither the controller nor the target needs to be URC compatible.

2. Conformance

A Universal Control Hub (UCH) is conforming to this standard if it provides:

A User Interface Protocol Module (UIPM) is conforming to this standard if it provides:

A Target Discovery Module (TDM) is conforming to this standard if it provides:

A Target Adapter (TA) is conforming to this standard if it provides:

NOTE: Conformance to this standard does not imply conformance to any part of ISO/IEC 24752.

3. Conventions in this Document

In this document the words SHALL, SHOULD and MAY have meanings as defined in [RFC 2119].

4. Runtime Model for UIPMs, TDMs and TAs

4.1. Overview

Components of the Universal Control Hub

Figure 1: Components of the UCH and how they communicate with each other (description of figure). Note that Controller, UIPM, TDM, TA and Target may occur multiple times. For simplicity, only one instance is shown in the figure.

The UCH is a middleware between controllers and targets. It consists of the following components, some of which may be loaded dynamically at runtime:

4.2. Considerations on API Design

Basically there are two ways to design the APIs for the UCH: object-oriented or function-oriented.

4.2.1. Object-Oriented Design

In the object-oriented approach, data and behavior is encapsulated as "objects". Functions are understood as "methods" pertaining to objects such as targets, sessions, and socket elements.

Regarding the UCH design, this approach has the following benefits:

4.2.2. Function-Oriented Design

In the function-oriented approach, data is passed as parameters of functions, preferably as primitive data types such as strings and numbers.

Regarding the UCH design, this approach has the following benefits:

4.2.3. Approach: Facade

The approach taken by this specification is aligned with the function-oriented design approach. It allows for using the object-oriented approach inside the UCH or its loadable modules, but uses a faade approach for communication between the standardized components of a UCH.

For example, a Target Adapter could maintain a session object internally, but exposes it to the UCH by a session identifier. A similar approach is taken for targets which are represented to User Interface Protocol Modules (UIPMs) by target identifiers.

4.3. Modules Loaded at Runtime

The UCH provides the runtime environment for User Interface Protocol Modules (UIPMs), Target Discovery Modules (TDMs) and Target Adapters (TAs).

A UIPM and TA shall be available as separate code files, and in a form that allows the UCH to dynamically load and install its code.

A TDM may be integrated into the UCH, or may be available as a separate file and in a form that allows the UCH to dynamically load and install its code.

EXAMPLE A DLL ("dynamic link library") file on Windows, or an SO ("shared object") file on a Unix platform.

This specification does not define whether UIPMs, TDMs and TAs run as separate processes or threads, or whether their memory space is separated. This is implementation-specific.

4.4. Optional Functions

Some functions are specified as optional, i.e. the module may or may not implement it. However, the module shall implement a stub of the function in any case, and shall throw a NotImplementedException if it doesn't support the optional function.

NOTE: A stub implementation is needed because some programming languages require strong typing, and would not allow for a class to be cast to an interface that its set of functions doesn't match for.

4.5. Concurrency

The functions specified in section Interaction Between UIPM and UCH, section Interaction Between Target Discovery Module (TDM) and UCH, and section Interaction Between Target Adapter and UCH shall be executed

4.6. Property Map

Targets and resources (in the following just called "object"), including loadable modules (UIPMs, TDMs and TAs) shall be described through metadata. The UCH may retrieve such metadata from a resource server, or from local configuration data, or from somewhere else.

At runtime, the UCH shall represent an object's metadata as a property map. A property map is a set of key-value pairs, both of type string.

Unless otherwise noted, duplicate properties are allowed if their values differ. In general, multiple values are to be interpreted as additional values for the property (i.e. the set of key-value pairs that have identical keys represents a list of values for the key).

The UCH provides a module's property map to the module itself at initialization time. This allows for customization of a generic module based on a particular runtime context.

In addition, the UCH may utilize the property map of any object, for example for determining the most appropriate UIPM for a set of available targets.

4.6.1. Property Names

A property name shall be a URI [RFC 3986], consisting of a namespace and a local property name. This allows for an extensible set of properties.

A core set of properties and their meanings are defined in [RES-PROP-VOCAB].

Other (non-core) property names may be used to describe objects, as long as the property names do not conflict with the core set defined in [RES-PROP-VOCAB]. In order to avoid potential conflicts with future versions of core properties and with other non-core properties, the use of author-owned URIs as namespaces for non-core property names is strongly recommended.

4.6.2. Implementation Considerations

Implementation of property maps are platform-specific. Programming languages with hash maps should use hash maps with strings as keys and string arrays as values (to accommodate multiple values of the same property). Otherwise pairs of string arrays should be used.

4.7. Target Instance Identifier

The UCH shall provide identifiers for target instances (see ISO/IEC 24752-1, section 6.1.2 Target instance identifier). The target instance identifiers shall be globally unique.

Target instance identifiers are strings, and shall not contain whitespace characters. Their format may be specific to the underlying target platform. The string "all" is reserved and shall not be used as target instance identifier.

NOTE: In this specification, a target instance identifier is commonly named 'targetId'.

The UCH should use target instance identifiers that are persistent even after periods of target unavailability, and after the UCH has restarted.

NOTE: For targets running on UPnP, the UDN is a suitable target instance identifier.

Static and dynamic resources may be defined to be specific to target instances. Static resources may use the <forTargetInstance> element (ISO/IEC 24752-5, section 6.7.3.6) to indicate a particular target instance. For dynamic resources, a TA may indicate their specificity to a particular target instance in the updateDynRes() function via the 'targetId' parameter (see section void updateDynRes(string[] sessionIds, string[] eltIds)).

4.8. Session Identifier

The UCH shall provide identifiers for sessions which are unique within the UCH.

The UCH should not reuse session identifiers of sessions that have been terminated.

4.9. Paths

Particular values of socket elements or components thereof are referenced by path strings.

The following table lists possible forms of paths, as used by the APIs specified in subsequent sections of this document.

Path Form Name

Syntax(es)

Description

root path

/

all Socket elements (and their components, if any)

path without indices

/set1/set2/id

id

alternative formats for non-dimensional Socket element or set

path with given indices

/set1[index1]/set2/
id[index2][index3]

one component of a dimensional Socket element or set, i.e. that has a 'dim' attribute or that is contained (directly or indirectly) in a set that has a 'dim' attribute

path with empty indices

/set1[]/set2/id[][]

all components of the Socket element or set id.

May be mixed with form "path with given indices", thus partially specifying a set of indices, e.g.: "/set1[index1]/set2/id[index2][]", "/set1[]/set2/id[index2][index3]", "/set1[index1]/set2/id[][index3]".

path with range of indices

/set1[index1a index1b]/set2/id[index2a index2b][index3a index3b]

specific components of the Socket element or set id, within a specific range of index values (index1a <= index1 <= index1b, index2a <= index2 <= index2b, index3a <= index3 <= index3b).

This form can only be applied for indices whose type is totally ordered (i.e. the index type must be based on an XSD type with the fundamental facet 'ordered' having a value of "total" or "partial"; if "partial", only those index values that can be compared with the boundaries will be included in the response).

This form can be mixed with the "path with given indices" form, and the "path with empty indices" form. EXAMPLE: "/set1[index1]/set2/id[index2a index2b][]".

path for command state

/set1/set2/cmdid[state]

id[state]

/set1[index1]/set2/
cmdid[index2][index3][state]

"state" field of a command (component) only applicable for commands of type "uis:basicCommand" or "uis:timedCommand" use first or second form for non-dimensional commands; and last form for dimensional commands.

path for command timeToComplete

/set1/set2/cmdid[ttc]

cmdid[ttc]

/set1[index1]/set2/
cmdid[index2][index3][ttc]

"timeToComplete" field of a command (component) only applicable for commands of type "uis:timedCommand" use first or second form for non-dimensional commands; and last form for dimensional commands.

path for local command parameter

/set1/set2/cmdid/parid

parid

/set1[index1]/set2/
cmdid[index2][index3]/parid

local parameter of a command (component) use first or second form for non-dimensional commands; and last form for dimensional commands.

path for partial XML content

eltPath#xmlPath

partial content of an XML-coded Socket element value (i.e. a Socket element with a complex XSD form).

eltPath references a Socket element, in any of the following path forms: "path without indices", "shortcut path" or "path with given indices".

xmlPath has any one of the following syntaxes:

"root" for requesting an XML fragment containing the root element only.

"childrenOf(nodeId)" for requesting an XML fragment containing the child nodes of the XML element with id="nodeId".

"parentOf(nodeId)" for requesting an XML fragment containing the parent node of the XML element with id="nodeId".

"id(nodeId)" for requesting an XML fragment containing the XML element with id="nodeId". The fragment will contain the nodeId element including its attributes, but not its child nodes.

4.10. Values

All values are passed as strings.

NULL represents the undefined value.

NOTE: Optional socket elements that are not available in a socket at runtime have the undefined value.

4.11. Resources

A UCH component (such as a UIPM, TDM or TA) should not itself contact a resource server to query for resources. Instead, it should use the appropriate function getResources() to have the UCH do the query and retrieval for it. It is implementation-specific where the UCH will go for resource retrieval including a local configuration mechanism, a local resource server, a global resource server, or any combination of these.

Atomic resources (even if they are dynamic) are common to all sessions on the same socket, and common to all components (index combinations) of a socket element. However, they may be different for different target instances (specified by the http://myurc.org/ns/res#forTargetInstance property).

Note: Socket elements and socket-local types (declared in the <schema> section of the socket description) may have dynamic resources in which case no static resources should be applied. This is indicated by the attribute includesRes="true" on the socket element or type definition (<simpleType> or <complexType>, also carrying an 'id' attribute for reference). ISO/IEC 24752-2:2008 does not allow for a 'includesRes' attribute on a type definition; this will be fixed in the next version. In the meanwhile the UCH should follow a work-around: If a resource is requested for a socket-local type that has no 'includesRes' attribute, the UCH should first try to find static resources, and then request the TA for dynamic resources for the type.

4.12. Local Data Store

In some cases different modules (UIPMs, TDMs, TAs) and the UCH core may wish to share data with each other. For this purpose, a shared Map is provided by the UCH, called "local data store". Modules may store data as key-value pairs in the local UCH store, which may be accessed by other (related) modules that know the corresponding keys.

It is recommended that keys are used that will likely not conflict with data written by other modules at runtime. Manufacturers of modules should use keys in the form of URIs that they own, such as URLs under their domain name. EXAMPLE: "http://example.com/uipm/portno".

Note that the local data store is not persistent. Data will not survive a UCH restart. Also, upon removal of a module (TA or UIPM) from the system, the UCH may delete data written by that module.

Note also that the local UCH store is not a safe place for communicating sensitive information such as authorization keys, since it can be read by the UCH, and all UIPMs, TDMs and TAs.

The UCH shall provide a local data store object as a map with distinct keys. No duplicate keys are allowed (i.e. setting a value for an already existing key will overwrite the previous data for that key).

The local data store shall implement the functions as defined hereby for IUCHStore:

4.12.1. Object getValue(string key)

Get a stored value from the local data store (a map, see section Local Data Store).

4.12.2. void setValue(string key, Object value)

Set a (new) value for the given key. If the key didn't exist in the map before, it will be created. If the key is already existing, the map stores the new value under the key, and the old value is lost.

4.13. Personalization

A UCH shall manage profiles for users and controllers for the purpose of personalization. A pair of one user and one controller profile is referred to as 'User Context' or just 'Context'.

A UCH shall manage Context information, and shall protect it from unauthorized access by internal and external components.

Context information should be persistent, even after a reboot of the UCH. This may be achieved by storing the Context information on a local file, on a resource server, or through any other mechanism. In any case, Context information shall be stored securely and shall be protected from unauthorized access.

Mechanisms for setting up and editing Context information by users is implementation-specific and outside the scope of this specification.

The UCH component holding Context information is henceforth called "User Context Manager", or short "UC Manager" (without restricting implementation of a UCH). The UC Manager receives requests from controllers to open a new user context, and to close existing contexts. Components of the UCH may contact the Context Manager for retrieving Context information via reference.

User and controller profile information in the UCH

Figure 2: Flow of user and controller profile information inside the UCH architecture (description of figure).

4.13.1. Context-Specificity

In general, some concepts and components inside the UCH are related to specific Contexts in the following ways:

4.13.2. Profile Implementation

A UCH shall implement and manage user and controller profiles as protected objects, i.e. components (such as UIPM, TDM or TA) shall only be able to indirectly read or write them. A user or controller profile shall be represented to components as a unique object reference (referred to as 'profile handle'). A NULL reference denotes an anonymous profile, i.e. an anonymous user or anonymous controller. Note that two NULL references do not necessarily implicate the same user or controller.

A user/controller profile shall consist of one shared/open core and an arbitrary number of private parts ('extensions'). Its content shall be a list of key-value pairs, each with an optional password for protection. Key-value pairs without passwords belong to the open core, those with passwords belong to private extensions. It is recommended to use URIs as keys.

Parts of a user profile

Figure: Profile structure (description of figure).

For the purpose of read and write access to a profile represented through its handle, the UCH shall provide the following functions, hereby defined as the interface IProfile:

4.13.2.1. String getValue(string key, string password)

Get the value for a key.

4.13.2.2. Boolean setValue(string key, string value, string password)

Set a key-value pair. If the key existed before, its value will be overwritten.

4.13.2.3. Boolean removeValue(string key, string password)

Remove a key-value pair.

4.13.2.4. string[] getCoreKeys()

Get a list of keys for the open (shared) core.

Note: The caller can use the getValue() function for retrieving the actual values of the core keys.

4.13.3. Context Implementation

For the purpose of passing Context information from and to components, Context information is represented as a Map of key-value pairs, with the following keys:

5. Interaction Between UIPM and UCH

5.1. UIPM Loading and Unloading

A UIPM may be retrieved from local or remote resources (e.g. resource server).

The UCH should load a UIPM when the UIPM's set of applicable targets is a subset of the currently available targets in the UCH. The set of applicable targets is specified by the aggregation of all existing "http://myurc.org/ns/res#forTargetName" property values for a UIPM [RES-PROP-VOCAB].

The UCH may unload a UIPM at any time, but should call its finalize() function (section void finalize()) prior to unloading. A UCH should unload a UIPM if it is not applicable (anymore) to the current set of available targets. A UCH should unload a UIPM after the UIPM has called removeUIPM() (see section void removeUIPM(IUIPM uipm)).

5.2. API of UIPM (IUIPM)

5.2.1. Mandatory Functions

5.2.1.1. void init(IUIPMListener uipmListener, Map uipmProps, Map uchProps, Map[] contexts) throws UIPMFatalException

After a UIPM has been installed and loaded, the UCH shall call init() prior to any other UIPM function. This allows the UIPM to initialize itself.

5.2.1.2. void finalize()

Tell the UIPM to clean up its own memory. The UIPM does not need to clean up for the sessions or user interface items it has created within the UCH the UCH will take care about this itself.

The UCH should call finalize() before it uninstalls or unloads the UIPM. However, finalize() shall not be called after init() has thrown a UIPMFatalException.

5.2.1.3. void contextsOpened(Map[] Contexts) throws UIPMFatalException

This function is called when one or more contexts have been opened on the UCH.

5.2.1.4. void contextsClosed(Map[] Contexts) throws UIPMFatalException

This function is called when one or more contexts were closed or have expired on the UCH.

5.2.1.5. Map getUIPMProps()

Get property map of the UIPM.

5.2.1.6. void targetDiscovered(string targetId, Map[] contexts) throws UIPMFatalException

This function is called when a new target has been discovered after initialization of the UIPM.

5.2.1.7. void targetContextsAdded(string targetId, Map[] Contexts) throws UIPMFatalException

This function is called when one or more contexts got added to an existing target.

5.2.1.8. void targetContextsRemoved(string targetId, Map[] Contexts) throws UIPMFatalException

This function is called when one or more contexts got removed from an existing target.

5.2.1.9. void targetDiscarded(string targetId) throws UIPMFatalException

This function is called when a target has been discarded after initialization of the UIPM.

5.2.1.10. void sessionForwardRequest(string sessionId, Map forwardInfo) throws UIPMFatalException

The target requests the client (UIPM/controller) to open a session with a different socket. There are two types of forward requests: A "destructive forward request" asks the client to close the current session. A "spawn forward request" does not affect the current session.

5.2.1.11. void sessionAborted(string sessionId) throws UIPMFatalException

The target has terminated a session (which may be in active or suspended mode).

5.2.1.12. void updateValues(string[] sessionIds, string[] paths, string[] operations, string[] values, boolean[] hasDynRes) throws UIPMFatalException

The target's status has changed, affecting one or more sessions.

NOTE: The arrays paths, operations, values and hasDynRes shall be of the same size.

NOTE: A UCH that watches dependencies may trigger an update for a variable that has a 'calculate' dependency defined if one if the parameters in its 'calculate' dependency has changed. The UCH may either add the update to the arrays as part of an "accumulated update", or as a separate call to updateValues().

5.2.1.13. boolean isImplemented(string functionName)

This function allows the UCH to check whether any of the optional functions are implemented by the UIPM.

5.2.1.14. Map[] getUriServiceContexts(string uri) throws UIPMFatalException

The UCH asks a UIPM to return a list of contexts for one of the UIPM's service URI.

5.2.2. Optional Functions

5.2.2.1. void controllerRequest(Object request, Object response, Map context) throws UIPMFatalException

NOTE: The controllerRequest() function is currently specific to HTTP requests and responses. Future versions of this document may accommodate additional URI schemes.

A UIPM may implement the controllerRequest() function. If it does not implement it, it shall not call the UCH's startUriService() function.

The UCH calls controllerRequest() if it has received a request from a controller to a URI that the UIPM has claimed for itself by a previous call to startUriService(). The UCH is responsible for creating the request and (partially empty) response objects prior to calling controllerRequest().

5.3. API of UIPM Listener (IUIPMListener)

How to access the UCH (socket layer) from a UIPM.

5.3.1. Mandatory Functions

5.3.1.1. Map[] getContexts()

A UIPM requests a list of currently open contexts.

5.3.1.2. string[] getAvailableTargetIds(Map context)

Get the identifiers of the targets that are available for the given context.

5.3.1.3. string getTargetName(string targetId)

Get the name (URI) of a target. Note that the target name is not necessarily unique within the UCH since there may be multiple copies of one target type (with the same target name).

NOTE: The name (URI) of a target is the value of the 'about' attribute of the <target> element in a target description.

5.3.1.4. Map getTargetProps(string targetId)

Get a property map for a target.

5.3.1.5. Map[] getTargetContexts(string targetId)

Get the list of contexts for which a target is available.

5.3.1.6. string getTargetDescriptionUri(string targetName)

Get the URI for retrieving the target description.

NOTE: The function getDocument() (see section string getDocument(string uri, string postData) throws UCHException) can be used to retrieve the actual Target Description document.

5.3.1.7. string getDocument(string uri, string postData, Map context) throws UCHException

Get description document through HTTP GET or POST (HTTP proxy function). Default values should be used for HTTP header data.

NOTE: getDocument() can be used to retrieve local or remote documents.

5.3.1.8. string[] getSocketNames(string targetName)

Get the socket names (URIs) for a target type. Note that this is a convenience function for the UIPM since the socket names are specified in the target description.

5.3.1.9. string getSocketDescriptionUri(string targetName, string socketName)

Get the URI for retrieving the socket description.

NOTE: The function getDocument() (see section string getDocument(string uri, string postData) throws UCHException) can be used to retrieve the actual Socket Description document.

NOTE: Strictly, targetName is not needed since a socket description is already identified by its socket name. However, UCH implementations may be simpler if they don't need to keep track of a cross-target list of socket names.

5.3.1.10. string getSocketName(string sessionId)

Get the socket name (URI) for a specified session.

5.3.1.11. string getSocketFriendlyName(string targetId, string socketName)

Get the friendly name for a socket on a target instance. This is a short, human-readable name for the socket, and may be user-configured.

NOTE: For example, the friendly name can be used as part of the URI for a user interface.socketName: name (URI) of the socket.

5.3.1.12. Map getLocators(string targetName)

Get a map with locator ids and locator types for a specific target type.

5.3.1.13. void invokeLocator(string targetId, string locatorId)

Invoke the specified locator function on the specified target. Note that it is not necessary to have a session open with the target.

Note: A UIPM shall make this function only available to Contexts that the target supports.

5.3.1.14. boolean isElementAvailable(string targetId, string socketName, string eltId)

Check whether a specified socket element is available at runtime.

NOTE: Socket elements with an attribute optional="true" may not be available at runtime. Other socket elements are always available.

Note: A UIPM shall make this function only available to Contexts that the target supports.

5.3.1.15. Map[][] getResources(string sessionId, Map[] resProps)

Get any kind of resource from the UCH. The UCH should relay the request to a resource server or TA if it cannot handle it locally (this is implementation-specific). The caller shall specify the properties of the requested resource as much as possible. A specific matching algorithm is implementation-specific. See also section Resources.

5.3.1.16. Map openSessionRequest(IUIPM uipm, string targetId, string socketName, Map sessionProps, Map context)

Request for opening a session with the specified target and socket.

5.3.1.17. void closeSession(string sessionId)

The UIPM closes a session with the UCH.

5.3.1.18. Map getValues(string sessionId, string[] paths, boolean[] includeSets)

The UIPM asks for the values/states of specified socket elements or components thereof.

5.3.1.19. Object[] getIndices(string sessionId, string[] eltIds, integer[] indexNos)

The UIPM asks for the available values for a particular index of a dimensional socket element or set.

NOTE: This function looks at the actual value for a specific index of a socket element, isolated from other indices that are part of all actual paths for the given element. For sparse arrays, the index value may not occur in any possible combination with values of other indices.

5.3.1.20. Map setValuesRequest(string sessionId, string[] paths, string[] operations, string[] reqValues)

The UIPM requests to change the target state in one or more operations on specified socket elements or components thereof. The requested operations are coded as cross-indexed arrays of paths, operation identifiers and requested new values. "Cross-indexed" means that array elements with the same index belong together.

NOTE: The UCH may validate the requests and block those that would violate a socket element's type or dependencies (see section boolean setValidation(ITA ta, boolean activate), setValidation function). Blocking means that the UCH removes invalid requests before passing them on to the pertaining TA.

5.3.1.21. string getIpAddress()

Get the IP address of the UCH. A UIPM may need this information to set up its own listener for a port that is not serviced by the UCH.

5.3.1.22. string startUriService(IUIPM uipm, string scheme, int port, boolean portIsFlexible, string basePath, boolean basePathIsFlexible, Map[] contexts) throws UCHException

The UIPM requests the UCH to start servicing a URI which is made up of a given scheme, port, and base path. If successful, the UCH will forward all messages that have this URI as its base, to controllerRequest(). If the UIPM indicates that the base path is flexible, the UCH can modify the base path in case it is not available any more.

NOTE: This function does not advertise the URI through its UIList. A separate call to addCompatibleUI() is needed for that.

5.3.1.23. void addUriServiceContexts(string uri, Map[] contexts) throws UCHException

This function is called when the UIPM wants to add one or more contexts to a URI service.

5.3.1.24. void removeUriServiceContexts(string uri, Map[] contexts) throws UCHException

This function is called when the UIPM wants to remove one or more contexts from a URI service.

5.3.1.25. void stopUriService(string uri) throws UCHException

The UIPM requests the UCH to stop servicing a URI that was requested to be serviced in a previous call to startUriService().

5.3.1.26. boolean addCompatibleUI(string targetId, string[] socketNames, string protocolShortName, string[] uris, Map protocolInfo) throws UCHException

Tell the UCH to add a user interface item (advertised by the UIPM) to its UIList (see section UIList) which is exposed to controllers on request. If the UIPM wants to advertise multiple user interfaces at the same time, it needs to call addCompatibleUI() multiple times.

The UCH shall map these parameter values to an entry in the UIList (see section UIList) as follows:

5.3.1.27. void removeCompatibleUI(string[] uris) throws UCHException

Tells the UCH to remove user interface URIs from the UIList that were previously added by one call to addCompatibleUI(). Note that the UCH may have to remove the pertaining <protocol> or <ui> element from the UList if no <uri> element is remaining in it.

5.3.1.28. IUCHStore getLocalUCHStore()

Get the local UCH store (a map, see section Local Data Store).

5.3.1.29. Map getUCHProps()

Get property map of the UCH.

5.3.1.30. boolean isImplemented(string functionName)

This function allows the UIPM to check whether any of the optional functions are implemented by the UIPMListener.

5.3.2. Optional Functions

5.3.2.1. boolean validateValue(string sessionId, string path, string value) throws UCHNotImplementedException

The UCH validates a given value for a given path with regard to the pertaining XSD type, or runtime constraints by dependencies. The following runtime constraints are considered: length, minLength, maxLength, pattern, minInclusive, maxInclusive, minExclusive, maxExclusive.

5.3.2.2. boolean getDependencyValue(string sessionId, string path, string dependency) throws UCHNotImplementedException

Get the actual value of a dependency, pertaining to a socket set or element.

NOTE: This function does not work for 'calculate' dependencies. See function updateValues() in section void updateValues(string[] sessionIds, string[] paths, string[] operations, string[] values, boolean[] hasDynRes) for how a UCH may use the 'calculate' dependency.

5.3.2.3. string getElementRef(string sessionId, string path) throws UCHNotImplementedException

Get the elementRef URI that points to a particular socket element/set. The elementRef can be used as part of the query for the label of the socket element/set, see function getResources(), section Map[] getResources(string sessionId, Map[] resProps).

NOTE: This is a convenience function for light-weight UIPMs.

5.3.2.4. boolean isSessionSuspendable(string sessionId) throws UCHNotImplementedException

Asks whether the given session can be suspended.

5.3.2.5. long suspendSession(string sessionId, long suggestedTimeout) throws UCHNotImplementedException

The target is requested to suspend the given session with a suggested timeout value.

5.3.2.6. boolean isSessionResumable(string sessionId) throws UCHNotImplementedException

Asks whether the given session can be resumed.

5.3.2.7. boolean resumeSession(string sessionId) throws UCHNotImplementedException

The target is requested to resume the given session.

5.3.2.8. void removeUIPM(IUIPM uipm)

The UIPM requests the UCH to be finalized and unloaded. UIPMs should call this function if they cannot operate anymore because of the currently available set of targets or other reasons.

The UCH may follow this request. In any case, the UCH shall call finalize() on the UIPM before it unloads the UIPM.

6. Interaction Between Target Discovery Module (TDM) and UCH

A Target Discovery Module (TDM) is responsible for discovering targets and providing information on discovered targets to the UCH. A TDM may be specific for a single target, or generic for a whole class of targets (e.g. UPnP targets).

6.1. TDM Loading and Unloading

A TDM may be retrieved from local or remote resources (e.g. resource server).

Loading of a TDM is out of scope for this specification. The UCH may load a Target Discovery Module (TDM) in a proprietary way, for example as part of the executable file, or as shared library referenced by a configuration file.

The UCH may unload a TDM at any time, but should call its finalize() function (section void finalize()) prior to unloading. The UCH should unload a TDM after the TDM has called removeTDM() (see section void removeTDM(ITDM tdm)).

6.2. Target Discovery Module Interface (ITDM)

This section specifies how the UCH will communicate with a TDM once it is installed and loaded into the application.

6.2.1. Mandatory Functions

6.2.1.1. void init(ITDMListener tdmListener, Map tdmProps, Map uchProps, Map[] contexts) throws TDMFatalException

After the TDM has been installed and loaded, the UCH calls init() prior to any other TDM function. This allows the TDM to initialize itself. Note that discovery of targets shall only start upon calling startDiscovery().

6.2.1.2. void finalize()

The UCH should call finalize() before it uninstalls or unloads the TDM. However, finalize() shall not be called after init() has thrown a TDMFatalException.

The UCH should call stopDiscovery() prior to finalize(). In any case, the TDM shall stop discovery upon finalize() is called.

6.2.1.3. void contextsOpened(Map[] Contexts) throws TDMFatalException

This function is called when one or more contexts have been opened on the UCH.

6.2.1.4. void contextsClosed(Map[] Contexts) throws TDMFatalException

This function is called when one or more contexts were closed or have expired on the UCH.

6.2.1.5. Map getTDMProps()

Get property map of the TDM.

6.2.1.6. void startDiscovery() throws TDMFatalException

This function signals the TDM to start discovery of targets, until stopDiscovery() is called. Shall be ignored if the TDM is already in target discovery mode.

NOTE: The TDM will now look for new and disappearing targets, until either stopDiscovery() or finalize() is called.

6.2.1.7. void stopDiscovery() throws TDMFatalException

This function signals the TDM to stop discovery of targets, until startDiscovery() is called. Shall be ignored if the TDM is not in target discovery mode.

6.2.1.8. Map[] getTargetContexts(string targetId)

The UCH requests a list of contexts for a given target.

6.2.2. Optional Functions

6.2.2.1. void targetRequest(Object request, Object response, Map context) throws TDMFatalException

NOTE: The targetRequest() function is currently specific to HTTP requests and responses. Future versions of this document may accommodate additional URI schemes.

A TDM may implement the targetRequest() function. If it does not implement it, it shall not call the UCH's startUriService() function.

The UCH calls targetRequest() if it has received a request from a target to a URI that the TDM has claimed for itself by a previous call to startUriService(). The UCH is responsible for creating the request and response objects prior to calling targetRequest().

The request and response parameters of targetRequest() have exactly the same meaning as the request and response parameters of controllerRequest(), respectively (see section controllerRequest()).

6.3. Target Discovery Manager Listener Interface (ITDMListener)

6.3.1. Mandatory Functions

6.3.1.1. Map[] getContexts()

A TDM requests a list of currently open contexts.

6.3.1.2. string targetDiscovered(Map targetProps, Map taProps, Map[] contexts)

A TDM has discovered a new target, and provides information on the discovered target, and on the target adapter to be loaded for it. In response, the UCH will install and load an appropriate Target Adapter (TA) for the new target. If the corresponding TA is already installed (same identifier), the new target shall be registered with the already installed TA.

6.3.1.3. void targetContextsAdded(string targetId, Map[] Contexts)

This function is called when one or more contexts got added to an existing target.

6.3.1.4. void targetContextsRemoved(string targetId, Map[] Contexts)

This function is called when one or more contexts got removed from an existing target.

6.3.1.5. void targetDiscarded(string targetId)

A TDM calls this function when a target has disappeared from the network. Depending on the target and its networking platform, this can mean that the target was powered off, disconnected from the network, or there is no context opened anymore that makes this target available.

6.3.1.6. IUCHStore getLocalUCHStore()

Get the local UCH store (a map, see section Local Data Store).

6.3.1.7. string getIpAddress()

Get the IP address of the UCH. A TDM may need this information to set up its own listener for a port that is not serviced by the UCH.

6.3.1.8. string startUriService(ITDM tdm, string scheme, int port, boolean portIsFlexible, string basePath, boolean basePathIsFlexible, Map[] contexts) throws UCHException

The TDM requests the UCH to start servicing a URI which is made up of a given scheme, port, and base path. If successful, the UCH will forward all messages that have this URI as its base, to targetRequest(). If the TDM indicates that the base path is flexible, the UCH can modify the base path in case it is not available any more.

6.3.1.9. void addUriServiceContexts(string uri, Map[] contexts) throws UCHException

This function is called when the TDM wants to add one or more contexts to a URI service.

6.3.1.10. void removeUriServiceContexts(string uri, Map[] contexts) throws UCHException

This function is called when the TDM wants to remove one or more contexts from a URI service.

6.3.1.11. void stopUriService(string uri) throws UCHException

The TDM requests the UCH to stop servicing a URI that was requested to be serviced in a previous call to startUriService().

6.3.1.12. Map[][] getResources(string sessionId, Map[] resProps)

Same as function IUIPMListener.getResources(), see section getResources().

6.3.1.13. string getDocument(string uri, string postData, Map context) throws UCHException

Same as function IUIPMListener.getDocument(), see section getDocument().

6.3.1.14. Map getUCHProps()

Get property map of the UCH.

6.3.1.15. boolean isImplemented(string functionName)

This function allows the TDM to check whether any of the optional functions are implemented by the TDMListener.

6.3.2. Optional Functions

6.3.2.1. void removeTDM(ITDM tdm)

The TDM requests the UCH to be finalized and unloaded. TDMs should call this function if they cannot operate anymore because of external events or other reasons.

The UCH may follow this request. In any case, the UCH shall call finalize() on the TDM before it unloads the TDM.

7. Interaction Between Target Adapter and UCH

A Target Adapter (TA) represents one or multiple targets to the UCH. It is being installed and loaded upon the discovery of a first target that it can represent. The UCH will register new targets with the TA as they are discovered by the TDM; and unregister after they have disappeared. After having opened a session on a target's socket, the TA is responsible for managing the values of the pertaining socket instance.

NOTE: Target registration (and un-registration) is a separate step because one TA may represent multiple targets. Also, one target (type) may occur as multiple instances in a network (with different targetIds) the associated TA must be able to deal with this situation.

7.1. TA Loading and Unloading

A TA may be retrieved from local or remote resources (e.g. resource server).

The UCH should load a TA when the TA's properties match the set of properties provided by a TDM upon target discovery (see section targetDiscovered()). See [RES-PROP-VOCAB] for details on resource properties.

The UCH may unload a TA at any time, but should call its finalize() function (section finalize()) prior to unloading. A UCH should unload a TA if it has no targets registered (anymore). A UCH should unload a TA after the TA has called removeTA() (see section removeTA()).

7.2. Target Adapter Interface (ITA)

7.2.1. Mandatory Functions

7.2.1.1. void init(ITAListener taListener, Map taProps, Map uchProps) throws TAFatalException

When the TA is installed and loaded, the UCH calls init() prior to any other TA function. This allows the TA to initialize itself. Note that the observation of a specific target needs a separate function call, i.e. registerTarget().

NOTE: The UCH shall be prepared for the TA calling functions of the TA Listener during the execution of init(). For example, the TA may call setValidation (see section boolean setValidation(ITA ta, boolean activate)) to set the validation mode of the UCH.

NOTE: There is no need for a TA to know about currently open contexts. The TDMs are responsible for assigning contexts to targets, and the corresponding TAs will be notified about any changes, via registerTarget(), targetContextsAdded() and targetContextsRemoved(). Also, it can request the contexts for a given target via getTargetContexts().

7.2.1.2. void finalize()

The UCH should call finalize() before it uninstalls or unloads the TA. However, finalize() shall not be called after init() has thrown a TAFatalException.

If the UCH has targets registered with a TA (see section void registerTarget(string targetId, Map targetProps) throws TAException, TAFatalException), it should unregister them (see section void unregisterTarget(string targetId) throws TAFatalException) prior to calling finalize(). In any case, the TA shall unregister all targets when finalize() is called.

7.2.1.3. Map getTAProps()

Get property map of the TA.

7.2.1.4. void registerTarget(string targetId, Map targetProps, Map[] contexts) throws TAException, TAFatalException

The TA gets a mandate to represent a given target with a given targetId. From now on, until unregister() is called for this target, the TA shall expose the target's sockets to the UCH.

7.2.1.5. void targetContextsAdded(string targetId, Map[] Contexts) throws TAFatalException

This function is called when one or more contexts got added to an existing target.

7.2.1.6. void targetContextsRemoved(string targetId, Map[] Contexts) throws TAFatalException

This function is called when one or more contexts got removed from an existing target.

7.2.1.7. void unregisterTarget(string targetId) throws TAFatalException

Stop exposing a target to the UCH. This function is typically called when a target has disappeared from the network. If sessions are open on this target, the TA shall close these sessions (via sessionAborted, see section Target Adapter Listener Interface (ITAListener)) prior to returning from unregisterTarget.

7.2.1.8. string[] getRegisteredTargetIds() throws TAFatalException

Get the target identifiers that the TA is currently representing.

7.2.1.9. Map getLocators(string targetName)

Get a map with locator ids and locator types for a specific target type.

7.2.1.10. void invokeLocator(string targetId, string locatorId) throws TAException, TAFatalException

Invoke the specified locator function on a target. This requires a prior call to registerTarget on this target. But it is not necessary to have a session open with this target.

7.2.1.11. string getTargetName(string targetId) throws TAFatalException

Get the name (URI) of a target. Note that there may be multiple copies of targets (different targetIds) with the same target name.

7.2.1.12. string getTargetDescriptionUri(string targetName) throws TAFatalException

Get the URI for retrieving the target description.

7.2.1.13. Map getTargetProps(string targetId) throws TAFatalException

Get the target's properties.

7.2.1.14. string[] getSocketNames(string targetName) throws TAFatalException

Get the names (URIs) of a target's sockets.

NOTE: This function is provided for the convenience of light-weight UCHs. In general, a UCH could glean this information from the Target Description.

7.2.1.15. string getSocketName(string sessionId) throws TAFatalException

Get the socket name (URI) for a specified session.

7.2.1.16. string getSocketFriendlyName(string targetId, string socketName)

Get the friendly name for a socket. This is a short, human-readable name for the socket, and may be user-configured.

NOTE: A TA may use the id attribute value of the <socket> element in the target description as the socket's friendly name.

7.2.1.17. string[] getSessionIds(string targetId, string socketName) throws TAFatalException

Get the set of session identifiers for a given socket name (URI).

7.2.1.18. string getSocketDescriptionUri(string targetId, string socketName) throws TAFatalException

Get the URI for retrieving the socket description.

7.2.1.19. Map openSessionRequest(string targetId, string socketName, Map sessionProps, Map context) throws TAFatalException

The UCH asks for permission to open a session with a specified client on a specified socket. Note that this function asks for permission only, and is not supposed to actually open a session.

7.2.1.20. void sessionOpened(string targetId, string sessionId, string socketName, Map sessionProps, Map context) throws TAFatalException

If the TA has accepted an open session request (see above), and if the UCH succeeded in the necessary steps to open a session with the client, the UCH will call sessionOpened and provide the sessionId pertaining to the new session.

7.2.1.21. void sessionClosed(string sessionId) throws TAFatalException

The UCH signals the TA that a session has been closed with one of the TA's targets, caused by a UIPM or the UCH itself (e.g. due to session timeout). The TA should do the necessary clean-up internally and with the target.

7.2.1.22. Map setValuesRequest(string sessionId, boolean isValidated, string[] paths, string[] operations, string[] reqValues) throws TAFatalException

The client requests to change the target state in one or more operations on specified socket elements or components thereof. The requested operations are coded as cross-indexed arrays of paths, operation identifiers and requested new values. "Cross-indexed" means that array elements with the same index belong together.

7.2.1.23. Map getValues(string sessionId, string[] paths) throws TAFatalException

The client asks for the values/states of specified socket elements or components thereof.

7.2.1.24. Object[] getIndices(string sessionId, string[] eltIds, integer[] indexNos)

The UCH asks for the available values for a particular index of a dimensional socket element or set.

See section Object[] getIndices(string sessionId, string[] eltIds, integer[] indexNos).

7.2.1.25. Map[] getDynRes(string sessionId, Map[] resProps) throws TAFatalException

Get a dynamic atomic resource from the TA, pertaining to a given session. The UCH shall specify the properties of the requested resource as much as possible. A specific matching algorithm is implementation-specific. See also section Resources.

7.2.1.26. boolean isElementAvailable(string targetId, string socketName, string eltId) throws TAFatalException

This function allows the UCH to check whether a given socket element is available or not.

NOTE: Socket elements with an attribute optional="true" may not be available at runtime. Other socket elements are always available.

7.2.1.27. boolean isImplemented(string functionName)

This function allows the UCH to check whether any of the optional functions are implemented by the TA.

7.2.2. Optional Functions

7.2.2.1. boolean suspendSessionRequest(string sessionId) throws TAFatalException, TANotImplementedException

The UCH asks for permission to suspend a session. Note that this function asks for permission only, and is not supposed to actually suspend the session.

7.2.2.2. long sessionSuspended(string sessionId, long suggestedTimeout) throws TAException, TAFatalException, TANotImplementedException

The UCH signals the TA that the client has suspended a session with one of the TA's targets. The TA should do the necessary actions internally and with the target. The session is now suspended until a subsequent call to resumeSessionRequest(), or until the TA terminates the session for timing out or other reasons, in which case the TA shall call sessionAborted().

NOTE: A suspended session is in "sleep mode". During suspension, the TA will not send any updates to the UCH, and the UCH will not request to change the status of the target. The suspension can be terminated by any of the following actions: UCH calls resumeSessionRequest() and sessionResumed(); UCH calls sessionClosed(); UCH calls unregisterTarget() on the pertaining target; TA terminates session and calls sessionAborted().

7.2.2.3. boolean resumeSessionRequest(string sessionId) throws TAFatalException, TANotImplementedException

The UCH asks for permission to resume a session. Note that this function asks for permission only, and is not supposed to actually resume the session.

7.2.2.4. void sessionResumed(string sessionId) throws TAException, TAFatalException, TANotImplementedException

The UCH signals the TA that the session has resumed. A call to this function shall only occur after a resume session request has been granted by the TA (see section boolean resumeSessionRequest(string sessionId)).

7.2.2.5. void targetRequest(Object request, Object response, Map context) throws TAFatalException

NOTE: The targetRequest() function is currently specific to HTTP requests and responses. Future versions of this document may accommodate additional URI schemes.

A TA may implement the targetRequest() function. If it does not implement it, it shall not call the UCH's startUriService() function.

The UCH calls targetRequest() if it has received a request from a target to a URI that the TA has claimed for itself by a previous call to startUriService(). The UCH is responsible for creating the request and response objects prior to calling targetRequest().

The request and response parameters of targetRequest() have exactly the same meaning as the request and response parameters of controllerRequest(), respectively (see section controllerRequest()).

7.3. Target Adapter Listener Interface (ITAListener)

7.3.1. Mandatory Functions

7.3.1.1. Map[] getTargetContexts(string targetId)

The TA requests a list of contexts for a given target.

7.3.1.2. void sessionForwardRequest(string sessionId, Map forwardInfo)

The TA requests the client to open a session with a different socket. There are two types of forward requests: A "destructive forward request" asks the client to close the current session. A "spawn forward request" does not affect the current session.

7.3.1.3. void abortSession(string sessionId)

The TA has terminated a session (which may be in active or suspended mode). From now on, the TA may have no knowledge about that session any more.

7.3.1.4. void updateValues(string[] sessionIds, string[] paths, string[] operations, string[] values, boolean[] hasDynRes)

The TA signals a change in the target's status, affecting one or more sessions.

NOTE: The arrays paths, operations, values and hasDynRes shall be of the same size.

7.3.1.5. void updateDynRes(string[] sessionIds, string[] eltIds)

The TA signals that the set of atomic resources pertaining to a specific session and socket element has changed. Note that this function does not provide the new set of resources, but rather waits until the UCH request a specific dynamic resource via a subsequent call to getDynRes() (see section Map[] getDynRes(string sessionId, Map[] resProps) throws TAFatalException).

NOTE: The UCH may ignore this message if it opts to not cache dynamic resources (but rather ask for dynamic resources via getDynRes() on demand).

NOTE: This is an "in-session" function which may only be called if a session is open with the TA.

7.3.1.6. IUCHStore getLocalUCHStore()

Get the local UCH store (a map, see section Local Data Store).

7.3.1.7. boolean setValidation(ITA ta, boolean activate)

The TA tells the UCH to do validation for the TA or not. Validation means that the UCH will filter out requests for setting variable values, inserting or removing indices, invoking commands, and acknowledging notifications, based on type and dependency information from the socket description. See section Map setValuesRequest(string sessionId, string[] paths, string[] operations, string[] reqValues), setValuesRequest().

NOTE: A UCH implementation may or may not support validation. If it doesn't support validation, it shall always return false.

NOTE: By default, the UCH should not do validation.

7.3.1.8. string getIpAddress()

Get the IP address of the UCH. A TA may need this information to set up its own listener for a port that is not serviced by the UCH.

7.3.1.9. string startUriService(ITA ta, string scheme, int port, boolean portIsFlexible, string basePath, boolean basePathIsFlexible, Map[] contexts) throws UCHException

The TA requests the UCH to start servicing a URI which is made up of a given scheme, port, and base path. If successful, the UCH will forward all messages that have this URI as its base, to targetRequest(). If the TA indicates that the base path is flexible, the UCH can modify the base path in case it is not available any more.

7.3.1.10. void addUriServiceContexts(string uri, Map[] contexts) throws UCHException

This function is called when the TA wants to add one or more contexts to a URI service.

7.3.1.11. void removeUriServiceContexts(string uri, Map[] contexts) throws UCHException

This function is called when the TA wants to remove one or more contexts from a URI service.

7.3.1.12. void stopUriService(string uri) throws UCHException

The TA requests the UCH to stop servicing a URI that was requested to be serviced in a previous call to startUriService().

7.3.1.13. Map[][] getResources(string sessionId, Map[] resProps)

Same as function IUIPMListener.getResources(), see section Map[] getResources(string sessionId, Map[] resProps).

7.3.1.14. string getDocument(string uri, string postData, Map context) throws UCHException

Same as function IUIPMListener.getDocument(), see section getDocument().

7.3.1.15. Map getUCHProps()

Get property map of the UCH.

7.3.1.16. boolean isImplemented(string functionName)

This function allows the TA to check whether any of the optional functions are implemented by the TAListener.

7.3.2. Optional Functions

7.3.2.1. void removeTA(ITA ta)

The TA requests the UCH to be finalized and unloaded. TAs should call this function if they cannot operate anymore because of external events or other reasons.

The UCH may follow this request. In any case, the UCH shall call finalize() on the TA before it unloads the TA.

8. Control Flows

For simplicity, the sequence diagrams below assume synchronous function execution. This does not imply that the specification mandates synchronous function execution. This is implementation-specific.

8.1. Target Discovery

Sequence diagram for target discovery

Figure: Sequence diagram for target discovery (description of figure) - TODO: update description to reflect personalization

8.2. Session Management

Sequence diagram for session management

Figure: Sequence diagram for session management (description of figure) - TODO: update description to reflect personalization

8.3. Session Forwarding

Sequence diagram for session forwarding

Figure: Sequence diagram for session forwarding (description of figure)

8.4. Target Aborts Session

Sequence diagram for target aborting session

Figure: Sequence diagram for target aborting session (description of figure)

8.5. Open Session Activities

Sequence diagram for open session acitivites

Figure: Sequence diagram for open session acitivites (description of figure)

9. Discovery of the UCH

This section specifies how a controller discovers a UCH in a network.

This discovery mechanism applies for remote user interfaces that can be identified through a URI that is resolvable in a local network context. UIPMs may use other mechanisms to make themselves discoverable to controllers, but this is out of the scope of this specification.

NOTE: There may be multiple control hubs in a local network. It is up to the controller how to offer an integrated view, consisting of multiple UCHs and their offered control interfaces to the user.

9.1. UPnP RUI Server

The mechanism defined in this section is based on [UPnP RUI] and [CEA-2014], and uses target instances as a top-level structuring mechanism of available user interfaces in a local network.

A UCH shall expose itself as a Remote User Interface Server [CEA-2014] in a local network, through one of the following mechanisms:

NOTE: See [CEA-2014] for details on how the UIList document (XML block) can be retrieved from an RUI Server.

The <presentationURL> element in the UPnP Device Description should contain a local URI serving an HTML portal page that lets the user pick a remote user interface or otherwise start a control session with the UCH.

A UCH may opt to use HTTP code 301 (Moved Permanently) for one of the HTTP or HTTPS requests to redirect the client to the other protocol. In this case, the RUI Client may automatically redirect the request.

9.2. Discovery via Bonjour

A UCH may use Bonjour [Bonjour] to advertise itself within a local network. If so, the UCH shall try to register itself under the mDNS name "UCH.local.". If this name is not available it shall try "UCH1.local.", then "UCH2.local.", and so forth.

NOTE: In a Bonjour network containing one UCH, a client can usually open a user context on this UCH via http://UCH.local./UCH/openUserContext, and retrieve the UIList from http://UCH.local./UCH/getCompatibleUIs. However, if there are additional UCHs available in a network, these are reachable at http://UCH1.local., http://UCH2.local., etc.

10. User Context Management

A controller may open and close a user context with the UCH. In this case, any interaction between the controller and the UCH that takes place in time between a successful open user context and a close user context request shall be attributed with one specific user context.

If the controller does not open a user context with the UCH, any interaction between the two shall be attributed to a user context with an anonymous user.

Currently, there is only one mechanism defined for controllers to open and close a user context via HTTP or HTTPS, and via cookies. Future versions of this standard may add other mechanisms, using HTTP, HTTPS or other protocols.

10.1. Open User Context Request

A controller may request to open a user context by sending an HTTP or HTTPS GET request [RFC 2616] to the UCH, using the following path: "/UCH/openUserContext". The request may include user credentials as content of the Authorization request-header field, as specified for the Basic Authentication Scheme [RFC 2617]. If the request does not include user credentials, the UCH shall return an authentication challenge, as specified for the Basic Authentication Scheme [RFC 2617].

The UCH shall support a "forward to" parameter (as part of the open user context request) that instructs the UCH to forward the client to a specified URI, after successful completion of opening a user context. If the controller has already opened a user context with the UCH, the UCH shall immediately forward the client to the "forward to" URI. Forwarding is indicated by HTTP return code 302 Found (see below).

The "forward to" option has the following syntax:

   http://host/UCH/openUserContext?forwardto=forwardURI

Whereby:

Example: A client requests opening a user context from the UCH with an IP address of 192.168.0.1, and wants to be forwarded to http://192.168.0.1/UCH/MyUIPM/start.html:

   http://192.168.0.1/UCH/openUserContext?forwardto=http%3A%2F%2F192.168.0.1%2FUCH%2FMyUIPM%2Fstart.html

Upon receipt of the user credentials, the UCH shall respond in one of the following ways:

The UCH may request the controller to use cookies [RFC 2965] for managing HTTP state. In this case, the controller shall send cookie information as part of every subsequent HTTP interaction.

The UCH shall keep its installed components (UIPMs, TDMs, TAs) informed about newly opened contexts.

10.2. Update User Context Request

TODO

10.3. Close User Context Request

A controller may close an existing user context by sending an HTTP or HTTPS GET request [RFC 2616] to the UCH, using the following path: "/UCH/closeUserContext". The UCH shall respond by returning HTTP code 200 OK. The HTTP response body should contain an HTML document indicating to the user that the logout was successful.

The UCH shall keep its installed components (UIPMs, TDMs, TAs) informed about closed contexts.

10.4. User Context Expiration

The UCH may expire an existing user context if it has no session with a socket, and if there has been no other request (including open user context request) from the controller for some time (implementation-specific).

A UCH should handle a request that belongs to an expired user context in one of the following ways:

The UCH shall keep its installed components (UIPMs, TDMs, TAs) informed about expired contexts.

11. Discovery of Remote User Interfaces

This section specifies how a controller discovers available remote user interfaces implemented by UIPMs (as exposed in the UIList).

11.1. UIList

The UIList shall consist of user interfaces and their URIs, as advertised by the UIPMs through the addCompatibleUI() function (see section addCompatibleUI), in any order, as follows:

<uilist xmlns="urn:schemas-upnp-org:remoteui:uilist-1-0">
  <ui>
    <uiID>targetId </uiID>
    <name>targetFriendlyName </name>
    <protocol shortName="protocolShortName">
      <uri>remoteControlUri </uri>
      <protocolInfo>
        <uipmClientName friendlyName="uipm client name" desc="uipm client description"> uipmClientName </uipmClientName>

        <targetName>targetName </targetName>
        <socketName friendlyName="socketFriendlyName">socketName </socketName>

TODO: Add information as provided by resource properties.

        ... other protocolInfo subelements specific to protocolShortName ...
      </protocolInfo>
    </protocol>
  </ui>
</uilist>

Whereby:

NOTE: [UPnP RUI] uses the concepts of "remote user interfaces" and "applications" in equivalent ways. In a UCH environment, target instances can be construed as "applications". However, one target instance ("application") may have multiple sockets which can be individually accessed and controlled. Still, the target instance is a reasonable parameter for top-level structuring of the UIList. But controllers should not assume that all <protocol> elements underneath a <ui> element are representing equivalent user interfaces.

NOTE: As in all XML documents, leading and trailing whitespaces in element content will get lost if not properly escaped. In particular, leading and trailing spaces, occurring in target identifiers and target friendly names, shall be encoded as '&#x20;'.

EXAMPLE: The following UIList exposes an "all-in-one" control application, and specific control applications for an "AV System" and a "Telephone". All applications provide the "HTTP/HTML" UI protocol. In addition, "AV System" and "Telephone" provide access through the "URC-HTTP" UI protocol . See [URC-HTTP] for details on the format of the <protocolInfo> subelement of <protocol shortName="URC-HTTP">. Note that some URIs have been split into two lines for presentation purposes they need to be in one line in the actual UIList document.

<uilist xmlns="urn:schemas-upnp-org:remoteui:uilist-1-0">
  <ui>
    <uiID> all </uiID>
    <name> All targets </name>
    <protocol shortName="HTTP/HTML">
      <uri>http://192.168.0.10/UCH/all/html</uri>
      <protocolInfo>
        <uipmClientName> http://res.myurc.org/uipm-client/webclient </uipmClientName>
        <targetName> all </targetName>
      </protocolInfo>
    </protocol>
  </ui>
  <ui>
    <uiID> ABC001</uiID>
    <name>AV System </name>
    <protocol shortName="URC-HTTP">
      <uri> http://192.168.0.10/UCH/av/urc-http/play?ABC001 </uri>
      <protocolInfo>
        <targetName> http://res.myurc.org/upnp/av </targetName>
        <socketName> http://res.myurc.org/upnp/av/play-1.uis </socketName>
        <socketDescriptionAt> http://res.myurc.org/upnp/av/play-1.uis </socketDescriptionAt>
        <targetDescriptionAt> http://res.myurc.org/upnp/av/entertainment.td </targetDescriptionAt>
        <conformsTo> http://myurc.org/TR/urc-http-protocol-20080627 </conformsTo>
      </protocolInfo>
    </protocol>
    <protocol shortName="HTTP/HTML">
      <uri>http://192.168.0.10/UCH/av/html?http%3A%2F%2F192.168.0.10%2FUCH%2Fav%2Furc-http%2Fplay%3FABC001 </uri>
      <protocolInfo>
        <uipmClientName> http://res.myurc.org/upnp/av/uipm-client/DragIt </uipmClientName>
        <targetName> http://res.myurc.org/upnp/av</targetName>
        <socketName>http://res.myurc.org/upnp/av/play-1.uis</socketName>
      </protocolInfo>
    </protocol>
  </ui>
  <ui>
    <uiID> RRR0001</uiID>
    <name>Telephone</name>
    <description>Landline-based phone system.</description>
    <lifetime>60</lifetime>
    <protocol shortName="URC-HTTP">
      <uri> http://192.168.0.10/UCH/phone/urc-http?RRR0001 </uri>
      <protocolInfo>
        <targetName> http://res.myurc.org/anymodel/phone </targetName>
        <socketName> http://res.myurc.org/anymodel/phone.uis </socketName>
        <socketDescriptionAt> http://res.myurc.org/anymodel/phone.uis </socketDescriptionAt>
        <targetDescriptionAt> http://res.myurc.org/anymodel/phone.td </targetDescriptionAt>
        <conformsTo> http://myurc.org/TR/urc-http-protocol-20080627 </conformsTo>
      </protocolInfo>
    </protocol>
    <protocol shortName="HTTP/HTML">
      <uri> http://192.168.0.10/UCH/phone/html?http%3A%2F%2F192.168.0.10%2FUCH%2Fphone%2Furc-http%3FRRR0001 </uri>
      <protocolInfo>
        <targetName> http://res.myurc.org/anymodel/phone </targetName>
        <socketName> http://res.myurc.org/anymodel/phone.uis </socketName>
      </protocolInfo>
    </protocol>
  </ui>
</uilist>

11.2. 'shortName' Attribute

Based on the information from the installed TAs, a UCH shall identify the user interface protocols it exposes through its TAs, as attribute values of the 'shortName' attribute of the <protocol> elements. The following table summarizes the short names for UI protocols, as defined by [UPnP RUI] and [CEA-2014]. Other UI protocols (and corresponding shortNames) may be defined by other standards, thus extending this document.

shortName

URI scheme

Description

Comment

HTTP/HTML

HTTP:

The application supports remoting with HTML using HTTP as transport.

From [UPnP RUI]

RDP

RDP:

The application supports remoting with Microsoft RDP protocol.

From [UPnP RUI]

VNC

VNC:

The application supports remoting with AT&T VNC protocol.

From [UPnP RUI]

XRT2

The application supports remoting with Intel XRT2 protocol.

From [UPnP RUI]

LRDP

The application supports remoting with Nokias' LRDP protocol.

From [UPnP RUI]

XHT

The application supports remoting with Samsungs' XHT protocol.

From [UPnP RUI]

SGXML

The application supports remoting with Siemens' Gigaset XML protocol.

From [UPnP RUI]

UIF

The application supports remoting with Philips UI Fragments protocol.

From [UPnP RUI]

(Vendor-specific protocol name)

(Specified by UPnP vendor.)

From [UPnP RUI]

CE-HTML-1.0

HTTP:
HTTPS:

CE-HTML (extension of HTML), as defined in [CEA-2014]

The requirement from [CEA-2014] that there shall be at least one CE-HTML protocol per UI is not required for a UCH.

URC-HTTP

HTTP:
HTTPS:

URC-HTTP protocol

See [URC-HTTP] for details on how to implement the URC-HTTP protocol.

XRT

XRT:
XRTS:

XRT Self-Contained Remoting Protocol

Replaces "XRT2" from [UPnP RUI].

11.3. User-Preferred Language

The UCH should respect the user's language preferences when responding to a request for the UIList. The user's language preferences are part of the user profile (if known), or otherwise specified in the HTTP request header "Accept-Language".

12. UCH Control Commands

The UCH can be remotely controlled via HTTP requests as specified in this section.

12.1. Clear Cache Control

A client can request the UCH to clear its resource cache with the following HTTP or HTTPS GET requests to port 80:

/UCH/config?action=clearcache&type=restype

Whereby:

Examples:

The UCH shall respond to a 'clear cache' request, in any of the following ways:

13. References

13.1. Normative References

The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

[Bonjour]
Apple Developer Connection. Networking Bonjour. http://developer.apple.com/networking/bonjour/index.html
[CEA-2014]
CEA-2014-A: Web-based Protocol and Framework for Remote User Interface on UPnP Networks and the Internet (Web4CE). P. Shrubsole, W. Dees, 2007.
[DCMI Metadata Terms]
Dublin Core Metadata Initiative MetadataTerms. Available at: http://dublincore.org/documents/dcmi-terms/.
[ISO/IEC 8601:2004]
Data elements and interchange formats - Information interchange - Representation of dates and times. International Standard, 2004.
[ISO/IEC 24752-1:2008]
Information Technology User Interfaces Universal Remote Console. Part 1: Framework. ISO, 2008.
[ISO/IEC 24752-2:2008]
Information Technology User Interfaces Universal Remote Console. Part 2: User Interface Socket Description. ISO, 2008.
[ISO/IEC 24752-4:2008]
Information Technology User Interfaces Universal Remote Console. Part 4: Target Description. ISO, 2008.
[ISO/IEC 24752-5:2008]
Information Technology User Interfaces Universal Remote Console. Part 5: Resource Description. ISO, 2008.
[Java Servlet API]
Servlet API Documentation (version 2.5 or later). Apache Software Foundation. http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html
[RES-PROP-VOCAB]
URC Consortium: Resource Property Vocabulary. Latest version available at: http://myurc.org/TR/res-prop-vocab/.
[RFC 2119]
RFC 2119: Key words for use in RFCs to Indicate Requirement Levels. S. Bradner, March 1997. Available at: http://www.ietf.org/rfc/rfc2119.txt.
[RFC 2616]
RFC 2616: Hypertext Transfer Protocol HTTP/1.1. R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, T. Berners-Lee, 1999. Available at: http://www.ietf.org/rfc/rfc2616.txt.
[RFC 2617]
RFC 2617: HTTP Authentication: Basic and Digest Access Authentication. June 1999. Available at: http://www.ietf.org/rfc/rfc2617.txt.
[RFC 2965]
RFC 2965: HTTP State Management Mechanism. October 2000. Available at: http://www.ietf.org/rfc/rfc2965.txt.
[RFC 3986]
IETF RFC 3986, Uniform Resource Identifier (URI): Generic Syntax, January 2005, http://www.ietf.org/rfc/rfc3986.txt.
[UPnP RUI]
UPnP Remote UI Client and Server V1.0 Standardized DCPs:
RemoteUIClientDevice V1.0. Y. Saint-Hilaire, M. Walker, K. B. Min, 2004. Available at: http://www.upnp.org/standardizeddcps/documents/RemoteUIClientDevice1.0.pdf.
RemoteUIClientService V1.0. Y. Saint-Hilaire, M. Walker, J. van Ee, 2004. Available at: http://www.upnp.org/standardizeddcps/documents/RemoteUIClientService1.0.pdf.
RemoteUIServerDevice V1.0. M. Walker, K. B. Min, 2004. Available at: http://www.upnp.org/standardizeddcps/documents/RemoteUIServerDevice1.0.pdf.
RemoteUIServerService V1.0. J. van Ee, M. Walker, 2004. Available at: http://www.upnp.org/standardizeddcps/documents/RemoteUIServerService1.0.pdf.

13.2. Informative References

[IDL]
Information technology - Open Distributed Processing - Interface Definition Language. ISO/IEC 14750:1999, available (for purchase) at http://www.iso.org. Alternative document, "IDL Syntax & Semantics", available (freely) as chapter 3 of the CORBA specification, at http://www.omg.org/technology/documents/formal/corba_2.htm.
[UCH 2005]
Universal Control Hub & Pluggable User Interfaces. Jan. 2005. http://myurc.org/publications/2005-Univ-Ctrl-Hub.php
[UCH 2006]
Universal Control Hub & Task-Based User Interfaces. Jan. 2006. http://myurc.org/publications/2006-Univ-Ctrl-Hub.php
[URC-HTTP]
URC-HTTP Protocol. Latest specification available at: http://myurc.org/TR/urc-http-protocol/

14. Acknowledgments

Work on this document has been funded in part by the National Institute on Disability and Rehabilitation Research, US Dept of Education under Grant H133E030012 as part of the Universal Interface and Information Technology Access Rehabilitation Engineering Research Center of the University of Wisconsin -Trace Center. The content of this document does not necessarily reflect the views or policies of the U.S. Department of Education, nor does mention of trade names, commercial products, or organizations imply endorsement by the U.S. Government.

Work on this document has been funded in part by the EU 6th Framework Program under grant FP6-033502 (project i2home). The content of this document does not necessarily reflect the views or policies of the European Commission, nor does mention of trade names, commercial products, or organizations imply endorsement by the European Commission.

The following persons have contributed to the content of this document:

15. Appendix: Platform-Specific APIs (normative)

This appendix contains references to platform-specific specifications of the abstract API definitions in this document. A UCH or UCH component shall implement the required APIs exactly as specified in this appendix for the corresponding platform.

15.1. Java Interfaces

The following interfaces are defined in the package org.myurc.uch. Java implementations shall use them unmodified.

A zip file with all Java interface specifications is available.

15.2. C/C++ APIs

The following C/C++ header files are defined in the namespace UCH. C/C++ implementations shall use them unmodified.

A zip file with all C/C++ header files is available.

15.3. C# APIs

The following C# interfaces and exception classes are defined in the namespaces org.myurc.uch.Interfaces and org.myurc.uch.Exceptions. C# implementations shall use them (or their binary form as DLL files) without modification.

A RAR file with all binary C# interface specifications (DLL files) is available. Also, a zip file with some UCH utility classes (sources) is available.

16. Appendix: Security Analysis

This section provides an analysis of the specified system from a security and privacy perspective.

16.1. System Description

See section Overview for a description of the UCH components.

See section Personalization for an overview of how user and controller data is distributed within the system.

For security purposes, the system consists of trusted and untrusted components. Only internal components that cannot be downloaded are trusted, everything else is untrusted.

Trusted and untrusted components

Figure: Trusted and untrusted components in the UCH architecture, and types of information stored and transmitted.

16.2. The Security Problem

This section describes security-critical information, and how this could be exploited by attacks.

16.2.1. Assets

The following assets are related to data processed (stored, transmitted) in the UCH system.

16.2.2. Threats

16.2.3. Environment, Organizational Policies

16.3. Security Objectives

16.4. Security Policy

16.4.1. Roles and Identities

16.4.2. Resources

16.4.3. Rules

16.5. Requirements

This site is maintained by the University of Wisconsin Trace Center, a member of the Universal Remote Console Consortium.