If non-null, Fine Uploader will send a GET request on startup to this
endpoint, expecting a JSON response containing data about the initial file
list to populate.

@param aEndpoint
New value. May be <code>null</code>.
@return this for chaining
15738
@Nonnull
  public FineUploader5Session setEndpoint (@Nullable final ISimpleURL aEndpoint)
  {
    ValueEnforcer.notNull (aEndpoint, "Endpoint");
    m_aSessionEndpoint = aEndpoint;
    return this;
  }
95513
public static CompletableFuture<EndpointDescription[]> getEndpoints(String endpointUrl) {
        UaTcpStackClientConfig config = UaTcpStackClientConfig.builder()
                .setEndpointUrl(endpointUrl)
                .build();

        UaTcpStackClient client = new UaTcpStackClient(config);

        GetEndpointsRequest request = new GetEndpointsRequest(
                new RequestHeader(null, DateTime.now(), uint(1), uint(0), null, uint(5000), null),
                endpointUrl, null, new String[]{Stack.UA_TCP_BINARY_TRANSPORT_URI});

        return client.<GetEndpointsResponse>sendRequest(request)
                .whenComplete((r, ex) -> client.disconnect())
                .thenApply(GetEndpointsResponse::getEndpoints);
    }
294959
public static HttpRequestor.Response startPostNoAuth(DbxRequestConfig requestConfig,
                                                         String sdkUserAgentIdentifier,
                                                         String host,
                                                         String path,
                                                         /*@Nullable*/String/*@Nullable*/[] params,
                                                         /*@Nullable*/List<HttpRequestor.Header> headers)
        throws NetworkIOException {
        byte[] encodedParams = StringUtil.stringToUtf8(encodeUrlParams(requestConfig.getUserLocale(), params));

        headers = copyHeaders(headers);
        headers.add(new HttpRequestor.Header("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"));

        return startPostRaw(requestConfig, sdkUserAgentIdentifier, host, path, encodedParams, headers);
    }
373312
public DataUrl build() throws NullPointerException {
        if (data == null) {
            throw new NullPointerException("data is null!");
        } else if (encoding == null) {
            throw new NullPointerException("encoding is null!");
        }
        return new DataUrl(data, encoding, mimeType, headers);
    }
8917
public JSONObject getPathFromEndpoint(String pathValue, String requestType) throws Exception {
        int type = getRequestTypeFromString(requestType);
        String url = BASE_PATH;
        JSONObject response = new JSONObject(doGet(url, null));
        JSONArray paths = response.getJSONArray("paths");
        for (int i = 0; i < paths.length(); i++) {
            JSONObject path = paths.getJSONObject(i);
            if (path.getString("path").equals(pathValue) && path.getInt("requestType") == type) {
                return path;
            }
        }
        return null;
    }
965224
@Override
    public MessageEndpoint createEndpoint(XAResource xaResource, long timeout) throws UnavailableException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            Tr.entry(tc, "MEF.createEndpoint for enterprise class " + beanMetaData.enterpriseBeanName);
        }

        boolean recoverableXAResource = false;
        // d197017 begins
        // Make sure endpoint is activated before proceeding.
        Object proxy = null;
        MessageEndpointBase endpoint = null;
        boolean newInstanceRequired = false; //LI2110.56
        synchronized (ivStateLock)
        {
            // If RRS then xaResource passed in may be null. We need to enlist the RRS XAResource and not the XAResource passed in by the
            // RA. So in that case we need to check for the recoveryId
            if (xaResource != null || ivRRSTransactional) //d197017
            {
                // Ensure setRecoveryID method is called prior to this method since
                // recovery ID is needed to enlist the XAResource with the
                // transaction service during beforeDelivery.
                if ((ivRecoveryIdKnown == false) || (ivRecoveryId == 0)) //d194602
                {
                    if (ivEnlistNotNeeded == false)
                    {
                        if (RecoverableXAResourceAccessor.isRecoverableXAResource(xaResource)) //d197017
                        {
                            recoverableXAResource = true;
                        }
                        else
                        {
                            // CNTR0082E: Can not enlist XAResource since recovery ID for
                            // resource adapter {0} for MDB {1} is not known.
                            Tr.error(tc, "ENDPOINT_RECOVERY_ID_UNKNOWN_CNTR0082E",
                                     ivRAKey, beanMetaData.j2eeName);
                            throw new UnavailableException("setRecoveryId must be called prior to createEndpoint");
                        }
                    }
                }
            }

            if (ivState == ACTIVE_STATE)
            {
                if (!isEndpointActive()) //d450478
                {
                    // This can happen when RALifeCycleManager forcefully deactivates an
                    // endpoint during an RA stop operation. See the
                    // messageEndpointForcefullyDeactivated method in this class.
                    throw new UnavailableException("endpoint needs to be activated.");
                }

                // Use pool only if one was created.
                if (ivInvocationHandlerPool != null) // d423445.1
                {
                    // LI2110.56 start of change.
                    // Endpoint is active, so proceed with creating the endpoint.
                    // First see if one is available in the free pool.
                    endpoint = (MessageEndpointBase) ivInvocationHandlerPool.get();
                    if (endpoint == null)
                    {
                        // Free pool empty, so check whether it okay to create a new one.
                        // f743-7046 start
                        if (ivNumberOfMessageEndpointsCreated < ivMaxCreation) //LI2110.56
                        {
                            // Limit was NOT reached, so just increment count of created endpoints.
                            ++ivNumberOfMessageEndpointsCreated;
                            newInstanceRequired = true;
                        }
                        else
                        {
                            // Max creation limit reached. Was a valid wait timeout value provided?
                            if (timeout <= 0)
                            {
                                if (majorJCAVersion == 1 && minorJCAVersion == 5)
                                {
                                    // JCA 1.5 RA does not provide a timeout value, so throw same exceptions
                                    // we have always thrown in past to ensure same behavior.  //PM16610
                                    throw new UnavailableException("limit for number of MessageEndpoint proxies reached. Limit = " + ivMaxCreation);
                                }
                                else
                                {
                                    // JCA 1.6 or later RA did not provide a valid wait timeout value, so throw the
                                    // retryable exception immediately.  //PM16610
                                    throw new RetryableUnavailableException("limit for number of MessageEndpoint proxies reached.  Limit = " + ivMaxCreation);
                                }
                            }
                            else
                            {
                                // A valid wait timeout value was provided, so it must be JCA 1.6 or later.
                                // Wait for some thread to call MessageEndpoint.release() method. When that happens
                                // the returnInvocationHandler method in this class is called and it will notify this
                                // thread that it can proceed with the create.
                                try
                                {
                                    ivStateLock.wait(timeout);
                                } catch (InterruptedException e)
                                {
                                    //FFDCFilter.processException(e, CLASS_NAME + ".createEndpoint", "519", this);
                                }

                                // Determine whether wait timeout or release occurred. If release occurred,
                                // then a handler will be retrieved from the pool.
                                endpoint = (MessageEndpointBase) ivInvocationHandlerPool.get();
                                if (endpoint == null)
                                {
                                    // Timed out waiting for a proxy to be released.
                                    throw new RetryableUnavailableException("timed out waiting for a MessageEndpoint proxy to become available.");
                                }
                                else
                                {
                                    // A MessageEndpoint proxy is now available. Ensure deactivate did not
                                    // occur while waiting for a MessageEndpoint to be released.
                                    if (ivState == ACTIVE_STATE)
                                    {
                                        // Still active and there is at least 1 MessageEndpoint proxy available.
                                        // handler was retrieved from the pool.  No need to create a new one.
                                        newInstanceRequired = false;
                                    }
                                    else if ((ivState == DEACTIVATING_STATE) || (ivState == DEACTIVATE_PENDING_STATE)) //d450478
                                    {
                                        throw new UnavailableException("deactivate of endpoint is in progress.");
                                    }
                                    else
                                    {
                                        throw new UnavailableException("endpoint needs to be activated.");
                                    }
                                }
                            }
                        } // f743-7046 end of change.
                    } // LI2110.56 end of change.
                }
            }
            else if (ivState == ACTIVATING_STATE)
            {
                // Endpoint is activating, so check if calling thread is the activating thread.
                if (ivActivatingThread == Thread.currentThread())
                {
                    // Calling thread is the activating thread, so throw
                    // exception since we can not block the activating thread and
                    // it is not retryable from this thread.
                    throw new UnavailableException("activating thread not allowed to create endpoint during activation.");
                }
                else
                {
                    // Not the activation thread, so block this thread until the activate completes.
                    try
                    {
                        if (timeout > 0) // f743-7046 start
                        {
                            ivStateLock.wait(timeout);
                        }
                        else
                        {
                            ivStateLock.wait();
                        } // f743-7046 end
                    } catch (InterruptedException i)
                    {
                        //FFDCFilter.processException(e, CLASS_NAME + ".createEndpoint", "406", this);
                    }

                    // Now verify activate was successful.
                    if (ivState != ACTIVE_STATE)
                    {
                        if (ivState == ACTIVATING_STATE) // f743-7046 start
                        {
                            // This can only happen if a JCA 1.6 or later RA provided a timeout value.
                            // So throw the retryable exception immediately.
                            throw new RetryableUnavailableException("timed out while waiting for activation to complete.");
                        }
                        else
                        {
                            // Neither in active nor activating state, so a deactivate must have occurred.
                            // This is not a transient condition, so throw non retryable exception.
                            throw new UnavailableException("endpoint needs to be activated.");
                        } // f743-7046 end
                    }
                }
            }
            else if ((ivState == DEACTIVATING_STATE) || (ivState == DEACTIVATE_PENDING_STATE)) //d450478
            {
                throw new UnavailableException("deactivate of endpoint is in progress.");
            }
            else
            {
                throw new UnavailableException("endpoint needs to be activated.");
            }
        }
        // d197017 ends

        // Create MessageEndpoint Proxy object using the Constructor Method that
        // was cached by the initialize method of this object.
        UnavailableException ex = null;
        try
        {
            // Was above code able to get a MessageEndpointHandler
            // from the free pool?
            if (endpoint != null)
            {
                // Yes, so get proxy object from the MessageEndpointHandler
                // object obtained from free pool.
                proxy = endpoint.ivProxy;
            }
            else
            {
                // Nope, so free pool must have been empty.  Since we got this
                // far, we know creation counter was incremented and newInstanceRequired
                // flag should have been set by above code.  So go ahead and try
                // to create a new instance.  Exception handler code below will decrement
                // counter if something goes wrong in the creation.
                proxy = beanMetaData.localImplClass.newInstance();

                // For no-method interface MDB, the 'proxy' will not
                // subclass MessageEndpointBase, but the MDB itself, so a separate
                // MessageEndpointBase must be created to hold the metadata and
                // associated with the real proxy.
                if (beanMetaData.ivIsNoMethodInterfaceMDB)
                {
                    endpoint = new MessageEndpointBase();
                    // Set the ivMessageEndpointBase on the generated proxy.
                    beanMetaData.ivMessageEndpointBaseField.set(proxy, endpoint);
                }
                // Otherwise, normal proxy - subclasses MessageEndpointBase
                else
                {
                    endpoint = (MessageEndpointBase) proxy;
                }

                MessageEndpointBase.construct(this,
                                              endpoint,
                                              ivRecoveryId,
                                              container,
                                              beanMetaData,
                                              pmiBean,
                                              wrapperManager,
                                              ivRRSTransactional);
                endpoint.ivProxy = proxy;
            }

            // Initialize InvocationHandler to be owner of this
            // proxy object and XAResource and determine if enlistment
            // of a XAResource is needed.
            if (ivEnlistNotNeeded)
            {
                if (xaResource == null)
                {
                    // Enlistment is not needed and no XAResource
                    // was passed by RA.  So everything is fine.
                    MessageEndpointBase.initialize(endpoint, null, false, majorJCAVersion, minorJCAVersion); // f743-7046
                }
                else
                {
                    // Enlistment is not needed, but the RA did pass an XAResource object.
                    // We need to throw an exception since transaction recovery setup was
                    // not completed successfully for this RA.
                    ex = mapAndLogTranEnlistmentNotNeeded();
                }
            }
            else
            {
                // Transaction recovery is setup for this RA, so
                // use whatever the RA passed as an XAResource.
                MessageEndpointBase.initialize(endpoint, xaResource, recoverableXAResource, majorJCAVersion, minorJCAVersion); // f743-7046
            }
        } catch (Throwable t)
        {
            // CNTR0083E: Creation of a message endpoint failed: \n {0}
            Tr.error(tc, "CREATE_ENDPOINT_FAILED_CNTR0083E", t);
            ex = new UnavailableException("Creation of MessageEndpoint Proxy failed", t);
        }

        // Check whether exception needs to be thrown.
        // If so, return invocation handler to pool if necessary
        // and throw the exception.
        if (ex != null)
        {
            // Use pool only if one was created.
            if (ivInvocationHandlerPool != null) // d423445.1
            {
                // Since proxy not being returned to caller,
                // Return InvocationHandler to the pool if both MessageEndpointHandler
                // and proxy object was created prior to the exception.
                if (endpoint != null && proxy != null) // LI2110.56
                {
                    MessageEndpointBase.reset(endpoint); // F73236 PooledObject removed, call reset() directly
                    ivInvocationHandlerPool.put(endpoint);
                }
                else
                {
                    // LI2110.56 beginning of change.
                    // Decrement creation counter so that it is not off by 1 as
                    // a result of a failure during creation of either MessageEndpointHandler
                    // or the proxy object itself (e.g. out of memory exception).
                    if (newInstanceRequired)
                    {
                        synchronized (ivStateLock)
                        {
                            --ivNumberOfMessageEndpointsCreated;
                        }
                    } // LI2110.56 end of change.
                }
            }

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            {
                BeanMetaData bmd = super.beanMetaData;
                Tr.exit(tc, "createEndpoint for enterprise class " + bmd.enterpriseBeanName + " failed.");
            }

            // Now throw the UnavailableException
            throw ex;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            Tr.exit(tc, "MEF.createEndpoint for enterprise class " + beanMetaData.enterpriseBeanName);
        }

        return (MessageEndpoint) proxy;
    }
52449
public String postJson(String endpoint, JSONObject json) throws IOException {
        return this.postJson(endpoint, "", json);
    }
789137
public QueryDataDescResponse createDataDesc(CreateDataDescRequest createDataDescRequest) {
        Preconditions.checkNotNull(createDataDescRequest.getParserObjectUuid(), "ParserObjectUuid should not be null.");
        Preconditions.checkNotNull(createDataDescRequest.getLength(), "Length should not be null.");
        Preconditions.checkNotNull(createDataDescRequest.getAddress(), "Address should not be null.");
        Preconditions.checkNotNull(createDataDescRequest.getKind(), "Kind should not be null.");
        Preconditions.checkNotNull(createDataDescRequest.getName(), "Name should not be null.");
        if (createDataDescRequest.getBit() == null) {
            createDataDescRequest.setBit(-1);
        }
        if (createDataDescRequest.getUnit() == "N/A") {
            createDataDescRequest.setUnit("");
        }
        InternalRequest internalRequest = createRequest(createDataDescRequest, HttpMethodName.POST, DATA_DESCRIPTION);
        return this.invokeHttpClient(internalRequest, QueryDataDescResponse.class);
    }
533057
public TokenRequestBuilder getTokenEndPoint() {
        for (Authentication apiAuth : authentications.values()) {
            if (apiAuth instanceof RetryingOAuth) {
                RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth;
                return retryingOAuth.getTokenRequestBuilder();
            }
        }
        return null;
    }
508820
public static HttpRequestor.Response startGet(DbxRequestConfig requestConfig,
                                                  String accessToken,
                                                  String sdkUserAgentIdentifier,
                                                  String host,
                                                  String path,
                                                  /*@Nullable*/String/*@Nullable*/[] params,
                                                  /*@Nullable*/List<HttpRequestor.Header> headers)
        throws NetworkIOException {
        headers = copyHeaders(headers);
        headers = addUserAgentHeader(headers, requestConfig, sdkUserAgentIdentifier);
        headers = addAuthHeader(headers, accessToken);

        String url = buildUrlWithParams(requestConfig.getUserLocale(), host, path, params);
        try {
            return requestConfig.getHttpRequestor().doGet(url, headers);
        }
        catch (IOException ex) {
            throw new NetworkIOException(ex);
        }
    }
525919
private static Endpoint initServiceEndpoint(EndpointRegistry epRegistry, String contextPath, String servletName)
   {
      if (contextPath.startsWith("/"))
         contextPath = contextPath.substring(1);

      final ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_CONTEXT
            + "=" + contextPath + "," + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
      Endpoint endpoint = epRegistry.getEndpoint(oname);
      if (endpoint == null)
      {
         throw Messages.MESSAGES.cannotObtainEndpoint(oname);
      }

      //Inject the EJB and JNDI resources if possible
      injectServiceAndHandlerResources(endpoint);

      return endpoint;
   }
1268613
public Collection getUploadFileID(HttpServletRequest request) {
    Debug.logVerbose("[JdonFramework]--> enter cache filter ", module);
    Collection uploadIDList = null;
    try {
      uploadIDList = imageFilter.getUploadFileID(request);
    } catch (Exception ex) {
      Debug.logError("[JdonFramework] not found the upload files in session", module);
    }
    return uploadIDList;

  }
1151852
private HttpResponse resumableUpload(GenericUrl initiationRequestUrl) throws IOException {
    // Make initial request to get the unique upload URL.
    HttpResponse initialResponse = executeUploadInitiation(initiationRequestUrl);
    if (!initialResponse.isSuccessStatusCode()) {
      // If the initiation request is not successful return it immediately.
      return initialResponse;
    }
    GenericUrl uploadUrl;
    try {
      uploadUrl = new GenericUrl(initialResponse.getHeaders().getLocation());
    } finally {
      initialResponse.disconnect();
    }

    // Convert media content into a byte stream to upload in chunks.
    contentInputStream = mediaContent.getInputStream();
    if (!contentInputStream.markSupported() && isMediaLengthKnown()) {
      // If we know the media content length then wrap the stream into a Buffered input stream to
      // support the {@link InputStream#mark} and {@link InputStream#reset} methods required for
      // handling server errors.
      contentInputStream = new BufferedInputStream(contentInputStream);
    }

    HttpResponse response;
    // Upload the media content in chunks.
    while (true) {
      ContentChunk contentChunk = buildContentChunk();
      currentRequest = requestFactory.buildPutRequest(uploadUrl, null);
      currentRequest.setContent(contentChunk.getContent());
      currentRequest.getHeaders().setContentRange(contentChunk.getContentRange());

      // set mediaErrorHandler as I/O exception handler and as unsuccessful response handler for
      // calling to serverErrorCallback on an I/O exception or an abnormal HTTP response
      new MediaUploadErrorHandler(this, currentRequest);

      if (isMediaLengthKnown()) {
        // TODO(rmistry): Support gzipping content for the case where media content length is
        // known (https://github.com/googleapis/google-api-java-client/issues/691).
        response = executeCurrentRequestWithoutGZip(currentRequest);
      } else {
        response = executeCurrentRequest(currentRequest);
      }
      boolean returningResponse = false;
      try {
        if (response.isSuccessStatusCode()) {
          totalBytesServerReceived = getMediaContentLength();
          if (mediaContent.getCloseInputStream()) {
            contentInputStream.close();
          }
          updateStateAndNotifyListener(UploadState.MEDIA_COMPLETE);
          returningResponse = true;
          return response;
        }

        if (response.getStatusCode() != 308) {
          returningResponse = true;
          return response;
        }

        // Check to see if the upload URL has changed on the server.
        String updatedUploadUrl = response.getHeaders().getLocation();
        if (updatedUploadUrl != null) {
          uploadUrl = new GenericUrl(updatedUploadUrl);
        }

        // we check the amount of bytes the server received so far, because the server may process
        // fewer bytes than the amount of bytes the client had sent
        long newBytesServerReceived = getNextByteIndex(response.getHeaders().getRange());
        // the server can receive any amount of bytes from 0 to current chunk length
        long currentBytesServerReceived = newBytesServerReceived - totalBytesServerReceived;
        Preconditions.checkState(
            currentBytesServerReceived >= 0 && currentBytesServerReceived <= currentChunkLength);
        long copyBytes = currentChunkLength - currentBytesServerReceived;
        if (isMediaLengthKnown()) {
          if (copyBytes > 0) {
            // If the server didn't receive all the bytes the client sent the current position of
            // the input stream is incorrect. So we should reset the stream and skip those bytes
            // that the server had already received.
            // Otherwise (the server got all bytes the client sent), the stream is in its right
            // position, and we can continue from there
            contentInputStream.reset();
            long actualSkipValue = contentInputStream.skip(currentBytesServerReceived);
            Preconditions.checkState(currentBytesServerReceived == actualSkipValue);
          }
        } else if (copyBytes == 0) {
          // server got all the bytes, so we don't need to use this buffer. Otherwise, we have to
          // keep the buffer and copy part (or all) of its bytes to the stream we are sending to the
          // server
          currentRequestContentBuffer = null;
        }
        totalBytesServerReceived = newBytesServerReceived;

        updateStateAndNotifyListener(UploadState.MEDIA_IN_PROGRESS);
      } finally {
        if (!returningResponse) {
          response.disconnect();
        }
      }
    }
  }
439706
public GetAppStreamResponse queryAppStream(GetAppStreamRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getApp(), "The parameter app should NOT be null or empty string.");
        checkStringNotEmpty(request.getStream(), "The parameter stream should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_APP,
                request.getApp(), LIVE_SESSION, request.getStream());
        return invokeHttpClient(internalRequest, GetAppStreamResponse.class);
    }
894752
public CreateEipResponse createEip(CreateEipRequest request) {
        checkNotNull(request.getBandwidthInMbps(), "bandwidthInMbps should not be null");
        if (Strings.isNullOrEmpty(request.getClientToken())) {
            request.setClientToken(generateDefaultClientToken());
        }
        if (null == request.getBilling()) {
            request.setBilling(generateDefaultBilling());
        }
        checkNotNull(request.getBandwidthInMbps(), "bandwidthInMbps should not be null");
        InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST, null);

        internalRequest.addParameter(CLIENT_TOKEN_IDENTIFY, request.getClientToken());
        fillPayload(internalRequest, request);
        return invokeHttpClient(internalRequest, CreateEipResponse.class);
    }
192138
@Nullable
    private Request makeRequest(List<MobileEventJson> batch) throws IOException {
        if (batch.isEmpty()) {
            return null;
        }

        Sift.Config config = configProvider.getConfig();

        if (config == null) {
            Log.d(TAG, "Missing Sift.Config object");
            return null;
        }

        if (config.accountId == null || config.beaconKey == null || config.serverUrlFormat == null) {
            Log.d(TAG, "Missing account ID, beacon key, and/or server URL format");
            return null;
        }

        if (batch.isEmpty()) {
            Log.d(TAG, "Batch is null or empty");
            return null;
        }

        URL url = new URL(String.format(config.serverUrlFormat, config.accountId));

        final String encodedBeaconKey = Base64.encodeToString(
                config.beaconKey.getBytes(US_ASCII), Base64.NO_WRAP);

        Map<String, String> headers = new HashMap<String, String>();
        headers.put("Authorization", "Basic " + encodedBeaconKey);
        headers.put("Accept", "application/json");
        headers.put("Content-Encoding", "gzip");
        headers.put("Content-Type", "application/json");

        ListRequestJson request = new ListRequestJson()
                .withData(Collections.<Object>unmodifiableList(batch));

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        OutputStream gzip = new GZIPOutputStream(os);
        Writer writer = new OutputStreamWriter(gzip, UTF8);
        Sift.GSON.toJson(request, writer);
        writer.close();

        Log.d(TAG, String.format("Built HTTP request for batch of size %d", batch.size()));

        return new Request.Builder()
                .withMethod("PUT")
                .withUrl(url)
                .withHeaders(headers)
                .withBody(os.toByteArray())
                .build();
    }
631834
public LastPointQuery parseLastPointQueryV1() {
    final String json = query.getContent();
    if (json == null || json.isEmpty()) {
      throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
          "Missing message content",
          "Supply valid JSON formatted data in the body of your request");
    }
    try {
      return JSON.parseToObject(json, LastPointQuery.class);
    } catch (IllegalArgumentException iae) {
      throw new BadRequestException("Unable to parse the given JSON", iae);
    }
  }