Class ClusterModeratorConnector
The Cluster Moderator Connector allows GUI or Command Line Moderator User Applications to connect with cluster.
Inheritance
Implements
Inherited Members
Namespace: peno_cluster_moderator
Assembly: peno_cluster_moderator.dll
Syntax
public class ClusterModeratorConnector : IModeratorPanel
Constructors
| Improve this Doc View SourceClusterModeratorConnector(String, String)
Create a new Cluster Moderator Connector instance using the username and password of some user.
Declaration
public ClusterModeratorConnector(string username, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | The username of the user. |
System.String | password | The password of the user. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the username of password were incorrect or the connection to cluster failed. |
Methods
| Improve this Doc View SourceAddWord(String)
Add a word to the blacklist. If the word is null or empty, nothing will happen.
Declaration
public void AddWord(string word)
Parameters
Type | Name | Description |
---|---|---|
System.String | word | The word to add to the blacklist, this word may contain spaces. |
BlockUser(String, DateTime)
Block a user. If one of the params is null or empty, nothing happens.
Declaration
public void BlockUser(string userId, DateTime date)
Parameters
Type | Name | Description |
---|---|---|
System.String | userId | The user to block. |
System.DateTime | date | The time at which the user was blocked. |
GetBlackList()
Get all the words in the blacklist.
Declaration
public List<string> GetBlackList()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | A list of words in the blacklist. These words may contain spaces. |
GetBlockedUsers()
Get all the blocked users.
Declaration
public List<(string, DateTime)> GetBlockedUsers()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.ValueTuple<System.String, System.DateTime>> | A list of blocked users. |
GetReportedQA()
Get the reported Q&A from Cluster.
Declaration
public List<(string, string, string)> GetReportedQA()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.ValueTuple<System.String, System.String, System.String>> | The reported Q&A from Cluster. |
Exceptions
Type | Condition |
---|---|
System.ApplicationException | There was an error while fetching the reported Q&A. |
OffensiveReportedQA((String, String, String))
Classify the given Q&A tuple as offensive.
Declaration
public void OffensiveReportedQA((string, string, string) reportedQA)
Parameters
Type | Name | Description |
---|---|---|
System.ValueTuple<System.String, System.String, System.String> | reportedQA | A 3-tuple consisting of the user id, the question, and the answer. |
RemoveWord(String)
Remove a word from the blacklist. If the word is null or empty, nothing will happen.
Declaration
public void RemoveWord(string word)
Parameters
Type | Name | Description |
---|---|---|
System.String | word | The word to remove from the blacklist, this word may contain spaces. |
SafeReportedQA((String, String, String))
Classify the given Q&A tuple as safe.
Declaration
public void SafeReportedQA((string, string, string) reportedQA)
Parameters
Type | Name | Description |
---|---|---|
System.ValueTuple<System.String, System.String, System.String> | reportedQA | A 3-tuple consisting of the user id, the question, and the answer. |
UnblockUser(String)
Unblock a user. If one of the params is null or empty, nothing happens.
Declaration
public void UnblockUser(string userId)
Parameters
Type | Name | Description |
---|---|---|
System.String | userId | The user to unblock. |