https://github.com/maruTA-bis5/mattermost4j
Mattermost API v4 Client for Java
https://github.com/maruTA-bis5/mattermost4j
hacktoberfest java mattermost
Last synced: 6 months ago
JSON representation
Mattermost API v4 Client for Java
- Host: GitHub
- URL: https://github.com/maruTA-bis5/mattermost4j
- Owner: maruTA-bis5
- License: apache-2.0
- Created: 2017-06-26T08:36:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-14T22:31:29.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T01:25:53.649Z (about 1 year ago)
- Topics: hacktoberfest, java, mattermost
- Language: Java
- Homepage:
- Size: 18.3 MB
- Stars: 31
- Watchers: 2
- Forks: 20
- Open Issues: 73
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-list - mattermost4j - bis5 | 23 | (Java)
README
mattermost4j
============

[](https://maven-badges.herokuapp.com/maven-central/net.bis5.mattermost4j/mattermost4j-core)
[](http://javadoc.io/doc/net.bis5.mattermost4j/mattermost4j-core)
[](https://sonarcloud.io/dashboard?id=net.bis5.mattermost4j%3Amattermost4j-parent)
Mattermost API v4 client for Java.
## Requirement
- JDK 11 or later
- Additional dependencies required for Java SE runtime environment. These dependencies is not required for Jakarta EE server environment.
- Jakarta XML Binding (`jakarta.xml.bind:jakarta.xml.bind-api`)
- Jakarta Activation (`jakarta.activation:jakarta.activation-api`)
- Mattermost Server
- Please check mattermost4j version compatible with your server instance:
https://github.com/maruTA-bis5/mattermost4j/wiki#what-version-shoud-i-use
- Jakarta RESTful Web Services 3.1 implementation (Client only, A part of Jakarta EE 10)
## Usage
### Basic API Client
```java
// Create client instance
MattermostClient client;
// case 1. use constructor - log disable and prohibit unknown properties
client = new MattermostClient("YOUR-MATTERMOST-URL");
// case 2. use builder
client = MattermostClient.builder()
.url("YOUR-MATTERMOST-URL")
.ignoreUnknownProperties()
.build();
// Login by id + password
client.login(loginId, password);
// Login by Personal Access Token
client.setAccessToken(token);
```
### Use Incoming Webhook
```java
// You can also use builder for create client instance.
IncomingWebhookClient client = new IncomingWebhookClient("YOUR-MATTERMOST-URL");
IncomingWebhookRequest payload = new IncomingWebhookRequest();
payload.setText("Hello World!");
payload.setUsername("Override Username");
client.postByIncomingWebhook(payload);
```
## Install
Add these dependencies to your project.
- Core (`net.bis5.mattermost4j:mattermost4j-core`)
- Client Adapter matches to your RESTful Web Service Client
You can request to create new client adapter for other client not in below list if you would like to use.
- for Jersey: `net.bis5.mattermost4j:mattermost4j-jersey`
- for RESTEasy: `net.bis5.mattermost4j:mattermost4j-resteasy`
## Module index
groupId: `net.bis5.mattermost4j`
|artifactId|JPMS module|module name|note|
|---|---|---|---|
|`mattermost-models`|`net.bis5.mattermost4j.models`|Maattermost Data Models||
|`mattermost4j-core`|`net.bis5.mattermost4j.core`|Mattermost APIv4 Client for Java||
|`mattermost4j-integration-test-base`|`net.bis5.mattermost4j.testbase`|Mattermost4J :: Integration Test Base||
|`mattermost4j-jersey`|`net.bis5.mattermost4j.jersey`|Mattermost4J :: Jersey Client||
|`mattermost4j-resteasy`|`net.bis5.mattermost4j.resteasy`|Mattermost4J :: RESTEasy Client|(JPMS) Automatic module|
## Contribution
1. Fork it ( https://github.com/maruTA-bis5/mattermost4j/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create new Pull Request
### Code Formatter
use https://github.com/google/styleguide/ {intellij,eclipse}-java-google-style.xml .
### CheckStyle
Currently, use CheckStyle's built-in `google_checks.xml`.
## Test
### Integration with Mattermost Server
1. `docker-compose up`
2. `mvn test`
#### To run specify test
1. `docker-compose up`
2. `mvn test -Dtest=UsersApiTest -Dsurefire.failIfNoSpecifiedTests=false`
## Contact
- Create GitHub Issue (https://github.com/maruTA-bis5/primefaces-excella-exporter/issues/new)
- or Start new Discussion (https://github.com/maruTA-bis5/primefaces-excella-exporter/discussions/new)
- or DM me on the Mattermost Community Server (https://community.mattermost.com/core/messages/@maruta-bis5)
## License
[Apache Software License, Version 2.0](LICENSE.txt)