Tabnine Logo
FlashedToken.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
cc.blynk.server.db.model.FlashedToken
constructor

Best Java code snippets using cc.blynk.server.db.model.FlashedToken.<init> (Showing top 3 results out of 315)

origin: blynkkk/blynk-server

public FlashedToken selectFlashedToken(String token) {
  log.info("Select flashed token {}.", token);
  try (Connection connection = ds.getConnection();
     PreparedStatement statement = connection.prepareStatement(selectToken)) {
    statement.setString(1, token);
    try (ResultSet rs = statement.executeQuery()) {
      connection.commit();
      if (rs.next()) {
        return new FlashedToken(rs.getString("token"), rs.getString("app_name"),
            rs.getString("email"), rs.getInt("project_id"), rs.getInt("device_id"),
            rs.getBoolean("is_activated"), rs.getDate("ts")
        );
      }
    }
  } catch (Exception e) {
    log.error("Error getting flashed token.", e);
  }
  return null;
}
origin: blynkkk/blynk-server

  private QrHolder[] makeQRs(User user, String appId, DashBoard dash) throws Exception {
    int tokensCount = dash.devices.length;
    QrHolder[] qrHolders = new QrHolder[tokensCount];
    FlashedToken[] flashedTokens = new FlashedToken[tokensCount];

    int i = 0;
    for (Device device : dash.devices) {
      String newToken = TokenGeneratorUtil.generateNewToken();
      qrHolders[i] = new QrHolder(dash.id, device.id, device.name, newToken,
          QRCode.from(newToken).to(ImageType.JPG).stream().toByteArray());
      flashedTokens[i++] = new FlashedToken(user.email, newToken, appId, dash.id, device.id);
    }

    if (!dbManager.insertFlashedTokens(flashedTokens)) {
      throw new Exception("App Publishing Preview requires enabled DB.");
    }

    return qrHolders;
  }
}
origin: blynkkk/blynk-server

QrHolder qrHolder = new QrHolder(dash.id, -1, null, newToken,
      QRCode.from(newToken).to(ImageType.JPG).stream().toByteArray());
FlashedToken flashedToken = new FlashedToken(to, newToken, publishAppId, dash.id, -1);
cc.blynk.server.db.modelFlashedToken<init>

Popular methods of FlashedToken

    Popular in Java

    • Creating JSON documents from java classes using gson
    • getResourceAsStream (ClassLoader)
    • addToBackStack (FragmentTransaction)
    • requestLocationUpdates (LocationManager)
    • Window (java.awt)
      A Window object is a top-level window with no borders and no menubar. The default layout for a windo
    • OutputStream (java.io)
      A writable sink for bytes.Most clients will use output streams that write data to the file system (
    • InetAddress (java.net)
      An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
    • UUID (java.util)
      UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
    • Modifier (javassist)
      The Modifier class provides static methods and constants to decode class and member access modifiers
    • BoxLayout (javax.swing)
    • From CI to AI: The AI layer in your organization
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now