Skip to content

Commit 3586a06

Browse files
committed
Merge branch 'jeffswartz-v2.2-documentation' into modernization
2 parents 9df6cee + f978a1e commit 3586a06

36 files changed

+678
-248
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
The OpenTok Java SDK lets you generate
66
[sessions](http://tokbox.com/opentok/tutorials/create-session/) and
77
[tokens](http://tokbox.com/opentok/tutorials/create-token/) for [OpenTok](http://www.tokbox.com/)
8-
applications that run on the JVM. This version of the SDK also includes support for working with OpenTok
9-
2.0 archives.
8+
applications that run on the JVM. This version of the SDK also includes support for working with
9+
[OpenTok 2.0 archives](http://tokbox.com/#archiving).
1010

11-
# Installation
12-
13-
## Maven Central (recommended):
11+
# Installation using Maven Central (recommended):
1412

1513
The [Maven Central](http://central.sonatype.org/) repository helps manage dependencies for JVM
1614
based projects. It can be used via several build tools, including Maven and Gradle.
@@ -64,22 +62,28 @@ OpenTok opentok = new OpenTok(apiKey, apiSecret)
6462
## Creating Sessions
6563

6664
To create an OpenTok Session, use the `OpenTok` instance's `createSession(SessionProperties properties)`
67-
method. The `properties` parameter is optional and it is used to specify whether you are creating a
68-
p2p Session and specifying a location hint. An instance can be initialized using the
69-
`com.opentok.SessionProperties.Builder` class. The `sessionId` property of the returned `com.opentok.Session`
70-
instance, which you can read using the `getSessionId()` method, is useful to get a sessionId that can
71-
be saved to a persistent store (e.g. database).
65+
method. The `properties` parameter is optional and it is used to specify two things:
66+
67+
* Whether the session uses the OpenTok Media Router
68+
* A location hint for the OpenTok server.
69+
70+
An instance can be initialized using the `com.opentok.SessionProperties.Builder` class.
71+
The `sessionId` property of the returned `com.opentok.Session` instance, which you can read using
72+
the `getSessionId()` method, is useful to get an identifier that can be saved to a persistent store
73+
(such as a database).
7274

7375
```java
7476
import com.opentok.Session;
7577
import com.opentok.SessionProperties;
7678

7779
// Just a plain Session
7880
Session session = opentok.createSession();
79-
// A p2p Session
81+
82+
// A session that attempts to use peer-to-peer streaming
8083
Session session = opentok.createSession(new SessionProperties.Builder()
81-
.p2p(true)
84+
.mediaMode(MediaMode.RELAYED)
8285
.build());
86+
8387
// A Session with a location hint
8488
Session session = opentok.createSession(new SessionProperties.Builder()
8589
.location("12.34.56.78")
@@ -100,7 +104,7 @@ instance can be initialized using the `TokenOptions.Builder` class.
100104

101105
```java
102106
import com.opentok.TokenOptions;
103-
import com.opentok.Roles;
107+
import com.opentok.Role;
104108

105109
// Generate a token from just a sessionId (fetched from a database)
106110
String token = opentok.generateToken(sessionId);
@@ -109,7 +113,7 @@ String token = session.generateToken();
109113

110114
// Set some options in a token
111115
String token = session.generateToken(new TokenOptions.Builder()
112-
.role(Roles.MODERATOR)
116+
.role(Role.MODERATOR)
113117
.expireTime((System.currentTimeMillis() / 1000L) + (7 * 24 * 60 * 60)) // in one week
114118
.data("name=Johnny")
115119
.build());
@@ -181,7 +185,7 @@ repository and follow the Walkthroughs:
181185

182186
# Documentation
183187

184-
Reference documentation is available at <http://www.tokbox.com//opentok/libraries/server/java/reference/index.html> and in the
188+
Reference documentation is available at <http://www.tokbox.com/opentok/libraries/server/java/reference/index.html> and in the
185189
docs directory of the SDK.
186190

187191
# Requirements
@@ -191,6 +195,7 @@ You need an OpenTok API key and API secret, which you can obtain at <https://das
191195
The OpenTok Java SDK requires JDK 6 or greater to compile. Runtime requires Java SE 6 or greater.
192196
This project is tested on both OpenJDK and Oracle implementations.
193197

198+
194199
# Release Notes
195200

196201
See the [Releases](https://github.com/opentok/opentok-java-sdk/releases) page for details

docs/allclasses-frame.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (version 1.7.0_55) on Sat May 17 02:11:37 EDT 2014 -->
6-
<title>All Classes (OpenTok 2.2 Java SDK)</title>
7-
<meta name="date" content="2014-05-17">
5+
<!-- Generated by javadoc (version 1.7.0_40) on Thu May 22 18:08:42 PDT 2014 -->
6+
<title>All Classes (OpenTok Java SDK Reference)</title>
7+
<meta name="date" content="2014-05-22">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
</head>
1010
<body>
@@ -14,6 +14,7 @@ <h1 class="bar">All Classes</h1>
1414
<li><a href="com/opentok/Archive.html" title="class in com.opentok" target="classFrame">Archive</a></li>
1515
<li><a href="com/opentok/Archive.Status.html" title="enum in com.opentok" target="classFrame">Archive.Status</a></li>
1616
<li><a href="com/opentok/exception/InvalidArgumentException.html" title="class in com.opentok.exception" target="classFrame">InvalidArgumentException</a></li>
17+
<li><a href="com/opentok/MediaMode.html" title="enum in com.opentok" target="classFrame">MediaMode</a></li>
1718
<li><a href="com/opentok/OpenTok.html" title="class in com.opentok" target="classFrame">OpenTok</a></li>
1819
<li><a href="com/opentok/exception/OpenTokException.html" title="class in com.opentok.exception" target="classFrame">OpenTokException</a></li>
1920
<li><a href="com/opentok/exception/RequestException.html" title="class in com.opentok.exception" target="classFrame">RequestException</a></li>

docs/allclasses-noframe.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (version 1.7.0_55) on Sat May 17 02:11:37 EDT 2014 -->
6-
<title>All Classes (OpenTok 2.2 Java SDK)</title>
7-
<meta name="date" content="2014-05-17">
5+
<!-- Generated by javadoc (version 1.7.0_40) on Thu May 22 18:08:42 PDT 2014 -->
6+
<title>All Classes (OpenTok Java SDK Reference)</title>
7+
<meta name="date" content="2014-05-22">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
</head>
1010
<body>
@@ -14,6 +14,7 @@ <h1 class="bar">All Classes</h1>
1414
<li><a href="com/opentok/Archive.html" title="class in com.opentok">Archive</a></li>
1515
<li><a href="com/opentok/Archive.Status.html" title="enum in com.opentok">Archive.Status</a></li>
1616
<li><a href="com/opentok/exception/InvalidArgumentException.html" title="class in com.opentok.exception">InvalidArgumentException</a></li>
17+
<li><a href="com/opentok/MediaMode.html" title="enum in com.opentok">MediaMode</a></li>
1718
<li><a href="com/opentok/OpenTok.html" title="class in com.opentok">OpenTok</a></li>
1819
<li><a href="com/opentok/exception/OpenTokException.html" title="class in com.opentok.exception">OpenTokException</a></li>
1920
<li><a href="com/opentok/exception/RequestException.html" title="class in com.opentok.exception">RequestException</a></li>

docs/com/opentok/Archive.Status.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (version 1.7.0_55) on Sat May 17 02:11:37 EDT 2014 -->
6-
<title>Archive.Status (OpenTok 2.2 Java SDK)</title>
7-
<meta name="date" content="2014-05-17">
5+
<!-- Generated by javadoc (version 1.7.0_40) on Thu May 22 18:08:41 PDT 2014 -->
6+
<title>Archive.Status (OpenTok Java SDK Reference)</title>
7+
<meta name="date" content="2014-05-22">
88
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
99
</head>
1010
<body>
1111
<script type="text/javascript"><!--
1212
if (location.href.indexOf('is-external=true') == -1) {
13-
parent.document.title="Archive.Status (OpenTok 2.2 Java SDK)";
13+
parent.document.title="Archive.Status (OpenTok Java SDK Reference)";
1414
}
1515
//-->
1616
</script>
@@ -36,7 +36,7 @@
3636
<div class="subNav">
3737
<ul class="navList">
3838
<li><a href="../../com/opentok/Archive.html" title="class in com.opentok"><span class="strong">Prev Class</span></a></li>
39-
<li><a href="../../com/opentok/OpenTok.html" title="class in com.opentok"><span class="strong">Next Class</span></a></li>
39+
<li><a href="../../com/opentok/MediaMode.html" title="enum in com.opentok"><span class="strong">Next Class</span></a></li>
4040
</ul>
4141
<ul class="navList">
4242
<li><a href="../../index.html?com/opentok/Archive.Status.html" target="_top">Frames</a></li>
@@ -366,7 +366,7 @@ <h4>toString</h4>
366366
<div class="subNav">
367367
<ul class="navList">
368368
<li><a href="../../com/opentok/Archive.html" title="class in com.opentok"><span class="strong">Prev Class</span></a></li>
369-
<li><a href="../../com/opentok/OpenTok.html" title="class in com.opentok"><span class="strong">Next Class</span></a></li>
369+
<li><a href="../../com/opentok/MediaMode.html" title="enum in com.opentok"><span class="strong">Next Class</span></a></li>
370370
</ul>
371371
<ul class="navList">
372372
<li><a href="../../index.html?com/opentok/Archive.Status.html" target="_top">Frames</a></li>

docs/com/opentok/Archive.html

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (version 1.7.0_55) on Sat May 17 02:11:37 EDT 2014 -->
6-
<title>Archive (OpenTok 2.2 Java SDK)</title>
7-
<meta name="date" content="2014-05-17">
5+
<!-- Generated by javadoc (version 1.7.0_40) on Thu May 22 18:08:41 PDT 2014 -->
6+
<title>Archive (OpenTok Java SDK Reference)</title>
7+
<meta name="date" content="2014-05-22">
88
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
99
</head>
1010
<body>
1111
<script type="text/javascript"><!--
1212
if (location.href.indexOf('is-external=true') == -1) {
13-
parent.document.title="Archive (OpenTok 2.2 Java SDK)";
13+
parent.document.title="Archive (OpenTok Java SDK Reference)";
1414
}
1515
//-->
1616
</script>
@@ -140,7 +140,7 @@ <h3>Method Summary</h3>
140140
<tr class="altColor">
141141
<td class="colFirst"><code>long</code></td>
142142
<td class="colLast"><code><strong><a href="../../com/opentok/Archive.html#getCreatedAt()">getCreatedAt</a></strong>()</code>
143-
<div class="block">The time at which the archive was created, in milliseconds since the UNIX epoch.</div>
143+
<div class="block">The time at which the archive was created, in milliseconds since the Unix epoch.</div>
144144
</td>
145145
</tr>
146146
<tr class="rowColor">
@@ -170,8 +170,8 @@ <h3>Method Summary</h3>
170170
<tr class="rowColor">
171171
<td class="colFirst"><code>java.lang.String</code></td>
172172
<td class="colLast"><code><strong><a href="../../com/opentok/Archive.html#getReason()">getReason</a></strong>()</code>
173-
<div class="block">For archives with the status "STOPPED", this can be set to "90 mins exceeded", "failure", "session ended",
174-
or "user initiated".</div>
173+
<div class="block">For archives with the status of Status.STOPPED, this can be set to "90 mins exceeded",
174+
"failure", "session ended", or "user initiated".</div>
175175
</td>
176176
</tr>
177177
<tr class="altColor">
@@ -195,7 +195,7 @@ <h3>Method Summary</h3>
195195
<tr class="rowColor">
196196
<td class="colFirst"><code>java.lang.String</code></td>
197197
<td class="colLast"><code><strong><a href="../../com/opentok/Archive.html#getUrl()">getUrl</a></strong>()</code>
198-
<div class="block">The download URL of the AVAILABLE MP4 file.</div>
198+
<div class="block">The download URL of the available MP4 file.</div>
199199
</td>
200200
</tr>
201201
<tr class="altColor">
@@ -244,7 +244,7 @@ <h4>makeArchive</h4>
244244
<li class="blockList">
245245
<h4>getCreatedAt</h4>
246246
<pre>public&nbsp;long&nbsp;getCreatedAt()</pre>
247-
<div class="block">The time at which the archive was created, in milliseconds since the UNIX epoch.</div>
247+
<div class="block">The time at which the archive was created, in milliseconds since the Unix epoch.</div>
248248
</li>
249249
</ul>
250250
<a name="getDuration()">
@@ -294,8 +294,9 @@ <h4>getPartnerId</h4>
294294
<li class="blockList">
295295
<h4>getReason</h4>
296296
<pre>public&nbsp;java.lang.String&nbsp;getReason()</pre>
297-
<div class="block">For archives with the status "STOPPED", this can be set to "90 mins exceeded", "failure", "session ended",
298-
or "user initiated". For archives with the status "FAILED", this can be set to "system failure".</div>
297+
<div class="block">For archives with the status of Status.STOPPED, this can be set to "90 mins exceeded",
298+
"failure", "session ended", or "user initiated". For archives with the status of
299+
Status.FAILED, this can be set to "system failure".</div>
299300
</li>
300301
</ul>
301302
<a name="getSessionId()">
@@ -335,10 +336,12 @@ <h4>getStatus</h4>
335336
<li class="blockList">
336337
<h4>getUrl</h4>
337338
<pre>public&nbsp;java.lang.String&nbsp;getUrl()</pre>
338-
<div class="block">The download URL of the AVAILABLE MP4 file. This is only set for an archive with the status set to "AVAILABLE";
339-
for other archives, (including archives wit the status "UPLOADED") this method returns null. The download URL is
340-
obfuscated, and the file is only AVAILABLE from the URL for 10 minutes. To generate a new URL, call
341-
the <a href="../../com/opentok/OpenTok.html#listArchives()"><code>OpenTok.listArchives()</code></a> or <a href="../../com/opentok/OpenTok.html#getArchive(java.lang.String)"><code>OpenTok.getArchive(String)</code></a> method.</div>
339+
<div class="block">The download URL of the available MP4 file. This is only set for an archive with the status
340+
set to Status.AVAILABLE; for other archives, (including archives with the status of
341+
Status.UPLOADED) this method returns null. The download URL is obfuscated, and the file
342+
is only available from the URL for 10 minutes. To generate a new URL, call the
343+
<a href="../../com/opentok/OpenTok.html#listArchives()"><code>OpenTok.listArchives()</code></a> or <a href="../../com/opentok/OpenTok.html#getArchive(java.lang.String)"><code>OpenTok.getArchive(String)</code></a>
344+
method.</div>
342345
</li>
343346
</ul>
344347
<a name="toString()">

0 commit comments

Comments
 (0)