Class MattermostUtils
java.lang.Object
org.exoplatform.addons.mattermost.services.MattermostUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TeamcreateTeam(String name, String displayName, String type) static booleandeleteTeam(Team team) static Stringstatic TeamgetTeamById(String teamId) static BooleaninviteMemberToTeam(List<String> emails, String teamId) protected static HttpResponse<String>sendHttpDelRequest(String url, String token) protected static HttpResponse<String>sendHttpGetRequest(String url, String token) protected static HttpResponse<String>sendHttpPostRequest(String url, String token, String contentAsJson) protected static HttpResponse<String>sendHttpPutRequest(String url, String token, String contentAsJson) static TeamtoTeam(org.exoplatform.ws.frameworks.json.value.JsonValue teamJsonValue) Sample team object * * {"id":"uqin5inx1bn43xwa8bcuecn1th", "create_at":1710431111169, "update_at":1710431111169, "delete_at":0, "display_name":"testing", "name":"testing", "description":"", "email":"user.email@mailbox.test", "type":"I", "company_name":"", "allowed_domains":"", "invite_id":"93suk9d4et8dxxi5ge1wzr6igr", "allow_open_invite":false, "scheme_id":null, "group_constrained":null, "policy_id":null, "cloud_limits_archived":false }static TeamupdateTeam(Team team) static TeamupdateTeamPrivacy(Team team, String privacy)
-
Field Details
-
EXO_MATTERMOST_SERVER_URL
- See Also:
-
EXO_ADDON_MATTERMOST_PASSWORD
- See Also:
-
EXO_ADDON_MATTERMOST_USER_NAME
- See Also:
-
TOKEN
- See Also:
-
AUTHORIZATION
- See Also:
-
BEARER
- See Also:
-
MATTERMOST_SERVER_URL_IS_REQUIRED
- See Also:
-
API_V_4_TEAMS
- See Also:
-
-
Method Details
-
createTeam
- Throws:
Exception
-
getMattermostToken
- Throws:
Exception
-
sendHttpGetRequest
protected static HttpResponse<String> sendHttpGetRequest(String url, String token) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
sendHttpPostRequest
protected static HttpResponse<String> sendHttpPostRequest(String url, String token, String contentAsJson) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
sendHttpPutRequest
protected static HttpResponse<String> sendHttpPutRequest(String url, String token, String contentAsJson) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
sendHttpDelRequest
protected static HttpResponse<String> sendHttpDelRequest(String url, String token) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
updateTeam
- Throws:
Exception
-
updateTeamPrivacy
- Throws:
Exception
-
deleteTeam
- Throws:
Exception
-
toTeam
Sample team object * * {"id":"uqin5inx1bn43xwa8bcuecn1th", "create_at":1710431111169, "update_at":1710431111169, "delete_at":0, "display_name":"testing", "name":"testing", "description":"", "email":"user.email@mailbox.test", "type":"I", "company_name":"", "allowed_domains":"", "invite_id":"93suk9d4et8dxxi5ge1wzr6igr", "allow_open_invite":false, "scheme_id":null, "group_constrained":null, "policy_id":null, "cloud_limits_archived":false }- Parameters:
teamJsonValue-- Returns:
-
getTeamById
- Throws:
Exception
-
inviteMemberToTeam
- Parameters:
emails-teamId-- Returns:
- Throws:
Exception
-