__init__.py

This module provides standard interface for AMQP communication as it is defined and used by edeposit.amqp.

The interface consists of reactToAMQPMessage() function, which receives two parameters - structure and UUID. UUID is not much important, but structure is usually namedtuple containing information what should module do.

After the work is done, reactToAMQPMessage() returns a value, which is then automatically transfered back to caller. If the exception is raised, it is also transfered in open and easy to handle way.

edeposit.amqp.ftp

In this module, reactToAMQPMessage() is used only for receiving commands from the other side. Events caused by FTP users are handled by monitor.py.

Commands can create/change/remove users and so on. This is done by sending one of the following structures defined in structures.py:

Responses

AddUser, RemoveUser and ChangePassword requests at this moment returns just simple True. This may be changed later.

../_images/user_management.png

ListRegisteredUsers returns Userlist class.

../_images/list_registered_users.png

SetUserSettings and GetUserSettings both returns UserSettings structure.

../_images/set_get_settings.png

API

ftp.reactToAMQPMessage(message, UUID)[source]

React to given (AMQP) message. message is usually expected to be collections.namedtuple() structure filled with all necessary data.

Parameters:
  • message (.. class) – TODO: ..
  • UUID (str) – unique ID of received message
Returns:

response TODO: comment when the protocol will be ready

Raises:

ValueError – if bad type of message structure is given.

Table Of Contents

Previous topic

Monitor script

Next topic

Request parser

This Page