Class Glance

java.lang.Object
de.svenkubiak.jpushover.apis.Glance
All Implemented Interfaces:
API

public class Glance extends Object implements API
  • Constructor Details

    • Glance

      public Glance()
  • Method Details

    • withToken

      public Glance withToken(String token)
      Your application's API token (required)
      Parameters:
      token - The pushover API token
      Returns:
      Glance instance
    • withUser

      public Glance withUser(String user)
      The user/group key (not e-mail address) of your user (or you), viewable when logged into the @see pushover dashboard (required)
      Parameters:
      user - The username
      Returns:
      Glance instance
    • withDevice

      public Glance withDevice(String device)
      Your user's device name to send the message directly to that device, rather than all of the user's devices (optional)
      Parameters:
      device - The device name
      Returns:
      Glance instance
    • withTitle

      public Glance withTitle(String title)
      A description of the data being shown, such as "Widgets Sold"
      Parameters:
      title - the title to use
      Returns:
      Glance instance
    • withText

      public Glance withText(String text)
      The main line of data, used on most screens
      Parameters:
      text - the text to use
      Returns:
      Glance instance
    • withSubtext

      public Glance withSubtext(String subtext)
      A second line of data
      Parameters:
      subtext - the subtext to use
      Returns:
      Glance instance
    • withCount

      public Glance withCount(int count)
      Shown on smaller screens; useful for simple counts
      Parameters:
      count - the count to use
      Returns:
      Glance instance
    • withPercent

      public Glance withPercent(int percent)
      Shown on some screens as a progress bar/circle
      Parameters:
      percent - the percent to use
      Returns:
      GLance instance
    • withProxy

      public Glance withProxy(String proxyHost, int proxyPort)
      Sets the host and port for a proxy connection if needed
      Parameters:
      proxyHost - the host for the proxy
      proxyPort - the port for the proxy
      Returns:
      GLance instance
    • push

      public PushoverResponse push() throws JPushoverException
      Sends a glance to pushover
      Specified by:
      push in interface API
      Returns:
      PushoverResponse instance
      Throws:
      JPushoverException - on failure
    • pushAsync

      public Future<PushoverResponse> pushAsync()
      Sends a glance to pushover asynchronously
      Returns:
      PushoverResponse instance
    • getValue

      public String getValue(String param)