Skip to content

Commit 11ab49b

Browse files
committed
refactored asp3 to aasp
1 parent 829c4c9 commit 11ab49b

File tree

6 files changed

+23
-26
lines changed

6 files changed

+23
-26
lines changed

src/net/sharksystem/aasp/AASPChunkReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AASPChunkReader implements Runnable {
2727

2828
private String getLogStart() {
2929
StringBuilder b = new StringBuilder();
30-
b.append("ASP3ChunkReader (");
30+
b.append("AASPChunkReader (");
3131
b.append(this.owner);
3232
b.append(") connected to (");
3333
b.append(this.peer);

src/net/sharksystem/aasp/AASPEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import java.util.List;
1111

1212
/**
13-
* That ASP3Engine manages exchange of stored messages with peers.
13+
* That AASPEngine manages exchange of stored messages with peers.
1414
* See ASPChunkStorage for details.
1515
*
1616
* @see AASPStorage
17-
* @see ASP3Reader
17+
* @see AASPReader
1818
* @author thsc
1919
*/
2020
public abstract class AASPEngine implements AASPStorage, AASPProtocolEngine {

src/net/sharksystem/aasp/AASPEngineFS.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import java.util.HashMap;
66

77
/**
8-
* ASP3Engine that stores data in file system.
8+
* AASPEngine that stores data in file system.
99
* @author thsc
1010
*/
1111
public class AASPEngineFS extends AASPEngine {
12-
public static final String MEMENTO_FILENAME = "asp3CurrentAttributes";
12+
public static final String MEMENTO_FILENAME = "aaspCurrentAttributes";
1313
private final String rootDirectory;
1414
private AASPChunkStorageFS chunkStorageFS;
1515

@@ -22,7 +22,7 @@ private AASPEngineFS(String rootDirectory,
2222
this.rootDirectory = rootDirectory;
2323
}
2424

25-
public static AASPStorage getASP3ChunkStorage(String owner, String rootDirectory)
25+
public static AASPStorage getAASPChunkStorage(String owner, String rootDirectory)
2626
throws IOException, AASPException {
2727

2828
// check if root directory already exists. If not srt it up
@@ -31,24 +31,24 @@ public static AASPStorage getASP3ChunkStorage(String owner, String rootDirectory
3131
root.mkdirs();
3232
}
3333

34-
return AASPEngineFS.getASP3Engine(owner, rootDirectory);
34+
return AASPEngineFS.getAASPEngine(owner, rootDirectory);
3535

3636
}
3737

38-
public static AASPStorage getASP3ChunkStorage(String rootDirectory)
38+
public static AASPStorage getAASPChunkStorage(String rootDirectory)
3939
throws IOException, AASPException {
4040

41-
return AASPEngineFS.getASP3ChunkStorage(AASPEngineFS.DEFAULT_OWNER, rootDirectory);
41+
return AASPEngineFS.getAASPChunkStorage(AASPEngineFS.DEFAULT_OWNER, rootDirectory);
4242

4343
}
4444

45-
public static AASPEngine getASP3Engine(String owner, String rootDirectory)
45+
public static AASPEngine getAASPEngine(String owner, String rootDirectory)
4646
throws IOException, AASPException {
4747

4848
// root directory must exist when setting up an engine
4949
File root = new File(rootDirectory);
5050
if(!root.exists() || !root.isDirectory()) {
51-
throw new AASPException("chunk root directory must exist when creating an ASP3Engine");
51+
throw new AASPException("chunk root directory must exist when creating an AASPEngine");
5252
}
5353

5454
AASPEngineFS engine = new AASPEngineFS(
@@ -79,10 +79,10 @@ public static AASPEngine getASP3Engine(String owner, String rootDirectory)
7979
return engine;
8080
}
8181

82-
public static AASPEngine getASP3Engine(String rootDirectory)
82+
public static AASPEngine getAASPEngine(String rootDirectory)
8383
throws IOException, AASPException {
8484

85-
return AASPEngineFS.getASP3Engine(null, rootDirectory);
85+
return AASPEngineFS.getAASPEngine(null, rootDirectory);
8686

8787
}
8888

src/net/sharksystem/aasp/AASPStorage.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
* That chunk storage is meant to keep messages which are produced by an
1010
* app for later transmission.
1111
*
12-
* Messages which cannot be sent to their recipients can be stored in ASP3 chunks.
12+
* Messages which cannot be sent to their recipients can be stored in AASP chunks.
1313
* Each chunk is addressed with an URI (comparable to URIs e.g. in Android
1414
* Content Provider)
1515
*
1616
* Applications can easlily store their messages by calling add(URI, message).
1717
* That message is stored in a chunk addressed by the URI.
1818
*
19-
* Each chunk has a recipient list which can be changed anytime. The ASP3Engine
19+
* Each chunk has a recipient list which can be changed anytime. The AASPEngine
2020
* uses those information for sending such stored messages whenever a peer
2121
* establishes a connection.
2222
*
23-
* It is recommended to use ASP3EngineFS to set up that framework.
24-
* Create a ASP3Engine like this
23+
* It is recommended to use AASPEngineFS to set up that framework.
24+
* Create a AASPEngine like this
2525
*
2626
* <pre>
2727
* AASPReader reader = ...;

test/BasicTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@ public void androidUsage() throws IOException, AASPException, InterruptedExcepti
6464

6565
// alice writes a message into chunkStorage
6666
AASPStorage aliceStorage =
67-
AASPEngineFS.getASP3ChunkStorage(ALICE_FOLDER);
67+
AASPEngineFS.getAASPChunkStorage(ALICE_FOLDER);
6868

6969
aliceStorage.add(ALICE_BOB_CHAT_URL, ALICE2BOB_MESSAGE);
7070

7171
// bob does the same
7272
AASPStorage bobStorage =
73-
AASPEngineFS.getASP3ChunkStorage(BOB_FOLDER);
73+
AASPEngineFS.getAASPChunkStorage(BOB_FOLDER);
7474

7575
bobStorage.add(ALICE_BOB_CHAT_URL, BOB2ALICE_MESSAGE);
7676

7777
// now set up both engines / use default reader
78-
AASPEngine aliceEngine = AASPEngineFS.getASP3Engine("Alice", ALICE_FOLDER);
78+
AASPEngine aliceEngine = AASPEngineFS.getAASPEngine("Alice", ALICE_FOLDER);
7979

80-
AASPEngine bobEngine = AASPEngineFS.getASP3Engine("Bob", BOB_FOLDER);
80+
AASPEngine bobEngine = AASPEngineFS.getAASPEngine("Bob", BOB_FOLDER);
8181

8282
AASPChunkReceiverTester aliceListener = new AASPChunkReceiverTester();
8383
AASPChunkReceiverTester bobListener = new AASPChunkReceiverTester();
@@ -108,7 +108,7 @@ public void androidUsage() throws IOException, AASPException, InterruptedExcepti
108108
// wait until communication probably ends
109109
Thread.sleep(10000);
110110

111-
// close connections: note ASP3Engine does NOT close any connection!!
111+
// close connections: note AASPEngine does NOT close any connection!!
112112
aliceChannel.close();
113113
bobChannel.close();
114114
Thread.sleep(1000);

test/net/sharksystem/aasp/WhiteBoxTests.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package net.sharksystem.aasp;
22

3-
import net.sharksystem.aasp.AASPException;
4-
import net.sharksystem.aasp.AASPEngine;
53
import java.io.IOException;
64
import java.util.Iterator;
75
import java.util.List;
86
import org.junit.Test;
9-
import net.sharksystem.aasp.AASPChunk;
107

118
/**
129
*
@@ -19,7 +16,7 @@ public WhiteBoxTests() {
1916

2017
@Test
2118
public void chunksIter() throws IOException, AASPException {
22-
AASPEngine bobEngine = AASPEngineFS.getASP3Engine("bob");
19+
AASPEngine bobEngine = AASPEngineFS.getAASPEngine("bob");
2320

2421
List<AASPChunk> chunks = bobEngine.getStorage().getChunks(0);
2522
Iterator<CharSequence> messages = chunks.iterator().next().getMessages();

0 commit comments

Comments
 (0)