Skip to content

data_service_i.py

ofrak.service.data_service_i

DataServiceInterface (AbstractOfrakService)

delete_node(self, data_id) async

Delete a node and re-arrange its children to the deleted node's parent.

Parameters:

Name Type Description Default
data_id bytes required

Returns:

Type Description
None
Source code in ofrak/service/data_service_i.py
@abstractmethod
async def delete_node(self, data_id: bytes) -> None:
    """
    Delete a node and re-arrange its children to the deleted node's parent.

    :param data_id:
    :return:
    """
    raise NotImplementedError()

merge_siblings(self, new_data_id, merging_data_ids) async

Merge the specified siblings into a new node, which has the same parent as the siblings and takes the children of the siblings.

Parameters:

Name Type Description Default
new_data_id bytes required
merging_data_ids Iterable[bytes] required

Returns:

Type Description
None
Source code in ofrak/service/data_service_i.py
@abstractmethod
async def merge_siblings(self, new_data_id: bytes, merging_data_ids: Iterable[bytes]) -> None:
    """
    Merge the specified siblings into a new node, which has the same parent as the siblings
    and takes the children of the siblings.

    :param new_data_id:
    :param merging_data_ids:
    :return:
    """
    raise NotImplementedError()

gather_siblings(self, new_data_id, gathering_data_ids) async

Create a new common parent for the specified data_ids. This common parent will be a child of the gathered nodes's existing common parent.

Parameters:

Name Type Description Default
new_data_id bytes required
gathering_data_ids Iterable[bytes] required

Returns:

Type Description
None
Source code in ofrak/service/data_service_i.py
@abstractmethod
async def gather_siblings(
    self, new_data_id: bytes, gathering_data_ids: Iterable[bytes]
) -> None:
    """
    Create a new common parent for the specified `data_id`s. This common parent will be a
    child of the gathered nodes's existing common parent.

    :param new_data_id:
    :param gathering_data_ids:
    :return:
    """
    raise NotImplementedError()

delete_tree(self, data_id) async

Delete a data node and all of its children.

Parameters:

Name Type Description Default
data_id bytes required

Returns:

Type Description
None
Source code in ofrak/service/data_service_i.py
@abstractmethod
async def delete_tree(self, data_id: bytes) -> None:
    """
    Delete a data node and all of its children.

    :param data_id:
    :return:
    """
    raise NotImplementedError()