最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Can't get Promise to work in Confluence Data Center - Stack Overflow

programmeradmin1浏览0评论

How to fix bug? I get ClassNotFound in atlassian-confluence.log file:

import com.atlassian.httpclient.api.HttpClient;
import com.atlassian.httpclient.api.Request;
import com.atlassian.util.concurrent.Promise;
import com.atlassian.httpclient.api.Response;
import com.atlassian.httpclient.api.ResponsePromise;

private Promise<Response> sendPusherEvent(String channel, String event, String message) {
    long timestamp = System.currentTimeMillis() / 1000;
    String body = "{\"name\":\"" + event + "\", \"channel\":\"" + channel + "\", \"data\":\"" + message + "\"}";
    String signature = generateSignature(body, timestamp);

    String url = "https://" + cluster + ".pusher/apps/" + appId + "/events"
            + "?auth_key=" + key + "&auth_timestamp=" + timestamp + "&auth_version=1.0&auth_signature=" + signature;

    // Create and execute request correctly
    ResponsePromise requestBuilder = httpClient.newRequest(url, "application/json", body).post();

    // FIX: Convert ResponsePromise to Promise<Response>
    return requestBuilder;
}

I just want to use Pusher but I can't use it's official Java API in Confluence 9, because Atlassian is made 3rd APIs to not work.

发布评论

评论列表(0)

  1. 暂无评论