com.kaltura.client.utils.request.ServeRequestBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of KalturaOttApiClient Show documentation
Show all versions of KalturaOttApiClient Show documentation
KalturaOttApiClient is a library of Java classes that can be used to interact
with the Kaltura OTT REST API. More information about the REST API can be
found at https://ott.developer.kaltura.com/ Many of the Java classes
in this library are auto-generated from a schema that defines the objects that
are used to interact with the API.
package com.kaltura.client.utils.request;
import com.kaltura.client.Client;
import com.kaltura.client.Params;
import com.kaltura.client.types.APIException;
import com.kaltura.client.utils.APIConstants;
public abstract class ServeRequestBuilder extends RequestBuilder {
public ServeRequestBuilder(String service, String action) {
super(String.class, service, action);
}
@Override
public String getMethod() {
return "GET";
}
@Override
public String getBody() {
return null;
}
@Override
public RequestElement build(final Client client, boolean addSignature) {
Params kParams = prepareParams(client, true);
prepareHeaders(client.getConnectionConfiguration());
String endPoint = client.getConnectionConfiguration().getEndpoint().replaceAll("/$", "");
StringBuilder urlBuilder = new StringBuilder(endPoint)
.append("/")
.append(APIConstants.UrlApiVersion)
.append("/service/")
.append(service)
.append("/action/")
.append(action)
.append("?")
.append(kParams.toQueryString());
url = urlBuilder.toString();
return this;
}
@Override
protected Object parse(String response) throws APIException {
return response;
}
@Override
public String getTokenizer() throws APIException {
throw new APIException(APIException.FailureStep.OnRequest, "Served content response can not be used as multi-request token");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy