Interface HSAdapter


public interface HSAdapter
  • Method Details

    • addHandleValues

      void addHandleValues(String handle, HandleValue[] values) throws HandleException
      Adds new handle records.
      Note:
    • The administrative priveleges have to be valid for this method to perform without any exception
    • Parameters:
      handle - The handle into which new values are to be added
      values - The array of handle values to deposit
      Throws:
      HandleException
    • createAdminValue

      HandleValue createAdminValue(String adminHandle, int keyIndex, int index) throws HandleException
      Creates an administrative record with the adminHandle and adminIndex at the index. Note this does not get added to any handle. Also, the administrator has complete permissions. For the types of permissions, please refer to the Handle.net Technical Manual.
      Parameters:
      adminHandle - The admin handle for this handle value
      keyIndex - The index of the public key in the admin Handle
      index - Which index to put this information at.
      Returns:
      A new HandleValue containing the admin value
      Throws:
      HandleException
    • createHandle

      void createHandle(String handle, HandleValue[] values) throws HandleException
      Creates a new handle. If the handle already exists, the method will throw an exception. The proper course of action is then to delete the handle and call the method again.
      Parameters:
      handle - The handle to create
      values - An array of handle values to add to the handle. Note: Note:
    • It is important to add admin handle value in order to administer this handle at a later point.
    • The administrative priveleges have to be valid for this method to perform without any exception
    • Throws:
      HandleException - Describes the error that occured in the process of creating the handle.
    • createHandleValue

      HandleValue createHandleValue(int index, String type, String data) throws HandleException
      Creates a new handle value. Note this does not get added to any handle. The default permissions are adminRead=true, adminWrite=true, publicRead=true, and publicWrite=false. Override the permissions once the HandleValue is created for enforcing different permissions.
      Parameters:
      index - Which index to put this information at.
      type - The type of the handle value
      data - The data for this handle value Otherwise not.
      Throws:
      HandleException
    • deleteHandle

      void deleteHandle(String handle) throws HandleException
      Deletes an existing Handle from the handle server.
      Note:
    • The administrative priveleges have to be valid for this method to perform without any exception
    • Parameters:
      handle - The handle to delete.
      Throws:
      HandleException
    • deleteHandleValues

      void deleteHandleValues(String handle, HandleValue[] values) throws HandleException
      Deletes a specific set of handle values in a Handle.
      Note:
    • The administrative priveleges have to be valid for this method to perform without any exception
    • Parameters:
      handle - The Handle that we want to delete values from
      values - An array of handle values to delete.
      Throws:
      HandleException - Describes the error that occured while executing the method.
    • resolveHandle

      HandleValue[] resolveHandle(String handle, String[] types, int[] indexes, boolean auth) throws HandleException
      Resolves a handle and returns a set of handle values that satisfy the type filter specified. If the resolution is to retrieve all handle values, specify null for both filter and indexes. If the administrative priveleges are applicable, the restricted values will also be returned.
      Parameters:
      handle - The value of the handle to resolve
      types - The types of the handle values that we are looking for.
      auth - Whether to perform an authoritative resolution
      Throws:
      HandleException - Describes the error in resolution
    • resolveHandle

      HandleValue[] resolveHandle(String handle, String[] types, int[] indexes) throws HandleException
      Resolves a handle and returns a set of handle values that satisfy the type filter specified. If the resolution is to retrieve all handle values, specify null for both filter and indexes. If the administrative priveleges are applicable, the restricted values will also be returned. Also, the resolution request is not authoritative.
      Parameters:
      handle - The value of the handle to resolve
      types - The types of the handle values that we are looking for.
      Throws:
      HandleException - Describes the error in resolution
    • setTcpTimeout

      void setTcpTimeout(int newTcpTimeout)
      Set how long to wait for responses to TCP and HTTP requests.
      Parameters:
      newTcpTimeout - Milliseconds to use for timeout.
    • getTcpTimeout

      int getTcpTimeout()
      Get how long to wait for responses to TCP and HTTP requests.
    • setUseUDP

      void setUseUDP(boolean useUDP)
      Adds and prioritizes the UDP for communication with the Handle server.
      Parameters:
      useUDP - The boolean flag that specifies the use of UDP.
    • updateHandleValues

      void updateHandleValues(String handle, HandleValue[] values) throws HandleException
      Updates the specified data handle values.
      Note:
    • Make sure that the index value is specified in the array of handle values or else this method will not work well.
    • The administrative priveleges have to be valid for this method to perform without any exception
    • Parameters:
      handle -
      values -
      Throws:
      HandleException