Skip to content

Commit b3439c9

Browse files
committed
Merge branch 'mithileshkarnati-Branch-Accounts,Application'
2 parents 94b1b79 + fcc2c92 commit b3439c9

File tree

106 files changed

+4264
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+4264
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
11
# restcomm-sdk-java
22
The Java SDK for RestComm REST API
3+
4+
- To build the Project, after downloading the zip and extracting it from GitHub, navigate to the folder containing the pom.xml
5+
file and buiild the project using the following command in the terminal
6+
7+
```sh
8+
$ mvn package
9+
```
10+
- Now when this command is executed, the compilation,validation and testing will be done and after the successful completion of them, a jar file will be generated in the target folder.
11+
12+
- Include the jar file in your build path to get Started.
13+
14+
Java version: 1.8.0_131
15+
16+
This is an SDK for RestComm REST API,
17+
To know more about Restcomm, please refer to http://documentation.telestax.com/
18+
19+
Regarding issues, please refer to https://github.com/RestComm/restcomm-sdk-java/issues
20+

restcomm-connect.java.sdk/.project

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>restcomm-connect.java.sdk</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.worldline.asciidoctools.builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
21+
</natures>
22+
</projectDescription>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
backend=html
2+
eclipse.preferences.version=1
3+
resourcesPath=src/main/doc-resources
4+
sourcesPath=src/main/asciidoc
5+
stylesheetPath=css/stylesheet.css
6+
targetPath=target/generated-docs
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

restcomm-connect.java.sdk/pom.xml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.restcomm</groupId>
4+
<artifactId>restcomm-connect.java.sdk</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<name>restcomm-connect.java.sdk</name>
7+
<url>http://maven.apache.org</url>
8+
<properties>
9+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10+
</properties>
11+
<dependencies>
12+
<dependency>
13+
<groupId>com.google.code.gson</groupId>
14+
<artifactId>gson</artifactId>
15+
<version>2.8.1</version>
16+
</dependency>
17+
<dependency>
18+
<groupId>com.fasterxml.jackson.core</groupId>
19+
<artifactId>jackson-databind</artifactId>
20+
<version>2.6.3</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>com.fasterxml.jackson.core</groupId>
24+
<artifactId>jackson-annotations</artifactId>
25+
<version>2.6.3</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>junit</groupId>
29+
<artifactId>junit</artifactId>
30+
<version>4.11</version>
31+
<scope>test</scope>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.apache.httpcomponents</groupId>
35+
<artifactId>httpasyncclient</artifactId>
36+
<version>4.1.3</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>com.github.tomakehurst</groupId>
40+
<artifactId>wiremock</artifactId>
41+
<version>2.6.0</version>
42+
<scope>test</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.slf4j</groupId>
46+
<artifactId>slf4j-nop</artifactId>
47+
<version>1.8.0-alpha2</version>
48+
<scope>test</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>com.opentable</groupId>
52+
<artifactId>wiremock-body-transformer</artifactId>
53+
<version>1.1.5</version>
54+
</dependency>
55+
</dependencies>
56+
<build>
57+
<plugins>
58+
<plugin>
59+
<groupId>org.asciidoctor</groupId>
60+
<artifactId>asciidoctor-maven-plugin</artifactId>
61+
<version>1.5.3</version>
62+
</plugin>
63+
<plugin>
64+
<artifactId>maven-eclipse-plugin</artifactId>
65+
<version>2.8</version>
66+
<configuration>
67+
<additionalBuildcommands>
68+
<buildCommand>
69+
<name>com.worldline.asciidoctools.builder</name>
70+
<arguments/>
71+
</buildCommand>
72+
</additionalBuildcommands>
73+
</configuration>
74+
</plugin>
75+
</plugins>
76+
</build>
77+
</project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
= Restcomm Java Sdk
2+
3+
4+
5+
6+
7+
8+
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
= Restcomm Java Sdk
2+
3+
4+
This Documentation provides the basic information on the usage of this SDK in performing various operations offered by the *Restcomm-Rest APIs*.
5+
6+
7+
==== Table Of Contents
8+
9+
10+
* Getting Started
11+
* Accounts
12+
* Applications
13+
14+
===== Getting Started
15+
16+
Initializing the Restcomm Client with the Authentication and URL required
17+
18+
Restcomm.COMMON_URL = "http://localhost:8080/";
19+
Restcomm.init("username", "password");
20+
21+
22+
Incase you need to reset it,just use the '_invalidate()_' method available and initialize it again.
23+
24+
Restcomm.invalidate();
25+
Restcomm.COMMON_URL = "http://localhost:8080/";
26+
Restcomm.init("username", "password");
27+
28+
29+
30+
31+
===== Accounts
32+
33+
===== MainAccount
34+
35+
36+
37+
38+
Fetching the default Account with which we authenticated the Restcomm Client
39+
40+
Account mainAccount = Account.getAccount();
41+
42+
The fields of the Account object can be obtained by invoking the respective '_get()_' method of that field
43+
44+
String Sid,FriendlyName,EmailAddress;
45+
Sid = mainAccount.getSid();
46+
FriendlyName = mainAccount.getFriendly_name();
47+
EmailAddress = mainAccount.getEmail_address();
48+
49+
For Modifying any field(s) of the Account, use the '_modifyAccountDetails()_' method
50+
51+
mainAccount.modifyAccountDetails().newEmail("[email protected]").modify();
52+
53+
In a similar way you can even modify multiple fields as shown below
54+
55+
mainAccount.modifyAccountDetails().newEmail("[email protected]").newPassword("12345abcd").newStatus("suspended").modify();
56+
57+
===== *Note:*
58+
* After modifying an Account,if we require the Account Object for further operations, we need to update the Object representing that Account too,
59+
60+
61+
mainAccount = mainAccount.modifyAccountDetails().newEmail("[email protected]").newPassword("12345abcd").newStatus("suspended").modify();
62+
63+
Creating a SubAccount under our MainAccount
64+
65+
Account.createSubAccount().FriendlyName("Paul").Password("restcomm1007").Role("Administrator").create();
66+
67+
To Capture the SubAccount created,
68+
69+
SubAccount SpareAccount = Account.createSubAccount().FriendlyName("Paul").Password("restcomm1007").Role("Administrator").create();
70+
71+
Fetching the List of SubAccounts under our Main Account
72+
73+
SubAccountList List = Account.getSubAccountList();
74+
SubAccount a = List.get(0);
75+
SubAccount b = List.get(1);
76+
......
77+
....
78+
79+
==== SubAccount
80+
81+
82+
Fetching a SubAccount with a given 'Sid', available under our MainAccount
83+
84+
SubAccount spareAccount = SubAccount.getSubAccount(Sid); //Sid is the actual Sid of the SubAccount we wish to fetch
85+
86+
The fields of the SubAccount object can be obtained by invoking the respective '_get()_' method of that field similar to that Of Accounts
87+
----
88+
String FriendlyName;
89+
FriendlyName = spareAccount.getFriendly_name();
90+
----
91+
92+
Modifying the SubAccount in a similar way as mentioned above
93+
94+
spareAccount = spareAccount.modifySubAccount().........modify();
95+
(Or)
96+
spareAccount = SubAccount.modifySubAccount(Sid).........modify(); //Sid is the actual Sid of the SubAccount we wish to modify
97+
98+
Deleting a SubAccount
99+
100+
spareAccount.delete();
101+
(Or)
102+
SubAccount.deleteSubAccount(Sid); //Sid is the Sid of the SubAccoun to be deleted
103+

0 commit comments

Comments
 (0)