Skip to content

Commit

Permalink
Bugfixes and readModels for loading multiple models of a type at once.
Browse files Browse the repository at this point in the history
  • Loading branch information
KayLerch committed Jul 8, 2017
1 parent f7f963f commit 42b459f
Show file tree
Hide file tree
Showing 73 changed files with 705 additions and 504 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Join the chat at https://gitter.im/alexa-skills-kit-states-java/Lobby](https://badges.gitter.im/alexa-skills-kit-states-java/Lobby.svg)](https://gitter.im/alexa-skills-kit-states-java/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Maven central](https://img.shields.io/badge/maven%20central-v1.0.2-orange.svg)](http://search.maven.org/#artifactdetails%7Cio.klerch%7Calexa-skills-kit-states-java%7C1.0.2%7Cjar)
[![Maven central](https://img.shields.io/badge/maven%20central-v1.1.0-orange.svg)](http://search.maven.org/#artifactdetails%7Cio.klerch%7Calexa-skills-kit-states-java%7C1.1.0%7Cjar)
![SonarQube Coverage](https://img.shields.io/badge/code%20coverage-82%25-green.svg)

__Reference projects__: The award-winning [Morse-Coder skill](http://alexaskillscentral.com/skills/2016/05/26/morse-coder/) heavily relies on the States SDK. To learn more about this SDK use [the open source of Morse Coder](https://github.com/KayLerch/alexa-morse-coder/) as a reference.
Expand Down Expand Up @@ -27,7 +27,7 @@ Add below Maven dependency to your project.
<dependency>
<groupId>io.klerch</groupId>
<artifactId>alexa-skills-kit-states-java</artifactId>
<version>1.0.2</version>
<version>1.1.0</version>
</dependency>
...
</dependencies>
Expand Down Expand Up @@ -282,8 +282,12 @@ final Optional<AlexaStateObject> obj2 = sh.readValue("myUserStateKey", AlexaScop

You can also read multiple values at once by providing a list of ids the handler should
look after in the store. It returns a list of _AlexaStateObjects_ found in the store.
If you'd like to read multiple models of the same type at once a map is returned instead.
For each model found in the persistence store an entry is added to the map where its key value
is the model-id and the value is the model itself.
```java
final List<AlexaStateObject> obj = sh.readValues("mySessionStateKey", "myUserStateKey");
final Map<String, User> users = sh.readModels(User.class, "Bob", "Abby", "John", "Julia");
```

Also check out what the _exists_ methods can do for you. These methods check existence of
Expand Down
6 changes: 3 additions & 3 deletions docs/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_131) on Fri Jul 07 22:45:51 CEST 2017 -->
<!-- Generated by javadoc (1.8.0_131) on Sat Jul 08 15:56:16 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes (Alexa Skills Kit States SDK for Java 1.0.2 API)</title>
<meta name="date" content="2017-07-07">
<title>All Classes (Alexa Skills Kit States SDK for Java 1.1.0 API)</title>
<meta name="date" content="2017-07-08">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/allclasses-noframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_131) on Fri Jul 07 22:45:51 CEST 2017 -->
<!-- Generated by javadoc (1.8.0_131) on Sat Jul 08 15:56:16 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes (Alexa Skills Kit States SDK for Java 1.0.2 API)</title>
<meta name="date" content="2017-07-07">
<title>All Classes (Alexa Skills Kit States SDK for Java 1.1.0 API)</title>
<meta name="date" content="2017-07-08">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
8 changes: 4 additions & 4 deletions docs/constant-values.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_131) on Fri Jul 07 22:45:50 CEST 2017 -->
<!-- Generated by javadoc (1.8.0_131) on Sat Jul 08 15:56:16 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Constant Field Values (Alexa Skills Kit States SDK for Java 1.0.2 API)</title>
<meta name="date" content="2017-07-07">
<title>Constant Field Values (Alexa Skills Kit States SDK for Java 1.1.0 API)</title>
<meta name="date" content="2017-07-08">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values (Alexa Skills Kit States SDK for Java 1.0.2 API)";
parent.document.title="Constant Field Values (Alexa Skills Kit States SDK for Java 1.1.0 API)";
}
}
catch(err) {
Expand Down
8 changes: 4 additions & 4 deletions docs/deprecated-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_131) on Fri Jul 07 22:45:51 CEST 2017 -->
<!-- Generated by javadoc (1.8.0_131) on Sat Jul 08 15:56:16 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Deprecated List (Alexa Skills Kit States SDK for Java 1.0.2 API)</title>
<meta name="date" content="2017-07-07">
<title>Deprecated List (Alexa Skills Kit States SDK for Java 1.1.0 API)</title>
<meta name="date" content="2017-07-08">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Deprecated List (Alexa Skills Kit States SDK for Java 1.0.2 API)";
parent.document.title="Deprecated List (Alexa Skills Kit States SDK for Java 1.1.0 API)";
}
}
catch(err) {
Expand Down
8 changes: 4 additions & 4 deletions docs/help-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_131) on Fri Jul 07 22:45:51 CEST 2017 -->
<!-- Generated by javadoc (1.8.0_131) on Sat Jul 08 15:56:16 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>API Help (Alexa Skills Kit States SDK for Java 1.0.2 API)</title>
<meta name="date" content="2017-07-07">
<title>API Help (Alexa Skills Kit States SDK for Java 1.1.0 API)</title>
<meta name="date" content="2017-07-08">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="API Help (Alexa Skills Kit States SDK for Java 1.0.2 API)";
parent.document.title="API Help (Alexa Skills Kit States SDK for Java 1.1.0 API)";
}
}
catch(err) {
Expand Down
28 changes: 17 additions & 11 deletions docs/index-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_131) on Fri Jul 07 22:45:51 CEST 2017 -->
<!-- Generated by javadoc (1.8.0_131) on Sat Jul 08 15:56:16 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Index (Alexa Skills Kit States SDK for Java 1.0.2 API)</title>
<meta name="date" content="2017-07-07">
<title>Index (Alexa Skills Kit States SDK for Java 1.1.0 API)</title>
<meta name="date" content="2017-07-08">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Index (Alexa Skills Kit States SDK for Java 1.0.2 API)";
parent.document.title="Index (Alexa Skills Kit States SDK for Java 1.1.0 API)";
}
}
catch(err) {
Expand Down Expand Up @@ -525,21 +525,25 @@ <h2 class="title">R</h2>
<dd>
<div class="block">Reads out the model from the persistence store of this handler.</div>
</dd>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AWSDynamoStateHandler.html#readModel-java.lang.Class-java.lang.String-">readModel(Class&lt;TModel&gt;, String)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AWSDynamoStateHandler.html" title="class in io.klerch.alexa.state.handler">AWSDynamoStateHandler</a></dt>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AWSIotStateHandler.html#readModel-java.lang.Class-">readModel(Class&lt;TModel&gt;)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AWSIotStateHandler.html" title="class in io.klerch.alexa.state.handler">AWSIotStateHandler</a></dt>
<dd>
<div class="block">Reads out the model from the persistence store of this handler.</div>
</dd>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AWSIotStateHandler.html#readModel-java.lang.Class-">readModel(Class&lt;TModel&gt;)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AWSIotStateHandler.html" title="class in io.klerch.alexa.state.handler">AWSIotStateHandler</a></dt>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AlexaSessionStateHandler.html#readModels-java.lang.Class-java.util.Collection-">readModels(Class&lt;TModel&gt;, Collection&lt;String&gt;)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AlexaSessionStateHandler.html" title="class in io.klerch.alexa.state.handler">AlexaSessionStateHandler</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AlexaStateHandler.html#readModels-java.lang.Class-java.util.Collection-">readModels(Class&lt;TModel&gt;, Collection&lt;String&gt;)</a></span> - Method in interface io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AlexaStateHandler.html" title="interface in io.klerch.alexa.state.handler">AlexaStateHandler</a></dt>
<dd>
<div class="block">Reads out the model from the persistence store of this handler.</div>
<div class="block">Reads out models from the persistence store of this handler.</div>
</dd>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AWSIotStateHandler.html#readModel-java.lang.Class-java.lang.String-">readModel(Class&lt;TModel&gt;, String)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AWSIotStateHandler.html" title="class in io.klerch.alexa.state.handler">AWSIotStateHandler</a></dt>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AWSDynamoStateHandler.html#readModels-java.lang.Class-java.util.Collection-">readModels(Class&lt;TModel&gt;, Collection&lt;String&gt;)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AWSDynamoStateHandler.html" title="class in io.klerch.alexa.state.handler">AWSDynamoStateHandler</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AWSIotStateHandler.html#readModels-java.lang.Class-java.util.Collection-">readModels(Class&lt;TModel&gt;, Collection&lt;String&gt;)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AWSIotStateHandler.html" title="class in io.klerch.alexa.state.handler">AWSIotStateHandler</a></dt>
<dd>
<div class="block">Reads out the model from the persistence store of this handler.</div>
<div class="block">Reads out models from the persistence store of this handler.</div>
</dd>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AWSS3StateHandler.html#readModel-java.lang.Class-java.lang.String-">readModel(Class&lt;TModel&gt;, String)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AWSS3StateHandler.html" title="class in io.klerch.alexa.state.handler">AWSS3StateHandler</a></dt>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AWSS3StateHandler.html#readModels-java.lang.Class-java.util.Collection-">readModels(Class&lt;TModel&gt;, Collection&lt;String&gt;)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AWSS3StateHandler.html" title="class in io.klerch.alexa.state.handler">AWSS3StateHandler</a></dt>
<dd>
<div class="block">Reads out the model from the persistence store of this handler.</div>
<div class="block">Reads out models from the persistence store of this handler.</div>
</dd>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/handler/AlexaSessionStateHandler.html#readValue-java.lang.String-">readValue(String)</a></span> - Method in class io.klerch.alexa.state.handler.<a href="io/klerch/alexa/state/handler/AlexaSessionStateHandler.html" title="class in io.klerch.alexa.state.handler">AlexaSessionStateHandler</a></dt>
<dd>
Expand Down Expand Up @@ -651,6 +655,8 @@ <h2 class="title">R</h2>
<div class="block">Removes multiple value states from the persistence store with given keys used
when those values were written in store.</div>
</dd>
<dt><span class="memberNameLink"><a href="io/klerch/alexa/state/model/AlexaStateModel.html#resolveAttributeKeyToId-java.lang.Class-java.lang.String-">resolveAttributeKeyToId(Class&lt;TModel&gt;, String)</a></span> - Static method in class io.klerch.alexa.state.model.<a href="io/klerch/alexa/state/model/AlexaStateModel.html" title="class in io.klerch.alexa.state.model">AlexaStateModel</a></dt>
<dd>&nbsp;</dd>
</dl>
<a name="I:S">
<!-- -->
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_131) on Fri Jul 07 22:45:51 CEST 2017 -->
<!-- Generated by javadoc (1.8.0_131) on Sat Jul 08 15:56:16 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Alexa Skills Kit States SDK for Java 1.0.2 API</title>
<title>Alexa Skills Kit States SDK for Java 1.1.0 API</title>
<script type="text/javascript">
tmpTargetPage = "" + window.location.search;
if (tmpTargetPage != "" && tmpTargetPage != "undefined")
Expand Down
Loading

0 comments on commit 42b459f

Please sign in to comment.