+ Profile profile = new Profile();
+ profile.setFirstName(firstName);
+ profile.setMiddleName(middleName);
+ profile.setLastName(lastName);
+ Sone sone = new Sone(UUID.fromString(id), name, new FreenetURI(requestUri), new FreenetURI(insertUri));
+ soneCache.put(id, sone);
+ sone.setProfile(profile);
+ int postId = 0;
+ do {
+ String postPrefix = sonePrefix + "/Post." + postId++;
+ id = configuration.getStringValue(postPrefix + "/ID").getValue(null);
+ if (id == null) {
+ break;
+ }
+ long time = configuration.getLongValue(postPrefix + "/Time").getValue(null);
+ String text = configuration.getStringValue(postPrefix + "/Text").getValue(null);
+ Post post = new Post(UUID.fromString(id), sone, time, text);
+ postCache.put(id, post);
+ sone.addPost(post);
+ } while (true);
+ int replyCounter = 0;
+ do {
+ String replyPrefix = sonePrefix + "/Reply." + replyCounter++;
+ String replyId = configuration.getStringValue(replyPrefix + "/ID").getValue(null);
+ if (replyId == null) {
+ break;
+ }
+ Sone replySone = soneCache.get(configuration.getStringValue(replyPrefix + "/Sone/ID").getValue(null));
+ String replySoneKey = configuration.getStringValue(replyPrefix + "/Sone/Key").getValue(null);
+ String replySoneName = configuration.getStringValue(replyPrefix + "/Sone/Name").getValue(null);
+ if (replySone instanceof SoneShell) {
+ ((SoneShell) replySone).setRequestUri(new FreenetURI(replySoneKey)).setName(replySoneName);
+ }
+ Post replyPost = postCache.get(configuration.getStringValue(replyPrefix + "/Post").getValue(null));
+ long replyTime = configuration.getLongValue(replyPrefix + "/Time").getValue(null);
+ String replyText = configuration.getStringValue(replyPrefix + "/Text").getValue(null);
+ Reply reply = new ReplyShell().setSone(replySone).setPost(replyPost).setTime(replyTime).setText(replyText).getShelled();
+ replyCache.put(replyId, reply);
+ } while (true);
+ sone.setModificationCounter(modificationCounter);
+ addSone(sone);