Search in sources :

Example 1 with UriBuilder

use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.

the class RewriteClient method rewriteUri.

private URI rewriteUri(URI uri) {
    assert _serviceName.equals(LoadBalancerUtil.getServiceNameFromUri(uri));
    String path = LoadBalancerUtil.getRawPathFromUri(uri);
    UriBuilder builder = UriBuilder.fromUri(_uri);
    if (path != null) {
        builder.path(path);
    }
    builder.replaceQuery(uri.getRawQuery());
    builder.fragment(uri.getRawFragment());
    URI rewrittenUri = builder.build();
    debug(_log, "rewrite uri ", uri, " -> ", rewrittenUri);
    return rewrittenUri;
}
Also used : UriBuilder(com.linkedin.jersey.api.uri.UriBuilder) URI(java.net.URI)

Example 2 with UriBuilder

use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.

the class ActionRequestUriBuilder method build.

@Override
public URI build() {
    ActionRequest<?> actionRequest = getRequest();
    UriBuilder b = UriBuilder.fromUri(buildBaseUriWithPrefix());
    if (actionRequest.getId() != null) {
        appendKeyToPath(b, actionRequest.getId());
    }
    appendQueryParams(b);
    return b.build();
}
Also used : UriBuilder(com.linkedin.jersey.api.uri.UriBuilder)

Example 3 with UriBuilder

use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.

the class BatchCreateIdEntityRequestUriBuilder method build.

@Override
public URI build() {
    UriBuilder b = UriBuilder.fromUri(buildBaseUriWithPrefix());
    appendQueryParams(b);
    return b.build();
}
Also used : UriBuilder(com.linkedin.jersey.api.uri.UriBuilder)

Example 4 with UriBuilder

use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.

the class BatchCreateIdRequestUriBuilder method build.

@Override
public URI build() {
    UriBuilder b = UriBuilder.fromUri(buildBaseUriWithPrefix());
    appendQueryParams(b);
    return b.build();
}
Also used : UriBuilder(com.linkedin.jersey.api.uri.UriBuilder)

Example 5 with UriBuilder

use of com.linkedin.jersey.api.uri.UriBuilder in project rest.li by linkedin.

the class BatchCreateRequestUriBuilder method build.

@Override
public URI build() {
    UriBuilder b = UriBuilder.fromUri(buildBaseUriWithPrefix());
    appendQueryParams(b);
    return b.build();
}
Also used : UriBuilder(com.linkedin.jersey.api.uri.UriBuilder)

Aggregations

UriBuilder (com.linkedin.jersey.api.uri.UriBuilder)45 DataMap (com.linkedin.data.DataMap)9 URI (java.net.URI)6 Test (org.testng.annotations.Test)5 DataList (com.linkedin.data.DataList)3 ProtocolVersion (com.linkedin.restli.common.ProtocolVersion)2 AnyRecord (com.linkedin.restli.internal.server.methods.AnyRecord)2 CreateKVResponse (com.linkedin.restli.server.CreateKVResponse)2 CreateResponse (com.linkedin.restli.server.CreateResponse)2 ResourceContext (com.linkedin.restli.server.ResourceContext)2 RestLiServiceException (com.linkedin.restli.server.RestLiServiceException)2 HashMap (java.util.HashMap)2 MaskMap (com.linkedin.data.schema.MaskMap)1 RecordTemplate (com.linkedin.data.template.RecordTemplate)1 RestRequest (com.linkedin.r2.message.rest.RestRequest)1 RestRequestBuilder (com.linkedin.r2.message.rest.RestRequestBuilder)1 IdResponse (com.linkedin.restli.common.IdResponse)1 QueryParamsDataMap (com.linkedin.restli.internal.common.QueryParamsDataMap)1 ServerResourceContext (com.linkedin.restli.internal.server.ServerResourceContext)1 ArrayList (java.util.ArrayList)1