From 3d64302225781ad126d9b6a75273009bb6846ac7 Mon Sep 17 00:00:00 2001 From: Christophe Augier Date: Sun, 22 Jul 2012 22:18:39 +0200 Subject: Documentation: add Path Map service specification --- docs/TCF Service - Path Map.html | 285 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 docs/TCF Service - Path Map.html (limited to 'docs') diff --git a/docs/TCF Service - Path Map.html b/docs/TCF Service - Path Map.html new file mode 100644 index 000000000..6338ebaa8 --- /dev/null +++ b/docs/TCF Service - Path Map.html @@ -0,0 +1,285 @@ + + +
+Version + | Date + | Change + |
---|---|---|
0.0 + | 2012-07-22 + | Initial documentation based on source code + |
The service manages file path translation across systems. Command and event +parameters are encoded as zero terminated JSON strings.
+ +The service uses standard format for error reports, +see Error Report Format.
+ ++C • <token> • PathMap • get • ++ +
The command retrieves file path mapping rules.
+ +Reply:
+ ++R • <token> • <error report> • <array of path map rules> • + +<array of path map rules> + ⇒ null + ⇒ [ <path map rules list> ] + +<path map rules list> + ⇒ <object: path map rule> + ⇒ <path map rules list> , <object: path map rule> ++ +
Predefined path map rule properties are:
+"ID" : <string>
+ - ID of the rule.
+
+ "Source" : <string>
+ - source or compile time file path.
+
+ "Destination" : <string>
+ - destination or run-time file path.
+
+ "Context" : <string>
+ - symbols context group ID or name, deprecated - use ContextQuery.
+
+ "ContextQuery" : <string>
+ - context query.
+
+ "Host" : <string>
+ - host.
+
+ "Protocol" : <string>
+ - file access protocol, see predefined protocol values.
+
+ Predefined protocol values are:
+"file"
+ - Regular file access using system calls.
+
+ "host"
+ - File should be accessed using File System service on host.
+
+ "target"
+ - File should be accessed using File System service on target.
+ +C • <token> • PathMap • set • [ <path map rules list> ] • + +<path map rules list> + ⇒ <object: path map rule> + ⇒ <path map rules list> , <object: path map rule> ++ +
The command set file path mapping rules.
+ +Reply:
+ ++R • <token> • <error report> • ++ +
PathMap service broadcasts notification events when path mappings are changed.
+ ++E • PathMap • changed • ++ +
+/** + * IPathMap service manages file path translation across systems. + */ +public interface IPathMap extends IService { + + static final String NAME = "PathMap"; + + /** + * Path mapping rule property names. + */ + static final String + PROP_ID = "ID", /** String, rule ID */ + PROP_SOURCE = "Source", /** String, source, or compile-time file path */ + PROP_DESTINATION = "Destination", /** String, destination, or run-time file path */ + PROP_CONTEXT = "Context", /** String, symbols context group ID or name, deprecated - use ContextQuery */ + PROP_CONTEXT_QUERY = "ContextQuery", /** String, contexts query, see IContextQuery */ + PROP_HOST = "Host", /** String, */ + PROP_PROTOCOL = "Protocol"; /** String, file access protocol, see PROTOCOL_*, default is regular file */ + + /** + * PROP_PROTOCOL values. + */ + static final String + PROTOCOL_FILE = "file", /** Regular file access using system calls */ + PROTOCOL_HOST = "host", /** File should be accessed using File System service on host */ + PROTOCOL_TARGET = "target"; /** File should be accessed using File System service on target */ + + /** + * PathMapRule interface represents a single file path mapping rule. + */ + interface PathMapRule { + + /** + * Get rule properties. See PROP_* definitions for property names. + * Properties are read only, clients should not try to modify them. + * @return Map of rule properties. + */ + Map+ + + -- cgit v1.2.3getProperties(); + + /** + * Get rule unique ID. + * Same as getProperties().get(PROP_ID) + * @return rule ID. + */ + String getID(); + + /** + * Get compile-time file path. + * Same as getProperties().get(PROP_SOURCE) + * @return compile-time file path. + */ + String getSource(); + + /** + * Get run-time file path. + * Same as getProperties().get(PROP_DESTINATION) + * @return run-time file path. + */ + String getDestination(); + + /** + * Get host name of this rule. + * Same as getProperties().get(PROP_HOST) + * @return host name. + */ + String getHost(); + + /** + * Get file access protocol name. + * Same as getProperties().get(PROP_PROTOCOL) + * @return protocol name. + */ + String getProtocol(); + + /** + * Get context query that defines scope of the mapping rule, see also IContextQuery. + * Same as getProperties().get(PROP_CONTEXT_QUERY) + * @return context query expression, or null. + */ + String getContextQuery(); + } + + /** + * Retrieve file path mapping rules. + * + * @param done – call back interface called when operation is completed. + * @return – pending command handle. + */ + IToken get(DoneGet done); + + /** + * Client call back interface for get(). + */ + interface DoneGet { + /** + * Called when file path mapping retrieval is done. + * @param error – error description if operation failed, null if succeeded. + * @param map – file path mapping data. + */ + void doneGet(IToken token, Exception error, PathMapRule[] map); + } + + /** + * Set file path mapping rules. + * + * @param map – file path mapping rules. + * @param done – call back interface called when operation is completed. + * @return – pending command handle. + */ + IToken set(PathMapRule[] map, DoneSet done); + + /** + * Client call back interface for set(). + */ + interface DoneSet { + /** + * Called when file path mapping transmission is done. + * @param error – error description if operation failed, null if succeeded. + * @param map – memory map data. + */ + void doneSet(IToken token, Exception error); + } + + /** + * Add path map event listener. + * @param listener – path map event listener to add. + */ + void addListener(PathMapListener listener); + + /** + * Remove path map event listener. + * @param listener – path map event listener to remove. + */ + void removeListener(PathMapListener listener); + + /** + * Service events listener interface. + */ + interface PathMapListener { + + /** + * Called when path map changes. + */ + void changed(); + } +} +