/** * Sets the address from which client requests will originate. * * @param address The address from which client requests will originate. * @return This factory object. */ @Nonnull public final BaseResourceClientFactory<B, C> setSourceAddress(@Nonnull final String address) { sourceAddress = address; return this; }
/** * Gets the maximum period of inactivity between two consecutive data packets in milliseconds. * * @param timeout The maximum period of inactivity between two consecutive data packets in milliseconds. * @return This factory object. */ public final BaseResourceClientFactory<B, C> setSocketTimeout(@Nonnull final Integer timeout) { socketTimeout = timeout; return this; }
/** * Sets Whether HTTP redirects will be followed. * * @param follow Whether HTTP redirects will be followed. * @return This factory object. */ public final BaseResourceClientFactory<B, C> setFollowRedirects(@Nonnull final Boolean follow) { followRedirects = follow; return this; }
/** * Sets the Maximum number of redirects that will be followed if following of redirects is enabled. * * @param max Maximum number of redirects that will be followed if following of redirects is enabled. * @return this factory object. */ public final BaseResourceClientFactory<B, C> setMaxRedirects(@Nonnull final int max) { maxRedirects = max; return this; }
/** * Returns the base URL used to connect to the service. * * @return The base URL used to connect to the service. */ @Nonnull public final String getServiceBaseUrl() { return serviceBaseUrl; }
/** * Gets the unsupported request content type. * * @return the unsupported request content type */ @Nonnull public MediaType getUnsuportedContentType() { return contentType; } }
/** * Sets the Socket buffer size in bytes. * * @param bufferSize The Socket buffer size in bytes. * @return this factory object. */ public final BaseResourceClientFactory<B, C> setSocketBufferSize(@Nonnull final Integer bufferSize) { socketBufferSize = bufferSize; return this; }
/** * Sets Whether connections will automatically be closed by server after the response is sent. * * @param enabled Whether connections will automatically be closed by server after the response is sent. * @return this factory object. */ public final BaseResourceClientFactory<B, C> setConnectionCloseAfterResponseEnabled(@Nonnull final Boolean enabled) { connectionCloseAfterResponseEnabled = enabled; return this; }
/** * Sets the maximum number of concurrent connections allowed. * * @param max Maximum number of concurrent connections allowed. * @return this factory instance. */ @Nonnull public final BaseResourceClientFactory<B, C> setMaxConcurrentRequests(@Nonnull final Integer max) { maxConcurrentRequests = max; return this; }
/** * Conditionally get a resource based on some previously-fetched version of that resource. * * @param resource The previously-fetched resource held by the client, which should have a version set. * @param httpContext the HTTP context containing session-level data. * * @return Returns a future containing either a) the current resource at the server, if newer than the passed * resource, or b) return back the given resource if it is the most recent version available. */ @Nonnull CheckedFuture<T, ServiceException> get(@Nonnull T resource, @Nonnull HttpContext httpContext);
/** * Sets the owner {@link Resource} of these phone numbers. * * @param parent The who owns these phones. * @return this object */ public Phones setOwner(@Nonnull Resource parent) { owner = parent; return this; }
/** {@inheritDoc} */ @Nonnull public final Class<PersonInvitation> getResourceType() { return PersonInvitation.class; }
/** * Sets the request type enum. * * @param requestEnum The request type enum. * @return this object. */ @Nonnull public PersonRequest setRequestTypeEnum(int requestEnum) { requestTypeEnum = requestEnum; return this; }
/** * Sets the target orgnization id. * * @param targetOrganizationId The target organization id. * @return this object. */ @Nonnull public PersonRequest setTargetOrgId(long targetOrganizationId) { targetOrgId = targetOrganizationId; return this; }
/** * Sets the given invocation context on the current thread. * * @param context The invocation context to set. */ static void set(@Nonnull ClientInitializationContext context) { THREADLOCAL.set(context); log.debug("Set invocation context on thread local: {}", context); }
/** {@inheritDoc} **/ @Nonnull public CheckedFuture<List<T>, ServiceException> search(@Nonnull Multimap<String, String> searchCriteria, @Nullable SortCriteria sortCriteria, @Nonnull Page page, @Nonnull HttpContext httpContext) { return search(searchCriteria, sortCriteria, page, httpContext, crudOperationContentType, searchEndpoint); }