#include <support/CatalogMirror.h>
Inheritance diagram for BCatalogMirror:
A CatalogMirror is a combination of ICatalogPermissions and ICatalog. When placed in the namespace, clients can access the mirror as if they are accessing the catalog itself. Except that the mirror can have restrictions, and items hidden or overlayed.
When you create an CatalogMirror, you must give it the ICatalog to mirror. Do that with either @{catalog -> icatalog_binder}
or @{catalog_path -> /catalog_path}
.
virtual status_t | AddEntry (const SString &name, const SValue &entry) |
Add or modify an entry in the catalog. | |
virtual sptr< INode > | Attributes () const |
Retrieve the meta-data catalog associated with this node, or NULL if it doesn't exist. | |
BCatalogMirror (const SContext &context, const SValue &args) | |
BCatalogMirror constructor - takes "catalog" or "catalog_path". | |
virtual sptr< IDatum > | CreateDatum (SString *name, uint32_t flags, status_t *err) |
Create a new IDatum object inside of this catalog. | |
virtual sptr< INode > | CreateNode (SString *name, status_t *err) |
Create a new INode in this catalog. | |
virtual nsecs_t | CreationDate () const |
Retrieve the "creationDate" meta-data entry, or 0 of it doesn't exist. | |
virtual status_t | HideEntry (const SString &name) |
Hide an entry from the original catalog. | |
virtual SValue | Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags) |
Probe binder for interface information. | |
virtual status_t | Link (const sptr< IBinder > &target, const SValue &bindings, uint32_t flags) |
Link registers the IBinder "target" for notification of events. | |
virtual status_t | Merge (const sptr< ICatalog > &catalog) |
virtual SString | MimeType () const |
Retrieve the "mimeType" meta-data entry, or "" if it doesn't exist. | |
virtual nsecs_t | ModifiedDate () const |
Retrieve the "modifiedDate" meta-data entry, or 0 of it doesn't exist. | |
virtual sptr< IIterator > | NewIterator (const SValue &args, status_t *error=NULL) |
Walk through the namespace based on the given path. | |
virtual void | Observed (const SValue &key, const SValue &value) |
Override this to receive observed events. | |
virtual status_t | OverlayEntry (const SString &location, const SValue &item) |
Overlay an entry in the original catalog. | |
virtual status_t | RemoveEntry (const SString &name) |
Remove an existing entry from the catalog. | |
virtual status_t | RenameEntry (const SString &entry, const SString &name) |
Change the name of an entry in the catalog. | |
virtual status_t | RestoreEntry (const SString &location) |
Restore an entry that was previously replaced. | |
virtual void | SetCreationDate (nsecs_t value) |
Retrieve the "creationDate" meta-data entry, or 0 of it doesn't exist. | |
virtual void | SetMimeType (const SString &value) |
Retrieve the "mimeType" meta-data entry, or "" if it doesn't exist. | |
virtual void | SetModifiedDate (nsecs_t value) |
Retrieve the "modifiedDate" meta-data entry, or 0 of it doesn't exist. | |
virtual void | SetWritable (bool value) |
virtual status_t | ShowEntry (const SString &name) |
Show an entry that was previously hidden. | |
virtual status_t | Unlink (const wptr< IBinder > &target, const SValue &bindings, uint32_t flags) |
Remove a mapping previously added by Link(). | |
virtual status_t | Walk (SString *path, uint32_t flags, SValue *node) |
Walk through the namespace based on the given path. | |
virtual bool | Writable () const |
virtual | ~BCatalogMirror () |
Friends | |
class | IteratorWrapper |
|
BCatalogMirror constructor - takes "catalog" or "catalog_path". BCatalogMirror can be given: catalog->ICatalog} catalog_path->SString} The ICatalog is the catalogectory that we will be mirroring |
|
|
|
Add or modify an entry in the catalog.
The second reason for using this API is to add new types of objects to the catalog – if the SValue contains an IBinder object, the given object will be directly added as the new entry. This latter approach allows you to create places where the namespace crosses processes, mount new types of directories in the namespace, etc. Note, however, that many catalogs (such as one representing a filesystem) will not be able to host references to external objects. Contrast this with CreateNode() and CreateDatum(), which creates new entry objects that are owned and managed by the catalog.
Implements ICatalog. |
|
Retrieve the meta-data catalog associated with this node, or NULL if it doesn't exist. The INode interface also supplies access to meta-data associated with the object. The "attributes" read-only property provides direct access to the meta-data node, which is a pointer to another separate INode holding the meta-data. A node may not support meta-data, in which case the attributes property will return NULL. You will not usually use this property directly, instead using the mimeType, creationDate, and modifiedDate properties to read/write the standard attributes. Also see Walk() for how you can retrieve these and other attributes through the normal path traversal mechanism. Implements INode. |
|
Create a new IDatum object inside of this catalog.
Note that the returned object may very well support other interfaces (including INode), however its main purpose is to hold data for you. Implements ICatalog. |
|
Create a new INode in this catalog.
This, along with CreateDatum(), is the mechanism you should normally use when entries in a particular catalog, because they allow the catalog to ensure that objects with the correct implementation are created. For example, if the catalog is on a filesystem, it will need to modify the filesystem data to hold the new structure and create and return a proxy object for the new entry it just created. Even in a generic catalog the use of this function is important, since it ensures objects are created in the same process as the parent directory. Consider, for example, an application that wishes to create a node with some data that will stay around after the application itself exits. Contrast this with AddEntry(), which if called with an IBinder object will place a reference to that object in the catalog. Implements ICatalog. |
|
Retrieve the "creationDate" meta-data entry, or 0 of it doesn't exist.
Implements INode. |
|
Hide an entry from the original catalog.
Implements ICatalogPermissions. |
|
Probe binder for interface information. Return interfaces implemented by this binder object that are requested by which. This is a composition of all interfaces, expressed as { descriptor -> binder } mappings, which are selected through which. Much more information on Inspect() can be found at Binder Inspect() Details. Reimplemented from BnCatalog. |
|
Link registers the IBinder "target" for notification of events. The bindings is a mapping of keys that will get pushed on this IBinder, to keys that will get pushed on the "target" IBinder. e.g.
Reimplemented from BBinder. |
|
Implements ICatalogPermissions. |
|
Retrieve the "mimeType" meta-data entry, or "" if it doesn't exist.
Implements INode. |
|
Retrieve the "modifiedDate" meta-data entry, or 0 of it doesn't exist.
Implements INode. |
|
Walk through the namespace based on the given path.
Clients should usually use SIterator instead of calling NewIterator() directly. The options parameter is used to control what data is returned by the iterator. The available options are fairly implementation-dependent, but some common ones are described here. Because you can not know what any given IIterable object will be able to do, the IIterator interface you get back has a read-only options property with which you can find out how it is configured. Any of the options supplied to IIterate() that it understands will be propagated to the options property in the form it understood them.
See Binder Data Model for more detail on these options.
Implements IIterable. |
|
Override this to receive observed events.
Implements BObserver. |
|
Overlay an entry in the original catalog. Overlay an entry in the original catalog with the replacement. Implements ICatalogPermissions. |
|
Remove an existing entry from the catalog.
Implements ICatalog. |
|
Change the name of an entry in the catalog.
Implements ICatalog. |
|
Restore an entry that was previously replaced.
Implements ICatalogPermissions. |
|
Retrieve the "creationDate" meta-data entry, or 0 of it doesn't exist.
Implements INode. |
|
Retrieve the "mimeType" meta-data entry, or "" if it doesn't exist.
Implements INode. |
|
Retrieve the "modifiedDate" meta-data entry, or 0 of it doesn't exist.
Implements INode. |
|
Implements ICatalogPermissions. |
|
Show an entry that was previously hidden.
Implements ICatalogPermissions. |
|
Remove a mapping previously added by Link().
Reimplemented from BBinder. |
|
Walk through the namespace based on the given path.
If the node supports attributes then the Walk() method will allow you to traverse directly to them. This is accomplished by reserving path names whose first character is ":" to indicate that the name is part of the attribute namespace. Thus a Walk() of just the path ":" will return the attributes catalog (and continue walking into it if needed); for a name with ':' as a prefix and additional text the node strips off the ':' and then calls Walk() on the attributes catalog with the remaining text. Clients will generally not call Walk() directly, instead relying on SNode::Walk(). The latter hides a lot of the complexity of INode::Walk() that we will discuss later. The flags parameter allows you to control how the namespace walks your supplied path. These allow you to request optimizations to how INode returns its result (REQUEST_DATA, COLLAPSE_NODE), and what it should do if segments of the path don't exist (CREATE_DATUM, CREATE_NODE). The REQUEST_DATA and COLLAPSE_NODE flags are optimization hints that allow you to bypass the "everything is an object" property of the namespace in certain situations. An INode is not required to honor these requests (and indeed may be entirely unable to do so), so when using them it is the client's responsibility to deal with such a failure.
You can combine REQUEST_DATA and COLLAPSE_NODE to ask for the final node to return an SValue mapping, where each value is actually data. If you use COLLAPSE_NODE without REQUEST_DATA, you will receive SValue mappings where the values are IDatum objects.
Implements INode. |
|
Implements ICatalogPermissions. |
|
|