|
Oracle NoSQL Database Examples version 11gR2.2.0.26 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschema.LoginSummary
class LoginSummary
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 | |
---|---|
LoginSummary(String email)
Constructs a user object with its unique identifier, the email address. |
Method Summary | |
---|---|
(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(String email)
Method Detail |
---|
String getEmail()
void setTotalLoginCount(int totalLoginCount)
int getTotalLoginCount()
void setTotalLoginDuration(long totalLoginDuration)
long getTotalLoginDuration()
Key getStoreKey()
Value getStoreValue(Bindings bindings)
void setStoreValue(Bindings bindings, Value value)
public String toString()
toString
in class Object
|
Oracle NoSQL Database Examples version 11gR2.2.0.26 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |