exchange.apexpro.connector.impl.ApiInternalFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apexpro-connector-java Show documentation
Show all versions of apexpro-connector-java Show documentation
A lightweight library to ApeX-Protocol
package exchange.apexpro.connector.impl;
import exchange.apexpro.connector.*;
import exchange.apexpro.connector.model.user.ApiCredential;
public final class ApiInternalFactory {
private static final ApiInternalFactory instance = new ApiInternalFactory();
public static ApiInternalFactory getInstance() {
return instance;
}
private ApiInternalFactory() {
}
public SyncRequestClient createSyncRequestClient(ApexProCredentials apexProCredentials, RequestOptions options) {
RequestOptions requestOptions = new RequestOptions(options);
RestApiRequestImpl requestImpl = new RestApiRequestImpl(apexProCredentials, requestOptions);
return new SyncRequestImpl(requestImpl);
}
public SubscriptionClient createSubscriptionClient(SubscriptionOptions options) {
SubscriptionOptions subscriptionOptions = new SubscriptionOptions(options);
SubscriptionClient webSocketStreamClient = new WebSocketStreamClientImpl(subscriptionOptions);
return webSocketStreamClient;
}
}