Changeset View
Changeset View
Standalone View
Standalone View
src/server/handler.h
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 50 | public: | |||
---|---|---|---|---|---|
66 | void setCommand(const Protocol::CommandPtr &cmd); | 66 | void setCommand(const Protocol::CommandPtr &cmd); | ||
67 | Protocol::CommandPtr command() const; | 67 | Protocol::CommandPtr command() const; | ||
68 | 68 | | |||
69 | /** | 69 | /** | ||
70 | * Find a handler for a command that is always allowed, like LOGOUT. | 70 | * Find a handler for a command that is always allowed, like LOGOUT. | ||
71 | * @param cmd the command string | 71 | * @param cmd the command string | ||
72 | * @return an instance to the handler. The handler is deleted after @see handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine. | 72 | * @return an instance to the handler. The handler is deleted after @see handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine. | ||
73 | */ | 73 | */ | ||
74 | static Handler *findHandlerForCommandAlwaysAllowed(Protocol::Command::Type cmd); | 74 | static std::unique_ptr<Handler> findHandlerForCommandAlwaysAllowed(Protocol::Command::Type cmd); | ||
75 | 75 | | |||
76 | /** | 76 | /** | ||
77 | * Find a handler for a command that is allowed when the client is not yet authenticated, like LOGIN. | 77 | * Find a handler for a command that is allowed when the client is not yet authenticated, like LOGIN. | ||
78 | * @param cmd the command string | 78 | * @param cmd the command string | ||
79 | * @return an instance to the handler. The handler is deleted after @see handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine. | 79 | * @return an instance to the handler. The handler is deleted after @see handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine. | ||
80 | */ | 80 | */ | ||
81 | static Handler *findHandlerForCommandNonAuthenticated(Protocol::Command::Type cmd); | 81 | static std::unique_ptr<Handler> findHandlerForCommandNonAuthenticated(Protocol::Command::Type cmd); | ||
82 | 82 | | |||
83 | /** | 83 | /** | ||
84 | * Find a handler for a command that is allowed when the client is authenticated, like LIST, FETCH, etc. | 84 | * Find a handler for a command that is allowed when the client is authenticated, like LIST, FETCH, etc. | ||
85 | * @param cmd the command string | 85 | * @param cmd the command string | ||
86 | * @return an instance to the handler. The handler is deleted after @see handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine. | 86 | * @return an instance to the handler. The handler is deleted after @see handelLine is executed. The caller needs to delete the handler in case an exception is thrown from handelLine. | ||
87 | */ | 87 | */ | ||
88 | static Handler *findHandlerForCommandAuthenticated(Protocol::Command::Type cmd); | 88 | static std::unique_ptr<Handler> findHandlerForCommandAuthenticated(Protocol::Command::Type cmd); | ||
89 | 89 | | |||
90 | void setConnection(Connection *connection); | 90 | void setConnection(Connection *connection); | ||
91 | Connection *connection() const; | 91 | Connection *connection() const; | ||
92 | DataStore *storageBackend() const; | 92 | DataStore *storageBackend() const; | ||
93 | 93 | | |||
94 | bool failureResponse(const char *response); | 94 | bool failureResponse(const char *response); | ||
95 | bool failureResponse(const QByteArray &response); | 95 | bool failureResponse(const QByteArray &response); | ||
96 | bool failureResponse(const QString &response); | 96 | bool failureResponse(const QString &response); | ||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |