private ClientRequest.Builder build() { ClientRequest.Builder builder = ClientRequest.create(); for ( Map.Entry<String, String> header : headers.entrySet() ) { builder = builder.header( header.getKey(), header.getValue() ); } return builder; } }
private static ClientRequest createClientRequest( URI uri ) { return ClientRequest.create() .header( "Accept", "application/json" ) .build( uri, "POST" ); }
protected ClientRequest.Builder createRequest() { return ClientRequest.create().header(HttpHeaders.USER_AGENT, "gedcomx-java-sdk/" + SDK_VERSION); }
private DiscoveryState(URI uri, Client client, FamilyTreeStateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private FamilySearchNames(URI uri, Client client, FamilySearchStateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private CollectionState(URI uri, Client client, StateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private FamilySearchPersonState(URI uri, Client client, FamilySearchStateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private FamilySearchOrdinancesState(URI uri, com.sun.jersey.api.client.Client client, FamilyTreeStateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private FamilySearchFamilyTree(URI uri, Client client, FamilyTreeStateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private PersonState(URI uri, Client client, StateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private FamilySearchPlaces(URI uri, Client client, FamilySearchStateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private FamilyTreePersonsState(URI uri, Client client, FamilyTreeStateFactory stateFactory) { this(ClientRequest.create().accept(FamilySearchPlatform.JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private FamilyTreePersonState(URI uri, Client client, FamilyTreeStateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private RecordState(URI uri, Client client, StateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
private FamilySearchGenealogies(URI uri, Client client, GenealogiesStateFactory stateFactory) { this(ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(uri, HttpMethod.GET), client, stateFactory); }
/** * Create POST client request to given (request/access) token uri. Request properties from {@code originalRequest} are * copied to the new request. * * @param originalRequest client request to copy properties from. * @param tokenUri token uri endpoint. * @return new client request to the token uri endpoint. */ private ClientRequest createTokenClientRequest(final ClientRequest originalRequest, final URI tokenUri) { final ClientRequest request = ClientRequest.create().build(tokenUri, HttpMethod.POST); request.getProperties().putAll(originalRequest.getProperties()); return request; }
public CollectionState newCollectionState(URI discoveryUri, Client client, String method) { ClientRequest request = ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(discoveryUri, method); if (Boolean.valueOf(System.getProperty(DONT_FOLLOW_REDIRECTS))) { request.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, false); } return newCollectionState(request, client.handle(request), null); }
public RecordState newRecordState(URI discoveryUri, Client client, String method) { ClientRequest request = ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(discoveryUri, method); if (Boolean.valueOf(System.getProperty(DONT_FOLLOW_REDIRECTS))) { request.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, false); } return newRecordState(request, client.handle(request), null); }
public PersonState newPersonState(URI discoveryUri, Client client, String method) { ClientRequest request = ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(discoveryUri, method); if (Boolean.valueOf(System.getProperty(ENABLE_JERSEY_LOGGING_ENV_NAME))) { // handles null client.addFilter(new com.sun.jersey.api.client.filter.LoggingFilter()); } return newPersonState(request, client.handle(request), null); }
/** * Create a new places state with the given URI * * @param discoveryUri the discovery URI for places * @param client the client that will use the new places state * @param method the HTTP method to call * @return a new places state created with with the given URI */ public FamilySearchPlaces newPlacesState(URI discoveryUri, Client client, String method) { ClientRequest request = ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(discoveryUri, method); return newPlacesState(request, client.handle(request), null); }