Class Vantiq

java.lang.Object
io.vantiq.client.Vantiq

public class Vantiq extends Object
Vantiq SDK for Java/Android API
  • Constructor Details

    • Vantiq

      public Vantiq(String server, int apiVersion)
      Constructs a Vantiq SDK instance against a specific Vantiq server URL using a specific REST API version.
      Parameters:
      server - The URL of the Vantiq server
      apiVersion - The REST API version to use
    • Vantiq

      public Vantiq(String server, int apiVersion, okhttp3.Authenticator proxyAuthenticator)
      Constructs a Vantiq SDK instance against a specific Vantiq server URL using a specific REST API version.

      The proxyAuthenticator is only required when the proxy requires authentication other than Basic user and password. The internal authenticator will provide those as required, based on the Java standard properties.

      Parameters:
      server - The URL of the Vantiq server
      apiVersion - The REST API version to use
      proxyAuthenticator - okhttp3.Authenticator Used to authenticate with a network proxy.
    • Vantiq

      public Vantiq(String server)
      Constructs a Vantiq SDK instance against a specific Vantiq server using the latest version of the API.
      Parameters:
      server - The URL of the Vantiq server
    • Vantiq

      public Vantiq(String server, okhttp3.Authenticator proxyAuthenticator)
      Constructs a Vantiq SDK instance against a specific Vantiq server using the latest version of the API.

      The proxyAuthenticator is only required when the proxy requires authentication other than Basic user and password. The internal authenticator will provide those as required, based on the Java standard properties.

      Parameters:
      server - The URL of the Vantiq server
      proxyAuthenticator - okhttp3.Authenticator Used to authenticate with a network proxy.
  • Method Details

    • isAuthenticated

      public boolean isAuthenticated()
      Returns if this Vantiq instance has been successfully authenticated with the Vantiq server instance.
      Returns:
      true if authenticated successfully
    • getServer

      public String getServer()
      Returns the server that was assigned when this user was successfully logged in with the Vantiq server instance (or null if not currently logged in).
      Returns:
      server string or null
    • setServer

      public void setServer(String server)
      Sets the server; this is used if the app has remembered an old server and wants to re-use it. (It could also be used to "un-authenticate", setting the server to null.
      Parameters:
      server - The server to be used to avoid calling "authenticate"
    • getUsername

      public String getUsername()
      Returns the username that was assigned when this user was successfully logged in with the Vantiq username instance (or null if not currently logged in).
      Returns:
      username string or null
    • setUsername

      public void setUsername(String username)
      Sets the username; this is used if the app has remembered an old username and wants to re-use it. (It could also be used to "un-authenticate", setting the username to null.
      Parameters:
      username - The username to be used to avoid calling "authenticate"
    • isEnablePings

      public boolean isEnablePings()
      Returns if pinging should be enabled on the websockets for subscriptions to ensure the connection is kept open. By default, pinging is enabled.
      Returns:
      Indicates this client should send periodic pings to the server
    • setEnablePings

      public void setEnablePings(boolean enablePings)
      Sets if pinging should be enabled on the websockets for subscriptions to ensure the connection is kept open. By default, pinging is enabled.
      Parameters:
      enablePings - True indicates this client should send periodic pings to the server
    • authenticate

      public void authenticate(String username, String password, ResponseHandler responseHandler)
      Authenticates this Vantiq instance using the given credentials asynchronously. The response handler "onSuccess" will return true if the authentication was successful.
      Parameters:
      username - The username for the Vantiq server
      password - The password for the Vantiq server
      responseHandler - The response handler that is called upon completion.
    • authenticate

      public VantiqResponse authenticate(String username, String password)
      Authenticates this Vantiq instance using the given credentials synchronously.
      Parameters:
      username - The username for the Vantiq server
      password - The password for the Vantiq server
      Returns:
      The response from the Vantiq server
    • revoke

      public void revoke(String accessToken, ResponseHandler responseHandler)
      Revokes the given accessToken asynchronously. The response handler "onSuccess" will return true if the authentication was successful.
      Parameters:
      accessToken - The accessToken to be revoked
      responseHandler - The response handler that is called upon completion.
    • revoke

      public VantiqResponse revoke(String accessToken)
      Revokes the given accessToken synchronously.
      Parameters:
      accessToken - The accessToken to be revoked
      Returns:
      The response from the Vantiq server
    • refresh

      public void refresh(String accessToken, ResponseHandler responseHandler)
      Refreshes the given accessToken asynchronously. The response handler "onSuccess" will return true if the refresh was successful.
      Parameters:
      accessToken - The accessToken to be refreshed
      responseHandler - The response handler that is called upon completion.
    • refresh

      public VantiqResponse refresh(String accessToken)
      Refreshes the given accessToken synchronously.
      Parameters:
      accessToken - The accessToken to be refreshed
      Returns:
      The response from the Vantiq server
    • buildPath

      public String buildPath(String qualifiedName, String id)
    • select

      public void select(String resource, List<String> propSpecs, Object where, SortSpec sortSpec, ResponseHandler responseHandler)
      Performs a query to search for records that match the given constraints asynchronously. The response body will be a List of JsonObject objects.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      propSpecs - The optional list of properties to return in each record. A null or empty list returns all properties.
      where - The optional where constraint that filters the records returned. The where is structured following the structure outline in the API Documentation.
      sortSpec - The optional sort specification to order the returned records.
      responseHandler - The response handler that is called upon completion.
    • batch

      public void batch(com.google.gson.JsonArray requests, ResponseHandler responseHandler)
      Performs a batch query, specified by a JSON array. This is currently for internal use only and is not documented.
      Parameters:
      requests - A JsonArray of "request objects", each looking something like this: { "method": "GET", "headers": { "Content-type": "application/json" }, "uri": /types?where={"name":"ArsType"} } Note that anything past the "?" in the "uri" (which means the "where" clause in this case) must be URL encoded.
      responseHandler - The response handler that is called upon completion.
    • batch

      public VantiqResponse batch(com.google.gson.JsonArray requests)
      Performs a synchronous batch query, specified by a JSON array. This is currently for internal use only and is not documented.
      Parameters:
      requests - A JsonArray of "request objects", each looking something like this: { "method": "GET", "headers": { "Content-type": "application/json" }, "uri": /types?where={"name":"ArsType"} } Note that anything past the "?" in the "uri" (which means the "where" clause in this case) must be URL encoded.
      Returns:
      The response from the Vantiq server
    • select

      public VantiqResponse select(String resource, List<String> propSpecs, Object where, SortSpec sortSpec)
      Returns the record for the given resource and specified id. The response is a single JsonObject. Performs a query to search for records that match the given constraints synchronously. The response body will be a List of JsonObject objects.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      propSpecs - The optional list of properties to return in each record. A null or empty list returns all properties.
      where - The optional where constraint that filters the records returned. The where is structured following the structure outline in the API Documentation.
      sortSpec - The optional sort specification to order the returned records.
      Returns:
      The response from the Vantiq server
    • select

      public VantiqResponse select(String resource, List<String> propSpecs, Object where, SortSpec sortSpec, long limit)
      Returns the record for the given resource and specified id. The response is a single JsonObject. Performs a query to search for records that match the given constraints synchronously. The response body will be a List of JsonObject objects.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      propSpecs - The optional list of properties to return in each record. A null or empty list returns all properties.
      where - The optional where constraint that filters the records returned. The where is structured following the structure outline in the API Documentation.
      sortSpec - The optional sort specification to order the returned records.
      limit - A limit to the number of records returned (limit less then or equals to 0 means no limit)
      Returns:
      The response from the Vantiq server
    • select

      public VantiqResponse select(String resource, List<String> propSpecs, Object where, SortSpec sortSpec, long limit, Map<String,String> options)
      Returns the record for the given resource and specified id. The response is a single JsonObject. Performs a query to search for records that match the given constraints synchronously. The response body will be a List of JsonObject objects.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      propSpecs - The optional list of properties to return in each record. A null or empty list returns all properties.
      where - The optional where constraint that filters the records returned. The where is structured following the structure outline in the API Documentation.
      sortSpec - The optional sort specification to order the returned records.
      limit - A limit to the number of records returned (limit less then or equals to 0 means no limit)
      options - Any additional options to be added to the queryParams
      Returns:
      The response from the Vantiq server
    • selectOne

      public void selectOne(String resource, String id, ResponseHandler responseHandler)
      Returns the record for the given resource and specified id asynchronously. The response is a single JsonObject.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      id - The key used to lookup the record. The underlying "_id" can be used.
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • selectOne

      public VantiqResponse selectOne(String resource, String id)
      Returns the record for the given resource and specified id synchronously. The response is a single JsonObject.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      id - The key used to lookup the record. The underlying "_id" can be used.
      Returns:
      The response from the Vantiq server
    • count

      public void count(String resource, Object where, ResponseHandler responseHandler)
      This method is similar to select(java.lang.String, java.util.List<java.lang.String>, java.lang.Object, io.vantiq.client.SortSpec, io.vantiq.client.ResponseHandler) except returns only the count of matching records. The response is an Integer.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      where - The optional where constraint that filters the records returned. The where is structured following the structure outline in the API Documentation.
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • count

      public VantiqResponse count(String resource, Object where)
      This method is similar to select(java.lang.String, java.util.List<java.lang.String>, java.lang.Object, io.vantiq.client.SortSpec, io.vantiq.client.ResponseHandler) except returns only the count of matching records. The response is an Integer.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      where - The optional where constraint that filters the records returned. The where is structured following the structure outline in the API Documentation.
      Returns:
      The response from the Vantiq server
    • rawGet

      public void rawGet(String fullPath, Map<String,String> queryParams, Map<String,String> extraHeaders, ResponseHandler responseHandler)
      Do a GET against the specified raw path type asynchronously.
      Parameters:
      fullPath - The full path to use
      queryParams - optional query parameters
      extraHeaders - optional headers
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • rawGet

      public VantiqResponse rawGet(String fullPath, Map<String,String> queryParams, Map<String,String> extraHeaders)
      Do a GET against the specified raw path type synchronously.
      Parameters:
      fullPath - The full path to use
      queryParams - optional query parameters
      extraHeaders - optional headers
      Returns:
      The response from the Vantiq server
    • post

      public void post(String path, Object object, ResponseHandler responseHandler)
      Do a POST (insert) of the supplied data using the specified path type asynchronously.
      Parameters:
      path - The path to use
      object - The object to insert. This will be converted to JSON using Gson.
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • post

      public VantiqResponse post(String path, Object object)
      Do a POST (insert) of the supplied data using the specified path synchronously.
      Parameters:
      path - The path to use
      object - The object to insert. This will be converted to JSON using Gson.
      Returns:
      The response from the Vantiq server
    • put

      public void put(String path, Object object, ResponseHandler responseHandler)
      Do a PUT (update) of the supplied data using the specified path type asynchronously.
      Parameters:
      path - The path to use
      object - The object to insert. This will be converted to JSON using Gson.
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • put

      public VantiqResponse put(String path, Object object)
      Do a PUT (update) of the supplied data using the specified path synchronously.
      Parameters:
      path - The path to use
      object - The object to insert. This will be converted to JSON using Gson.
      Returns:
      The response from the Vantiq server
    • del

      public void del(String path, ResponseHandler responseHandler)
      Do a DELETE using the specified path asynchronously. The response is a boolean indicating the success of the removal.
      Parameters:
      path - The path to use
      responseHandler - The response handler that is called upon completion.
    • del

      public VantiqResponse del(String path)
      Do a DELETE using the specified path synchronously. The response is a boolean indicating the success of the removal.
      Parameters:
      path - The path to use
      Returns:
      The response from the Vantiq server
    • insert

      public void insert(String resource, Object object, ResponseHandler responseHandler)
      Inserts a new record of the specified resource type asynchronously. The response is a JsonObject of the record just inserted.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      object - The object to insert. This will be converted to JSON using Gson.
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • insert

      public VantiqResponse insert(String resource, Object object)
      Inserts a new record of the specified resource type synchronously. The response is a JsonObject of the record just inserted.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      object - The object to insert. This will be converted to JSON using Gson.
      Returns:
      The response from the Vantiq server
    • update

      public void update(String resource, String id, Object object, ResponseHandler responseHandler)
      Updates an existing record of the specified resource type asynchronously. The response is a JsonObject of the record just updated.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      id - The key used to lookup the record. The underlying "_id" can be used.
      object - The object to insert. This will be converted to JSON using Gson.
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • update

      public VantiqResponse update(String resource, String id, Object object)
      Updates an existing record of the specified resource type synchronously. The response is a JsonObject of the record just updated.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      id - The key used to lookup the record. The underlying "_id" can be used.
      object - The object to insert. This will be converted to JSON using Gson.
      Returns:
      The response from the Vantiq server
    • upsert

      public void upsert(String resource, Object object, ResponseHandler responseHandler)
      Upserts a record of the specified resource type asynchronously. If the record does not already exist, then a new record is inserted. If the record does exist, then the record is updated. The existence of the record is defined by the natural key defined on the type. The response is a JsonObject that is the record just upserted.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      object - The object to insert. This will be converted to JSON using Gson.
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • upsert

      public VantiqResponse upsert(String resource, Object object)
      Upserts a record of the specified resource type synchronously. If the record does not already exist, then a new record is inserted. If the record does exist, then the record is updated. The existence of the record is defined by the natural key defined on the type. The response is a JsonObject that is the record just upserted.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      object - The object to insert. This will be converted to JSON using Gson.
      Returns:
      The response from the Vantiq server
    • delete

      public void delete(String resource, Object where, ResponseHandler responseHandler)
      Deletes the matching records specified by a where constraint asynchronously. The response is a boolean indicating the success of the removal.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      where - The required where constraint that filters the records returned. The where is structured following the structure outline in the API Documentation.
      responseHandler - The response handler that is called upon completion.
    • delete

      public VantiqResponse delete(String resource, Object where)
      Deletes the matching records specified by a where constraint synchronously. The response is a boolean indicating the success of the removal.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      where - The required where constraint that filters the records returned. The where is structured following the structure outline in the API Documentation.
      Returns:
      The response from the Vantiq server
    • deleteOne

      public void deleteOne(String resource, String id, ResponseHandler responseHandler)
      Deletes the record for the given resource and specified id asynchronously. The response is a boolean indicating the success of the removal.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      id - The key used to lookup the record. The underlying "_id" can be used.
      responseHandler - The response handler that is called upon completion.
    • deleteOne

      public VantiqResponse deleteOne(String resource, String id)
      Deletes the record for the given resource and specified id synchronously. The response is a boolean indicating the success of the removal.
      Parameters:
      resource - The resource to query. This can be a SystemResources value or a user-defined type name.
      id - The key used to lookup the record. The underlying "_id" can be used.
      Returns:
      The response from the Vantiq server
    • publish

      public void publish(String resource, String id, Object payload, ResponseHandler responseHandler)
      Publishes to a specific topic or source asynchronously. A publish operation is fire-and-forget. The response is a boolean indicating the success of the publish. For sources, the parameters required are source specific and are the same as those required when performing a PUBLISH ... TO SOURCE ... USING params. Please refer to the specific source definition documentation in the Vantiq API Documentation.
      Parameters:
      resource - The resource to query. This must be the value of either Vantiq.SystemResources.TOPICS or Vantiq.SystemResources.SOURCES.
      id - The topic or source to publish.
      payload - For a topic, this is the message to publish. For a source, this is the parameters that defines the publish. This will be converted to JSON using Gson.
      responseHandler - The response handler that is called upon completion.
    • publish

      public VantiqResponse publish(String resource, String id, Object payload)
      Publishes to a specific topic or source synchronously. A publish operation is fire-and-forget. The response is a boolean indicating the success of the publish. For sources, the parameters required are source specific and are the same as those required when performing a PUBLISH ... TO SOURCE ... USING params. Please refer to the specific source definition documentation in the Vantiq API Documentation.
      Parameters:
      resource - The resource to query. This must be the value of either Vantiq.SystemResources.TOPICS or Vantiq.SystemResources.SOURCES.
      id - The topic or source to publish.
      payload - For a topic, this is the message to publish. For a source, this is the parameters that defines the publish. This will be converted to JSON using Gson.
      Returns:
      The response from the Vantiq server
    • execute

      public void execute(String procedure, Object params, ResponseHandler responseHandler)
      Executes a specific procedure asynchronously. An execute operation is request-response. The response is a JsonObject with the result of the procedure.
      Parameters:
      procedure - The name of the procedure to execute.
      params - The arguments for the procedure. The parameters can be passed as positional parameters using a JsonArray or as named parameters using a JsonObject. The params is converted to JSON using Gson.
      responseHandler - The response handler that is called upon completion.
    • execute

      public VantiqResponse execute(String procedure, Object params)
      Executes a specific procedure synchronously. An execute operation is request-response. The response is a JsonObject with the result of the procedure.
      Parameters:
      procedure - The name of the procedure to execute.
      params - The arguments for the procedure. The parameters can be passed as positional parameters using a JsonArray or as named parameters using a JsonObject. The params is converted to JSON using Gson.
      Returns:
      The response from the Vantiq server
    • query

      public void query(String source, Object params, ResponseHandler responseHandler)
      Performs a query operation on the specified source asynchronously. A query operation is request-response. The response is a JsonObject with the result of the source query operation. The parameters required are source specific and are the same as those required when performing a SELECT ... FROM SOURCE ... WITH params. Please refer to the specific source definition documentation in the Vantiq API Documentation.
      Parameters:
      source - The name of the source to query.
      params - The arguments for the query operation. The params is converted to JSON using Gson.
      responseHandler - The response handler that is called upon completion.
    • query

      public VantiqResponse query(String source, Object params)
      Performs a query operation on the specified source synchronously. A query operation is request-response. The response is a JsonObject with the result of the source query operation. The parameters required are source specific and are the same as those required when performing a SELECT ... FROM SOURCE ... WITH params. Please refer to the specific source definition documentation in the Vantiq API Documentation.
      Parameters:
      source - The name of the source to query.
      params - The arguments for the query operation. The params is converted to JSON using Gson.
      Returns:
      The response from the Vantiq server
    • getNamespaceUsers

      public void getNamespaceUsers(String namespace, ResponseHandler responseHandler)
      Returns a JsonArray containing objects which map between "username" and "preferredUsername"
      Parameters:
      namespace - The namespace
      responseHandler - The response handler that is called upon completion. If null, then the call is performed synchronously and the response is provided as the returned value.
    • getNamespaceUsers

      public VantiqResponse getNamespaceUsers(String namespace)
      Returns a JsonArray containing objects which map between "username" and "preferredUsername"
      Parameters:
      namespace - The namespace
      Returns:
      The response from the Vantiq server
    • upload

      public void upload(File file, String contentType, String documentPath, ResponseHandler responseHandler)
      Performs an upload of the given file asynchronously. The response provides info on the document uploaded.
      Parameters:
      file - The file to upload
      contentType - The MIME type for the file
      documentPath - The path of the document to store in Vantiq
      responseHandler - The response handler that is called upon completion.
    • upload

      public VantiqResponse upload(File file, String contentType, String documentPath)
      Performs an upload of the given file synchronously. The response provides info on the document uploaded.
      Parameters:
      file - The file to upload
      contentType - The MIME type for the file
      documentPath - The path of the file in the Vantiq system
      Returns:
      The response from the Vantiq server
    • upload

      public void upload(File file, String contentType, String filePath, String resourcePath, ResponseHandler responseHandler)
      Performs an upload of the given file asynchronously. The response provides info on the document uploaded.
      Parameters:
      file - The file to upload
      contentType - The MIME type for the file
      filePath - The path of the file to store in Vantiq
      resourcePath - The path of the VANTIQ Resource to upload to
      responseHandler - The response handler that is called upon completion.
    • upload

      public VantiqResponse upload(File file, String contentType, String filePath, String resourcePath)
      Performs an upload of the given file synchronously. The response provides info on the document uploaded.
      Parameters:
      file - The file to upload
      contentType - The MIME type for the file
      filePath - The path of the file in the Vantiq system
      resourcePath - The path of the VANTIQ Resource to upload to
      Returns:
      The response from the Vantiq server
    • download

      public VantiqResponse download(String path)
      Perform the download of a document synchronously from the specified path. This method is expected to be used to download documents uploaded using the upload(File, String, String) or upload(File, String, String, ResponseHandler) methods. The path used here is that returned in the "content" property returned in the response to the "upload" methods. The response body is an InputStream that provides the document content.
      Parameters:
      path - The path to the document to download
      Returns:
      The response from the Vantiq server
    • download

      public void download(String path, ResponseHandler responseHandler)
      Perform the download of a document asynchronously from the specified path. This method is expected to be used to download documents uploaded using the upload(File, String, String) or upload(File, String, String, ResponseHandler) methods. The path used here is that returned in the "content" property returned in the response to the "upload" methods. The response body is an InputStream that provides the document content.
      Parameters:
      path - The path to the document to download
      responseHandler - The response handler that is called when the response starts downloading.
    • subscribe

      public void subscribe(String resource, String id, Vantiq.TypeOperation operation, SubscriptionCallback callback, Map<String,Object> parameters)
      Subscribes to a specific topic, source, or type event. This method uses a WebSocket with the Vantiq server to listen for the specified events. For sources, this will subscribe to message arrival events. The name of the source is required (e.g. "MySource"). For topics, this will subscribe to any messages published on that topic. The name of the topic is required (e.g. "/foo/bar"). For types, this will subscribe to the specified type event. The name of the type and the operation (i.e. "insert", "update", or "delete") is required.
      Parameters:
      resource - The resource whose events to subscribe. This must be the value of Vantiq.SystemResources.TOPICS, Vantiq.SystemResources.SERVICES, or Vantiq.SystemResources.SOURCES Vantiq.SystemResources.TYPES.
      id - The id of the resource
      operation - Only for "types", the specific operation event to subscribe to.
      callback - The callback used when the event is received
      parameters - parameters
    • subscribe

      public void subscribe(String resource, String id, Vantiq.TypeOperation operation, SubscriptionCallback callback)
    • ack

      public void ack(String subscriptionId, String requestId, Map msg) throws IOException
      Acknowledge the receipt of a reliable message
      Parameters:
      subscriptionId - subscription id
      requestId - request id
      msg - Message
      Throws:
      IOException - If request fails
    • unsubscribeAll

      public void unsubscribeAll()
      Unsubscribes to all current subscriptions by closing the WebSocket to the Vantiq server.
    • closeWebsocket

      public void closeWebsocket()
      Closes the websocket to Vantiq
    • setAccessToken

      public void setAccessToken(String accessToken)
      Sets the access token for use in future requests to the Vantiq server. This can be a normal or long-lived token.
      Parameters:
      accessToken - The access token to set
    • getAccessToken

      public String getAccessToken()
      Returns the current access token. If not authenticated, this is null.
      Returns:
      The access token used for requests or null if not an authenticated session.
    • setTargetNamespace

      public void setTargetNamespace(String targetNamespace)
      Sets the target namespace for use in future requests to the Vantiq server.
      Parameters:
      targetNamespace - The target namespace to set for all requests
    • getTargetNamespace

      public String getTargetNamespace()
      Returns the current access token. If not authenticated, this is null.
      Returns:
      The target namespace to be used on all requests
    • getIdToken

      public String getIdToken()
      Returns the current idToken. If not authenticated, this is null.
      Returns:
      The idToken or null if not an authenticated session (or an old pre-OAuth Vantiq server)
    • setReadTimeout

      public void setReadTimeout(long timeout)
      Sets the read timeout for the connection
      Parameters:
      timeout - The timeout duration in milliseconds
    • getReadTimeout

      public long getReadTimeout()
      Returns the read timeout for the connection
      Returns:
      The timeout duration in milliseconds
    • setWriteTimeout

      public void setWriteTimeout(long timeout)
      Sets the write timeout for the connection
      Parameters:
      timeout - The timeout duration in milliseconds
    • getWriteTimeout

      public long getWriteTimeout()
      Returns the write timeout for the connection
      Returns:
      The timeout duration in milliseconds
    • setConnectTimeout

      public void setConnectTimeout(long timeout)
      Sets the connect timeout for the connection
      Parameters:
      timeout - The timeout duration in milliseconds
    • getConnectTimeout

      public long getConnectTimeout()
      Gets the connect timeout for the connection
      Returns:
      The timeout duration in milliseconds