Skip to content

Commit 10fa688

Browse files
committed
online credential exchange worked in a very first test
1 parent 2870ce8 commit 10fa688

6 files changed

Lines changed: 29 additions & 7 deletions

File tree

src/net/sharksystem/asap/ASAPChunkFS.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public List<CharSequence> getDeliveredTo() {
6060
return this.deliveredTo;
6161
}
6262

63-
ASAPChunkFS(ASAPChunkStorageFS storage, String targetUri, int era) throws IOException {
64-
this(storage, targetUri, era, null);
63+
ASAPChunkFS(ASAPChunkStorageFS storage, String uri, int era) throws IOException {
64+
this(storage, uri, era, null);
6565
}
6666

6767
ASAPChunkFS(ASAPChunkStorageFS storage, String targetUri, int era, String sender) throws IOException {

src/net/sharksystem/asap/ASAPChunkStorage.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ public interface ASAPChunkStorage {
3434
* @throws IOException
3535
*/
3636
public ASAPMessages getASAPChunkCache(CharSequence uri, int toEra) throws IOException;
37+
38+
public ASAPMessages getASAPChunkCache(CharSequence uri, int fromEra, int toEra) throws IOException;
3739
}

src/net/sharksystem/asap/ASAPChunkStorageFS.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,15 @@ public ASAPMessages getASAPChunkCache(CharSequence uri, int toEra) throws IOExce
134134
fromEra = ASAPEngine.previousEra(fromEra);
135135
}
136136

137+
return this.getASAPChunkCache(uri, fromEra, toEra);
138+
}
139+
140+
@Override
141+
public ASAPMessages getASAPChunkCache(CharSequence uri, int fromEra, int toEra) throws IOException {
137142
Log.writeLog(this, "create ASAPInMemoMessages");
138143

139-
return new ASAPInMemoMessages(this,
144+
return new ASAPInMemoMessages(
145+
this,
140146
this.getFormat(),
141147
uri,
142148
fromEra, // set starting era

src/net/sharksystem/asap/ASAPEngineFS.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package net.sharksystem.asap;
22

3+
import net.sharksystem.Utils;
34
import net.sharksystem.asap.protocol.ASAP_1_0;
5+
import net.sharksystem.asap.util.Log;
46

57
import java.io.File;
68
import java.io.IOException;

src/net/sharksystem/asap/ASAPInMemoMessages.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public ASAPInMemoMessages(ASAPChunkStorageFS chunkStorage,
4141
this.toEra = toEra;
4242
this.maxCacheLen = maxCacheLen;
4343

44-
Log.writeLog(this, "format: " + format + "uri: " + uri
45-
+ "rootDir: " + chunkStorage.getRootDirectory()
46-
+ "fromEra: " + fromEra+ "toEra: " + toEra+ "maxCacheLen: " + maxCacheLen);
44+
Log.writeLog(this, "format: " + format + " | uri: " + uri
45+
+ " | rootDir: " + chunkStorage.getRootDirectory()
46+
+ " | fromEra: " + fromEra+ " | toEra: " + toEra);
4747
}
4848

4949
public ASAPInMemoMessages(ASAPChunkStorageFS chunkStorage,

src/net/sharksystem/asap/util/Log.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
public class Log {
44
public static StringBuilder startLog(Object o) {
5+
return Log.startLog(o.getClass());
6+
}
7+
8+
public static StringBuilder startLog(Class c) {
59
StringBuilder sb = new StringBuilder();
6-
sb.append(o.getClass().getSimpleName());
10+
sb.append(c.getSimpleName());
711
sb.append(": ");
812
return sb;
913
}
@@ -12,7 +16,15 @@ public static void writeLog(Object o, String message) {
1216
System.out.println(Log.startLog(o) +": " + message);
1317
}
1418

19+
public static void writeLog(Class c, String message) {
20+
System.out.println(Log.startLog(c) +": " + message);
21+
}
22+
1523
public static void writeLogErr(Object o, String message) {
1624
System.err.println(Log.startLog(o) +": " + message);
1725
}
26+
27+
public static void writeLogErr(Class c, String message) {
28+
System.err.println(Log.startLog(c) +": " + message);
29+
}
1830
}

0 commit comments

Comments
 (0)