schema

## Class LoginSummary

- java.lang.Object
- - schema.LoginSummary

-      class LoginSummary
      extends Object

  Holds the session summary attributes that are stored as the `Value` for the "/user/EMAIL/-/login" `Key`. Illustrates the use of a Key/Value pair for a parent (non-leaf) `Key`.

  In general, be aware that there are performance trade-offs in storing summary data, as shown in this example, versus computing it using a query when it is needed. For example, we could avoid storing `totalLoginCount` and get the count of events efficiently using a range query on the keys. But we would still need to maintain the `totalLoginDuration` if we wanted to avoid accessing each `LoginSession` to sum the individual values on demand. In some cases, summary data may be expensive enough to recompute that it's worth storing. This is a trade-off that application designers need to make based upon their knowledge of application access patterns.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoginSummary(String email)` Constructs a user object with its unique identifier, the email address.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) String` | `getEmail()` Returns the email identifier.
    `(package private) Key` | `getStoreKey()` Returns a Key that can be used to write or read the LoginSummary.
    `(package private) Value` | `getStoreValue(Bindings bindings)` Serializes the summary attributes into the byte array of a Value.
    `(package private) int` | `getTotalLoginCount()` Returns the total login count.
    `(package private) long` | `getTotalLoginDuration()` Returns the total login duration.
    `(package private) void` | `setStoreValue(Bindings bindings, Value value)` Deserializes the summary attributes from the byte array of a Value.
    `(package private) void` | `setTotalLoginCount(int totalLoginCount)` Changes the total login count.
    `(package private) void` | `setTotalLoginDuration(long totalLoginDuration)` Changes the total login duration.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LoginSummary

          LoginSummary(String email)

      Constructs a user object with its unique identifier, the email address.

  - ### Method Detail

    - #### getEmail

          String getEmail()

      Returns the email identifier.

    - #### setTotalLoginCount

          void setTotalLoginCount(int totalLoginCount)

      Changes the total login count.

    - #### getTotalLoginCount

          int getTotalLoginCount()

      Returns the total login count.

    - #### setTotalLoginDuration

          void setTotalLoginDuration(long totalLoginDuration)

      Changes the total login duration.

    - #### getTotalLoginDuration

          long getTotalLoginDuration()

      Returns the total login duration.

    - #### getStoreKey

          Key getStoreKey()

      Returns a Key that can be used to write or read the LoginSummary.

    - #### getStoreValue

          Value getStoreValue(Bindings bindings)

      Serializes the summary attributes into the byte array of a Value.

    - #### setStoreValue

          void setStoreValue(Bindings bindings,
                           Value value)

      Deserializes the summary attributes from the byte array of a Value.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.