<dataType>ui4</dataType>
</stateVariable>
-<!-- Optional state variables that are not implemented yet
<stateVariable>
<Optional/>
- <name>SortExtensionCapabilities</name>
- <sendEventsAttribute>no</sendEventsAttribute>
+ <name>TransferIDs</name>
+ <sendEventsAttribute>yes</sendEventsAttribute>
<dataType>string</dataType>
</stateVariable>
+<!-- Optional state variables that are not implemented yet
<stateVariable>
<Optional/>
- <name>TransferIDs</name>
- <sendEventsAttribute>yes</sendEventsAttribute>
+ <name>SortExtensionCapabilities</name>
+ <sendEventsAttribute>no</sendEventsAttribute>
<dataType>string</dataType>
</stateVariable>
this.action_invoked["CreateObject"] += this.create_object_cb;
this.action_invoked["ImportResource"] += this.import_resource_cb;
+ this.query_variable["TransferIDs"] += this.query_transfer_ids;
+
/* Connect SystemUpdateID related signals */
this.action_invoked["GetSystemUpdateID"] +=
this.get_system_update_id_cb;
this.active_imports.add (import);
import.run.begin ();
+
+ this.notify ("TransferIDs",
+ typeof (string),
+ this.create_transfer_ids ());
}
private void on_import_completed (ImportResource import) {
+ this.notify ("TransferIDs",
+ typeof (string),
+ this.create_transfer_ids ());
+
// According to CDS specs (v3 section 2.4.17), we must not immediately
// remove the import from out memory
Timeout.add_seconds (30, () => {
});
}
+ /* Query TransferIDs */
+ private void query_transfer_ids (ContentDirectory content_dir,
+ string variable,
+ ref GLib.Value value) {
+ value.init (typeof (string));
+ value.set_string (this.create_transfer_ids ());
+ }
+
/* GetSystemUpdateID action implementation */
private void get_system_update_id_cb (ContentDirectory content_dir,
owned ServiceAction action) {
return false;
}
+
+ private string create_transfer_ids () {
+ var ids = "";
+
+ foreach (var import in this.active_imports) {
+ if (!import.complete) {
+ if (ids != "") {
+ ids += ",";
+ }
+
+ ids += import.transfer_id.to_string ();
+ }
+ }
+
+ return ids;
+ }
}