Skip to content

Commit 2fd37c9

Browse files
author
BramBear
committed
JavaDoc comments
1 parent bd9a676 commit 2fd37c9

Some content is hidden

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

51 files changed

+412
-20
lines changed

src/main/java/com/authenteq/api/AbstractApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import okhttp3.MediaType;
44

55

6+
67
/**
78
* The Class AbstractApi.
89
*/

src/main/java/com/authenteq/api/AccountApi.java

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
package com.authenteq.api;
22

3+
import java.io.UnsupportedEncodingException;
34
import java.security.KeyPair;
45
import java.security.PrivateKey;
56
import java.security.PublicKey;
67
import java.security.spec.InvalidKeySpecException;
78
import java.security.spec.PKCS8EncodedKeySpec;
89
import java.security.spec.X509EncodedKeySpec;
9-
1010
import org.apache.commons.codec.DecoderException;
1111
import org.apache.commons.codec.EncoderException;
1212
import org.apache.commons.codec.binary.Hex;
13-
import org.bouncycastle.jcajce.provider.digest.Keccak.KeyGenerator512;
14-
import org.bouncycastle.util.encoders.HexEncoder;
15-
1613
import com.authenteq.model.Account;
14+
import com.authenteq.util.DriverUtils;
1715
import net.i2p.crypto.eddsa.EdDSAPrivateKey;
1816
import net.i2p.crypto.eddsa.EdDSAPublicKey;
1917
import net.i2p.crypto.eddsa.Utils;
20-
import net.i2p.crypto.eddsa.spec.EdDSANamedCurveSpec;
21-
import net.i2p.crypto.eddsa.spec.EdDSANamedCurveTable;
2218

19+
/**
20+
* The Class AccountApi.
21+
*/
2322
public class AccountApi {
2423

24+
/**
25+
* Creates the account.
26+
*
27+
* @return the account
28+
*/
2529
public static Account createAccount() {
2630

2731
Account newAccount = new Account();
@@ -33,6 +37,17 @@ public static Account createAccount() {
3337
return newAccount;
3438
}
3539

40+
/**
41+
* Load account.
42+
*
43+
* @param publicKey
44+
* the public key
45+
* @param privateKey
46+
* the private key
47+
* @return the account
48+
* @throws InvalidKeySpecException
49+
* the invalid key spec exception
50+
*/
3651
public static Account loadAccount(String publicKey, String privateKey) throws InvalidKeySpecException {
3752

3853
Account newAccount = new Account();
@@ -50,11 +65,30 @@ public static Account loadAccount(String publicKey, String privateKey) throws In
5065
return newAccount;
5166
}
5267

53-
public static void main(String args[]) throws InterruptedException, DecoderException, EncoderException {
68+
/**
69+
* The main method.
70+
*
71+
* @param args
72+
* the arguments
73+
* @throws InterruptedException
74+
* the interrupted exception
75+
* @throws DecoderException
76+
* the decoder exception
77+
* @throws EncoderException
78+
* the encoder exception
79+
* @throws UnsupportedEncodingException
80+
* the unsupported encoding exception
81+
*/
82+
public static void main(String args[])
83+
throws InterruptedException, DecoderException, EncoderException, UnsupportedEncodingException {
5484
try {
5585
Hex hex = new Hex();
5686

5787
Account acc = AccountApi.createAccount();
88+
System.out.print(DriverUtils.convertToBase58((EdDSAPublicKey) acc.getPublicKey()));
89+
System.out.println(
90+
Utils.bytesToHex(DriverUtils.convertToBase58((EdDSAPublicKey) acc.getPublicKey()).getBytes()));
91+
5892
System.out.println(Utils.bytesToHex(acc.getPublicKey().getEncoded()));
5993
System.out.println(Utils.bytesToHex(acc.getPrivateKey().getEncoded()));
6094

src/main/java/com/authenteq/api/AssetsApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.authenteq.util.NetworkUtils;
99
import okhttp3.Response;
1010

11+
1112
/**
1213
* The Class AssetsApi.
1314
*/

src/main/java/com/authenteq/api/BlocksApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import okhttp3.Response;
1515

1616

17+
1718
/**
1819
* The Class BlocksApi.
1920
*/

src/main/java/com/authenteq/api/OutputsApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import okhttp3.Response;
1313

1414

15+
1516
/**
1617
* The Class OutputsApi.
1718
*/

src/main/java/com/authenteq/api/StatusesApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import okhttp3.Response;
1212

1313

14+
1415
/**
1516
* The Class StatusesApi.
1617
*/

src/main/java/com/authenteq/api/TransactionsApi.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import okhttp3.RequestBody;
2525
import okhttp3.Response;
2626

27+
2728
/**
2829
* The Class TransactionsApi.
2930
*/
@@ -43,9 +44,10 @@ public static void sendTransaction(Transaction transaction, final GenericCallbac
4344
}
4445

4546
/**
46-
* Sends the transaction
47-
* @param transaction
48-
* @throws IOException
47+
* Sends the transaction.
48+
*
49+
* @param transaction the transaction
50+
* @throws IOException Signals that an I/O exception has occurred.
4951
*/
5052
public static void sendTransaction(Transaction transaction) throws IOException {
5153
RequestBody body = RequestBody.create(JSON, JsonUtils.toJson(transaction));

src/main/java/com/authenteq/api/VotesApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import okhttp3.Response;
1111

1212

13+
1314
/**
1415
* The Class VotesApi.
1516
*/

src/main/java/com/authenteq/builders/BigchainDbConfigBuilder.java

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,18 @@ public interface ITokens {
5858
*/
5959
ITokens addToken(String key, String map);
6060

61+
/**
62+
* Web socket monitor.
63+
*
64+
* @param messageHandler
65+
* the message handler
66+
* @return the i tokens
67+
*/
6168
ITokens webSocketMonitor(MessageHandler messageHandler);
6269

70+
/**
71+
* Setup.
72+
*/
6373
void setup();
6474

6575
/**
@@ -82,8 +92,10 @@ private static class Builder implements ITokens {
8292
/** The http client. */
8393
OkHttpClient httpClient;
8494

95+
/** The setup wsockets. */
8596
boolean setupWsockets = false;
86-
97+
98+
/** The message handler. */
8799
MessageHandler messageHandler = null;
88100

89101
/**
@@ -133,17 +145,18 @@ public void setup() {
133145
}
134146

135147
if (this.setupWsockets) {
136-
137-
// we create another thread for processing the endpoint.
148+
149+
// we create another thread for processing the endpoint.
138150
new Thread(new Runnable() {
139151
@Override
140152
public void run() {
141153
try {
142-
new BigchainDbWSSessionManager(new URI(Globals.getApiEndpoints().getStreams()),messageHandler);
154+
new BigchainDbWSSessionManager(new URI(Globals.getApiEndpoints().getStreams()),
155+
messageHandler);
143156
} catch (URISyntaxException e) {
144157
e.printStackTrace();
145158
}
146-
159+
147160
}
148161
}).start();
149162
}
@@ -180,6 +193,12 @@ public Response intercept(Interceptor.Chain chain) throws IOException {
180193
}
181194
};
182195

196+
/*
197+
* (non-Javadoc)
198+
*
199+
* @see com.authenteq.builders.BigchainDbConfigBuilder.ITokens#
200+
* webSocketMonitor(com.authenteq.ws.MessageHandler)
201+
*/
183202
@Override
184203
public ITokens webSocketMonitor(MessageHandler messageHandler) {
185204
this.setupWsockets = true;

src/main/java/com/authenteq/builders/BigchainDbTransactionBuilder.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import net.i2p.crypto.eddsa.EdDSAPrivateKey;
3333
import net.i2p.crypto.eddsa.EdDSAPublicKey;
3434

35+
3536
/**
3637
* The Class BigchainDbTransactionBuilder.
3738
*/
@@ -57,6 +58,12 @@ public static Builder init() {
5758
*/
5859
public interface IAssetMetaData {
5960

61+
/**
62+
* Operation.
63+
*
64+
* @param operation the operation
65+
* @return the i asset meta data
66+
*/
6067
IAssetMetaData operation(Operations operation);
6168

6269
/**
@@ -192,6 +199,7 @@ public static class Builder implements IAssetMetaData, IBuild {
192199
/** The transaction. */
193200
private Transaction transaction;
194201

202+
/** The operation. */
195203
private Operations operation;
196204

197205
/* (non-Javadoc)
@@ -381,6 +389,9 @@ public IAssetMetaData addMetaData(DataModel obj) {
381389
return this;
382390
}
383391

392+
/* (non-Javadoc)
393+
* @see com.authenteq.builders.BigchainDbTransactionBuilder.IAssetMetaData#operation(com.authenteq.constants.Operations)
394+
*/
384395
@Override
385396
public IAssetMetaData operation(Operations operation) {
386397
this.operation = operation;

0 commit comments

Comments
 (0)