/** * Create a FcrepoProducer object * * @param endpoint the FcrepoEndpoint corresponding to the exchange. */ public FcrepoProducer(final FcrepoEndpoint endpoint) { super(endpoint); this.endpoint = endpoint; this.transactionTemplate = endpoint.createTransactionTemplate(); final FcrepoClient.FcrepoClientBuilder builder = client() .credentials(endpoint.getAuthUsername(), endpoint.getAuthPassword()) .authScope(endpoint.getAuthHost()); if (endpoint.getThrowExceptionOnFailure()) { this.fcrepoClient = builder.throwExceptionOnFailure().build(); } else { this.fcrepoClient = builder.build(); } }
private static FcrepoClient getFcrepoClient() { return new FcrepoClientBuilder().credentials(FedoraConfig.getUserName(), FedoraConfig.getPassword()).build(); }
/** * Instantiates default implementations of the underlying Fedora client, JSON adapter, and OkHttpClient. */ public FedoraPassCrudClient() { this(FcrepoClient.client() .credentials(FedoraConfig.getUserName(), FedoraConfig.getPassword()) .throwExceptionOnFailure() .build(), new PassJsonAdapterBasic()); }
private FcrepoClient getClient() { if (fcrepoClient == null) { return client().credentials(authUsername, authPassword).authScope(authHost) .throwExceptionOnFailure().build(); } return fcrepoClient; } }
/** * Instantiates default implementations of the underlying Fedora client, JSON adapter, and OkHttpClient. */ public FedoraPassCrudClient() { this(FcrepoClient.client() .credentials(FedoraConfig.getUserName(), FedoraConfig.getPassword()) .throwExceptionOnFailure() .build(), new PassJsonAdapterBasic()); }