Add proxy config methods in collibra Context api
I am using context api to fetch all the assets from a domain in Collibra.
import com.collibra.api.common.Context;
import com.collibra.api.find.FindAssetsBulk;
import com.collibra.api.qualifier.DomainQualifier;
import com.collibra.api.model.response.AssetWithAttributes;
import com.collibra.dgc.core.api.model.instance.Asset;
import com.collibra.dgc.core.api.model.instance.attribute.Attribute;
Context context = Context.builder()
.withHost(host_url)
.withPort(port_number)
.withUser("User")
.withPassword("Pass")
.withSecureSocketLayer(true)
.build();
Set<AssetWithAttributes> assetsWithAttributes = FindAssetsBulk.getAssets(context, 0, 2000, new DomainQualifier("Community", "DomainName", "DomainType"));
I want to add proxy details also to context like host, port, username and password also to it. How may I do that?
Former User
Posted 5 years ago · Edited 2 years ago·Last reply 5 years ago
3 comments
Former User
OP5 years ago · EditedSomething Collibra Support provided to help with this:
You will need to create the HttpClientFactory at the start up of the program. You’ll want to do this before making a call to the DGC. You only have to do this once since this will be shared across all Context connections to the DGC. The code is
HttpClientFactoryParams httpClientParams = new HttpClientFactoryParams();
httpClientParams.setProxyHost(“proxyHost”);
httpClientParams.setProxyPort(80);
httpClientParams.setProxySecureSocketLayer( false );
httpClientParams.setProxyUser( null );
httpClientParams.setProxyPassword( null );
HttpClientFactory. create (httpClientParams);
The only required httpClientParam is the setProxyHost.I’d recommend downloading the latest Java Api.
javaAPI-javadoc-5.7.7b8
javaAPI-5.7.7b8-DIST
javaAPI-5.7.7b8-FINAL
You may request these files from support.
Former User
OP5 years ago · EditedHaha, yes those api are deprecated, they are getting used in few of my mule jobs created long back.
Well I moved to output module, will have to redesign whole flow based on it.
Was looking a short way out if there’s a way I can still use the old code and save my time.
arthurburkhardt
·5 years ago · EditedWow, I can’t even figure out which version of the java API you are using.
Is this still supported?
You might have a better chance switching to the API v2 with a combination of assetApi + attributeApi or the output Module. You will not need any context.