Infinityd.Storage

g GObject.GInterface GObject.GInterface Infinityd.Storage Infinityd.Storage GObject.GInterface->Infinityd.Storage

Implementations:

Infinityd.FilesystemStorage

Methods

create_subdirectory (path)

read_acl (path)

read_subdirectory (path)

remove_node (identifier, path)

write_acl (path, sheet_set)

Virtual Methods

do_create_subdirectory (path)

do_read_acl (path)

do_read_subdirectory (path)

do_remove_node (identifier, path)

do_write_acl (path, sheet_set)

Properties

None

Signals

None

Fields

None

Class Details

class Infinityd.Storage
Bases:

GObject.GInterface

Structure:

Infinityd.StorageInterface

create_subdirectory(path)
Parameters:

path (str) – A path pointing to non-existing node.

Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Creates a new subdirectory at the given path that is initially empty.

read_acl(path)
Parameters:

path (str) – A path pointing to an existing node.

Raises:

GLib.Error

Returns:

A possibly empty list of Infinityd.StorageAcl objects. Free with Infinityd.StorageAcl.list_free() when no longer needed.

Return type:

[Infinityd.StorageAcl] or None

Reads the ACL for the node at the path path from the storage. It returns a list of Infinityd.StorageAcl objects.

read_subdirectory(path)
Parameters:

path (str) – A path pointing to a subdirectory node.

Raises:

GLib.Error

Returns:

A GLib.SList that contains Infinityd.StorageNode objects, or None if either the subdirectory is empty or an error occurred.

Return type:

[Infinityd.StorageNode] or None

Reads a subdirectory from the storage. Returns a list of Infinityd.StorageNode objects. Both the list and the objects need to be freed by the caller via Infinityd.StorageNode.list_free().

remove_node(identifier, path)
Parameters:
  • identifier (str) – The type of the node to remove, or None to remove a subdirectory (TODO: This shouldn’t be necessary).

  • path (str) – A path pointing to an existing node.

Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Removes the node at path from storage. If it is a subdirectory node, all containing nodes and subdirectory nodes are removed recursively.

write_acl(path, sheet_set)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False on error.

Return type:

bool

Writes the ACL defined by sheet_set into storage. If sheet_set is None this is equivalent to an empty set. Returns True on success or False on error. If the function fails, error is set.

do_create_subdirectory(path) virtual
Parameters:

path (str) – A path pointing to non-existing node.

Returns:

True on success.

Return type:

bool

Creates a new subdirectory at the given path that is initially empty.

do_read_acl(path) virtual
Parameters:

path (str) – A path pointing to an existing node.

Returns:

A possibly empty list of Infinityd.StorageAcl objects. Free with Infinityd.StorageAcl.list_free() when no longer needed.

Return type:

[Infinityd.StorageAcl] or None

Reads the ACL for the node at the path path from the storage. It returns a list of Infinityd.StorageAcl objects.

do_read_subdirectory(path) virtual
Parameters:

path (str) – A path pointing to a subdirectory node.

Returns:

A GLib.SList that contains Infinityd.StorageNode objects, or None if either the subdirectory is empty or an error occurred.

Return type:

[Infinityd.StorageNode] or None

Reads a subdirectory from the storage. Returns a list of Infinityd.StorageNode objects. Both the list and the objects need to be freed by the caller via Infinityd.StorageNode.list_free().

do_remove_node(identifier, path) virtual
Parameters:
  • identifier (str) – The type of the node to remove, or None to remove a subdirectory (TODO: This shouldn’t be necessary).

  • path (str) – A path pointing to an existing node.

Returns:

True on success.

Return type:

bool

Removes the node at path from storage. If it is a subdirectory node, all containing nodes and subdirectory nodes are removed recursively.

do_write_acl(path, sheet_set) virtual
Parameters:
Returns:

True on success or False on error.

Return type:

bool

Writes the ACL defined by sheet_set into storage. If sheet_set is None this is equivalent to an empty set. Returns True on success or False on error. If the function fails, error is set.