Mercurial > hg > Database > jungle-network
changeset 125:6104702a1880
Added dependency bulletinboard in pom.xml
author | one |
---|---|
date | Sat, 11 Jan 2014 08:07:19 +0900 |
parents | dacfa7eba841 |
children | 31be4d597859 |
files | .classpath .project pom.xml src/main/java/app/bbs/BoardMessage.java src/main/java/app/bbs/BulletinBoard.java src/main/java/app/bbs/CassandraBulletinBoard.java src/main/java/app/bbs/CreateBoardMessageServlet.java src/main/java/app/bbs/CreateBoardServlet.java src/main/java/app/bbs/EditMessageServlet.java src/main/java/app/bbs/HectorSample.java src/main/java/app/bbs/IterableConverter.java src/main/java/app/bbs/NetworkBulletinBoard.java src/main/java/app/bbs/NetworkJungleBulletinBoard.java src/main/java/app/bbs/PersistentJungleBulletinBoard.java src/main/java/app/bbs/ShowBoardMessageServlet.java src/main/java/app/bbs/ShowBoardsServlet.java src/main/java/app/bbs/codesegment/StartBBSCodeSegment.java |
diffstat | 17 files changed, 68 insertions(+), 690 deletions(-) [+] |
line wrap: on
line diff
--- a/.classpath Sat Jan 11 06:33:54 2014 +0900 +++ b/.classpath Sat Jan 11 08:07:19 2014 +0900 @@ -1,96 +1,51 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/> - <classpathentry including="**/*.java" kind="src" path="src/main/java"/> - <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="var" path="M2_REPO/junit/junit/4.7/junit-4.7.jar"/> - <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar" sourcepath="M2_REPO/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hectorclient/hector-core/1.1-2/hector-core-1.1-2.jar" sourcepath="M2_REPO/org/hectorclient/hector-core/1.1-2/hector-core-1.1-2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3.jar" sourcepath="M2_REPO/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/cassandra-thrift/1.1.0/cassandra-thrift-1.1.0.jar" sourcepath="M2_REPO/org/apache/cassandra/cassandra-thrift/1.1.0/cassandra-thrift-1.1.0-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/thrift/libthrift/0.7.0/libthrift-0.7.0.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/> - <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r09/guava-r09.jar" sourcepath="M2_REPO/com/google/guava/guava/r09/guava-r09-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/github/stephenc/eaio-uuid/uuid/3.3.0/uuid-3.3.0.jar"/> - <classpathentry kind="var" path="M2_REPO/com/ecyrd/speed4j/speed4j/0.9/speed4j-0.9.jar" sourcepath="M2_REPO/com/ecyrd/speed4j/speed4j/0.9/speed4j-0.9-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/cassandra-all/1.2.1/cassandra-all-1.2.1.jar" sourcepath="M2_REPO/org/apache/cassandra/cassandra-all/1.2.1/cassandra-all-1.2.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1.jar" sourcepath="M2_REPO/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/ning/compress-lzf/0.8.4/compress-lzf-0.8.4.jar" sourcepath="M2_REPO/com/ning/compress-lzf/0.8.4/compress-lzf-0.8.4-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.1/commons-cli-1.1.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.1/commons-cli-1.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.3/concurrentlinkedhashmap-lru-1.3.jar" sourcepath="M2_REPO/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.3/concurrentlinkedhashmap-lru-1.3-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.2/antlr-3.2.jar" sourcepath="M2_REPO/org/antlr/antlr/3.2/antlr-3.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar" sourcepath="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/antlr/stringtemplate/3.2/stringtemplate-3.2.jar"/> - <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.7/antlr-2.7.7.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/deps/avro/1.4.0-cassandra-1/avro-1.4.0-cassandra-1.jar" sourcepath="M2_REPO/org/apache/cassandra/deps/avro/1.4.0-cassandra-1/avro-1.4.0-cassandra-1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/jline/jline/1.0/jline-1.0.jar" sourcepath="M2_REPO/jline/jline/1.0/jline-1.0-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar" sourcepath="M2_REPO/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.2/high-scale-lib-1.1.2.jar" sourcepath="M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.2/high-scale-lib-1.1.2-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/edu/stanford/ppl/snaptree/0.1/snaptree-0.1.jar" sourcepath="M2_REPO/edu/stanford/ppl/snaptree/0.1/snaptree-0.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/yammer/metrics/metrics-core/2.0.3/metrics-core-2.0.3.jar" sourcepath="M2_REPO/com/yammer/metrics/metrics-core/2.0.3/metrics-core-2.0.3-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar" sourcepath="M2_REPO/com/github/stephenc/jamm/0.2.5/jamm-0.2.5-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/functionaljava/functionaljava/3.1/functionaljava-3.1.jar" sourcepath="M2_REPO/org/functionaljava/functionaljava/3.1/functionaljava-3.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/msgpack/msgpack/0.6.8/msgpack-0.6.8.jar"/> - <classpathentry kind="var" path="M2_REPO/org/javassist/javassist/3.16.1-GA/javassist-3.16.1-GA.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-junit4/2.13/surefire-junit4-2.13.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-junit4/2.13/surefire-junit4-2.13-sources.jar"/> - <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-api/2.13/surefire-api-2.13.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-api/2.13/surefire-api-2.13-sources.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: junit:junit:4.7"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.mortbay.jetty:jetty:6.1.26"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.mortbay.jetty:jetty-util:6.1.26"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.mortbay.jetty:servlet-api:2.5-20081211"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.hectorclient:hector-core:1.1-2"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: commons-lang:commons-lang:2.4"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: commons-pool:commons-pool:1.5.3"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.apache.cassandra:cassandra-thrift:1.1.0"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.slf4j:slf4j-api:1.6.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.apache.thrift:libthrift:0.7.0"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: javax.servlet:servlet-api:2.5"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.apache.httpcomponents:httpclient:4.0.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.apache.httpcomponents:httpcore:4.0.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: commons-logging:commons-logging:1.1.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: commons-codec:commons-codec:1.2"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.google.guava:guava:r09"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.github.stephenc.eaio-uuid:uuid:3.3.0"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.ecyrd.speed4j:speed4j:0.9"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.apache.cassandra:cassandra-all:1.2.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.xerial.snappy:snappy-java:1.0.4.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.ning:compress-lzf:0.8.4"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: commons-cli:commons-cli:1.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.3"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.antlr:antlr:3.2"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.antlr:antlr-runtime:3.2"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.antlr:stringtemplate:3.2"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: antlr:antlr:2.7.7"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.apache.cassandra.deps:avro:1.4.0-cassandra-1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.2"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.codehaus.jackson:jackson-core-asl:1.9.2"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: jline:jline:1.0"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.googlecode.json-simple:json-simple:1.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.github.stephenc.high-scale-lib:high-scale-lib:1.1.2"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.yaml:snakeyaml:1.6"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: edu.stanford.ppl:snaptree:0.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.yammer.metrics:metrics-core:2.0.3"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: com.github.stephenc:jamm:0.2.5"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.functionaljava:functionaljava:3.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.msgpack:msgpack:0.6.8"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.javassist:javassist:3.16.1-GA"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: jungle:jungle-core:0.0.2-SNAPSHOT"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: commons-collections:commons-collections:3.2.1"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.apache.maven.surefire:surefire-junit4:2.13"/> - <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Maven: org.apache.maven.surefire:surefire-api:2.13"/> - <classpathentry combineaccessrules="false" exported="true" kind="src" path="/jungle-core"/> - <classpathentry combineaccessrules="false" kind="src" path="/Alice"/> - <classpathentry kind="output" path="target/classes"/> -</classpath> + <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/> + <classpathentry kind="src" path="src/main/java" including="**/*.java"/> + <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/4.7/junit-4.7.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26.jar" sourcepath="M2_REPO/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar" sourcepath="M2_REPO/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hectorclient/hector-core/1.1-2/hector-core-1.1-2.jar" sourcepath="M2_REPO/org/hectorclient/hector-core/1.1-2/hector-core-1.1-2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3.jar" sourcepath="M2_REPO/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/cassandra-thrift/1.1.0/cassandra-thrift-1.1.0.jar" sourcepath="M2_REPO/org/apache/cassandra/cassandra-thrift/1.1.0/cassandra-thrift-1.1.0-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/thrift/libthrift/0.7.0/libthrift-0.7.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/> + <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r09/guava-r09.jar" sourcepath="M2_REPO/com/google/guava/guava/r09/guava-r09-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/github/stephenc/eaio-uuid/uuid/3.3.0/uuid-3.3.0.jar"/> + <classpathentry kind="var" path="M2_REPO/com/ecyrd/speed4j/speed4j/0.9/speed4j-0.9.jar" sourcepath="M2_REPO/com/ecyrd/speed4j/speed4j/0.9/speed4j-0.9-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/cassandra-all/1.2.1/cassandra-all-1.2.1.jar" sourcepath="M2_REPO/org/apache/cassandra/cassandra-all/1.2.1/cassandra-all-1.2.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1.jar" sourcepath="M2_REPO/org/xerial/snappy/snappy-java/1.0.4.1/snappy-java-1.0.4.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/ning/compress-lzf/0.8.4/compress-lzf-0.8.4.jar" sourcepath="M2_REPO/com/ning/compress-lzf/0.8.4/compress-lzf-0.8.4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.1/commons-cli-1.1.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.1/commons-cli-1.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.3/concurrentlinkedhashmap-lru-1.3.jar" sourcepath="M2_REPO/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.3/concurrentlinkedhashmap-lru-1.3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.2/antlr-3.2.jar" sourcepath="M2_REPO/org/antlr/antlr/3.2/antlr-3.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar" sourcepath="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/antlr/stringtemplate/3.2/stringtemplate-3.2.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.7/antlr-2.7.7.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/cassandra/deps/avro/1.4.0-cassandra-1/avro-1.4.0-cassandra-1.jar" sourcepath="M2_REPO/org/apache/cassandra/deps/avro/1.4.0-cassandra-1/avro-1.4.0-cassandra-1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/jline/jline/1.0/jline-1.0.jar" sourcepath="M2_REPO/jline/jline/1.0/jline-1.0-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar" sourcepath="M2_REPO/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.2/high-scale-lib-1.1.2.jar" sourcepath="M2_REPO/com/github/stephenc/high-scale-lib/high-scale-lib/1.1.2/high-scale-lib-1.1.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/edu/stanford/ppl/snaptree/0.1/snaptree-0.1.jar" sourcepath="M2_REPO/edu/stanford/ppl/snaptree/0.1/snaptree-0.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/yammer/metrics/metrics-core/2.0.3/metrics-core-2.0.3.jar" sourcepath="M2_REPO/com/yammer/metrics/metrics-core/2.0.3/metrics-core-2.0.3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar" sourcepath="M2_REPO/com/github/stephenc/jamm/0.2.5/jamm-0.2.5-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/functionaljava/functionaljava/3.1/functionaljava-3.1.jar" sourcepath="M2_REPO/org/functionaljava/functionaljava/3.1/functionaljava-3.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/alice/alice/0.2/alice-0.2.jar"/> + <classpathentry kind="var" path="M2_REPO/org/msgpack/msgpack/0.6.8/msgpack-0.6.8.jar"/> + <classpathentry kind="var" path="M2_REPO/org/javassist/javassist/3.16.1-GA/javassist-3.16.1-GA.jar"/> + <classpathentry kind="src" path="/jungle-core"/> + <classpathentry kind="src" path="/bulletinboard"/> + <classpathentry kind="var" path="M2_REPO/com/eaio/uuid/uuid/3.3/uuid-3.3.jar"/> +</classpath> \ No newline at end of file
--- a/.project Sat Jan 11 06:33:54 2014 +0900 +++ b/.project Sat Jan 11 08:07:19 2014 +0900 @@ -4,6 +4,7 @@ <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> <projects> <project>jungle-core</project> + <project>bulletinboard</project> </projects> <buildSpec> <buildCommand>
--- a/pom.xml Sat Jan 11 06:33:54 2014 +0900 +++ b/pom.xml Sat Jan 11 08:07:19 2014 +0900 @@ -106,5 +106,12 @@ <artifactId>jungle-core</artifactId> <version>0.0.3-SNAPSHOT</version> </dependency> + + + <dependency> + <groupId>jp.ac.u_ryukyu.ie.cr.shoshi.jungle</groupId> + <artifactId>bulletinboard</artifactId> + <version>0.0.1-SNAPSHOT</version> + </dependency> </dependencies> </project>
--- a/src/main/java/app/bbs/BoardMessage.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -package app.bbs; - -public interface BoardMessage -{ - public String getUUID(); - public String getAuthor(); - public String getMessage(); -}
--- a/src/main/java/app/bbs/BulletinBoard.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -package app.bbs; - -public interface BulletinBoard -{ - public Iterable<String> getBoards(); - public void createBoards(String _name,String _author,String _initMessage,String _editKey); - public void createBoardMessage(String _board,String _author,String _message,String _editKey); - public void editMessage(String _board,String _uuid,String _author,String _message,String _editKey); - - public Iterable<BoardMessage> getMessages(String _boardName); -}
--- a/src/main/java/app/bbs/CassandraBulletinBoard.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,191 +0,0 @@ -package app.bbs; - -import java.util.Collections; -import java.util.List; -import java.util.UUID; - -import org.apache.cassandra.locator.SimpleStrategy; - -import me.prettyprint.cassandra.serializers.StringSerializer; -import me.prettyprint.cassandra.serializers.UUIDSerializer; -import me.prettyprint.cassandra.service.template.SuperCfResult; -import me.prettyprint.cassandra.service.template.SuperCfUpdater; -import me.prettyprint.cassandra.service.template.ThriftSuperCfTemplate; -import me.prettyprint.cassandra.utils.TimeUUIDUtils; -import me.prettyprint.hector.api.Cluster; -import me.prettyprint.hector.api.Keyspace; -import me.prettyprint.hector.api.beans.HSuperColumn; -import me.prettyprint.hector.api.beans.OrderedSuperRows; -import me.prettyprint.hector.api.beans.SuperRow; -import me.prettyprint.hector.api.beans.SuperSlice; -import me.prettyprint.hector.api.ddl.ColumnFamilyDefinition; -import me.prettyprint.hector.api.ddl.ColumnType; -import me.prettyprint.hector.api.ddl.ComparatorType; -import me.prettyprint.hector.api.ddl.KeyspaceDefinition; -import me.prettyprint.hector.api.factory.HFactory; -import me.prettyprint.hector.api.query.QueryResult; -import me.prettyprint.hector.api.query.RangeSuperSlicesQuery; -import me.prettyprint.hector.api.query.SuperSliceQuery; - -public class CassandraBulletinBoard implements BulletinBoard -{ - private final String address; - private final String clusterName; - private final Cluster cluster; - private final String keyspace; - - private static final String COLUMN_FAMILY_BOARD = "boards"; - - public CassandraBulletinBoard(String _clusterName,String _address,String _keyspaceName) - { - address = _address; - clusterName = _clusterName; - keyspace = _keyspaceName; - cluster = HFactory.getOrCreateCluster(clusterName,address); - - initialize(); - } - - private void initialize() - { - if(cluster.describeKeyspace(keyspace) == null){ - KeyspaceDefinition keyspaceDefinition = HFactory.createKeyspaceDefinition(keyspace, - SimpleStrategy.class.getName(),1,Collections.<ColumnFamilyDefinition> emptyList()); - cluster.addKeyspace(keyspaceDefinition,false); - ColumnFamilyDefinition columnFamilyDefinition = HFactory.createColumnFamilyDefinition(keyspace,COLUMN_FAMILY_BOARD,ComparatorType.UUIDTYPE); - columnFamilyDefinition.setColumnType(ColumnType.SUPER); - cluster.addColumnFamily(columnFamilyDefinition); - } - } - - public Iterable<String> getBoards() - { - Keyspace ksp = HFactory.createKeyspace(keyspace, cluster); - RangeSuperSlicesQuery<String,UUID,String,String> query = HFactory.createRangeSuperSlicesQuery(ksp,StringSerializer.get(), - UUIDSerializer.get(),StringSerializer.get(),StringSerializer.get()); - query.setColumnFamily(COLUMN_FAMILY_BOARD).setKeys(null,null).setRange(null,null,false,0); - - QueryResult<OrderedSuperRows<String,UUID,String,String>> result = query.execute(); - OrderedSuperRows<String,UUID,String,String> rows = result.get(); - List<SuperRow<String,UUID,String,String>> list = rows.getList(); - - IterableConverter.Converter<String,SuperRow<String,UUID,String,String>> converter - = new IterableConverter.Converter<String, SuperRow<String,UUID,String,String>>(){ - public String conv(SuperRow<String, UUID, String, String> _b) { - return _b.getKey(); - } - }; - - return new IterableConverter<String,SuperRow<String,UUID,String,String>>(list,converter); - } - - private static final String COLUMN_MESSAGE_AUTHOR = "author"; - private static final String COLUMN_MESSAGE_BODY = "message"; - private static final String COLUMN_MESSAGE_EDIT_KEY = "edit"; - - public void createBoardMessage(UUID _time,String _name,String _author,String _message,String _editKey) - { - Keyspace ksp = HFactory.createKeyspace(keyspace,cluster); - ThriftSuperCfTemplate<String,UUID,String> template = - new ThriftSuperCfTemplate<String,UUID,String>(ksp,COLUMN_FAMILY_BOARD,StringSerializer.get(), - UUIDSerializer.get(),StringSerializer.get()); - - SuperCfUpdater<String,UUID,String> updater = template.createUpdater(_name,_time); - updater.setString(COLUMN_MESSAGE_AUTHOR,_author); - updater.setString(COLUMN_MESSAGE_BODY,_message); - updater.setString(COLUMN_MESSAGE_EDIT_KEY,_editKey); - - template.update(updater); - } - - public void createBoards(String _name,String _author,String _initMessage,String _editKey) - { - UUID time = TimeUUIDUtils.getTimeUUID(0); - createBoardMessage(time,_name,_author,_initMessage,_editKey); - } - - public Iterable<BoardMessage> getMessages(String _boardName) - { - Keyspace ksp = HFactory.createKeyspace(keyspace,cluster); - SuperSliceQuery<String, UUID, String, String> query = HFactory.createSuperSliceQuery(ksp, StringSerializer.get(), UUIDSerializer.get(), StringSerializer.get(), StringSerializer.get()); - - UUID start = TimeUUIDUtils.getTimeUUID(0); - query.setKey(_boardName).setColumnFamily(COLUMN_FAMILY_BOARD).setRange(start,null,false,100); - - QueryResult<SuperSlice<UUID, String, String>> result = query.execute(); - SuperSlice<UUID,String,String> ss = result.get(); - List<HSuperColumn<UUID,String,String>> list = ss.getSuperColumns(); - - IterableConverter.Converter<BoardMessage,HSuperColumn<UUID,String,String>> converter = - new IterableConverter.Converter<BoardMessage,HSuperColumn<UUID,String,String>>(){ - public BoardMessage conv(HSuperColumn<UUID, String, String> _b){ - UUID uuid = _b.getName(); - String author = _b.getSubColumnByName(COLUMN_MESSAGE_AUTHOR).getValue(); - String message = _b.getSubColumnByName(COLUMN_MESSAGE_BODY).getValue(); - BoardMessageImpl bm = new BoardMessageImpl(author,message,uuid.toString()); - return bm; - } - }; - - - return new IterableConverter<BoardMessage,HSuperColumn<UUID,String,String>>(list,converter); - } - - private static class BoardMessageImpl implements BoardMessage - { - private final String author; - private final String message; - private final String uuid; - - public BoardMessageImpl(String _author,String _message,String _uuid) - { - author = _author; - message = _message; - uuid = _uuid; - } - - public String getAuthor() - { - return author; - } - - public String getMessage() - { - return message; - } - - public String getUUID() - { - return uuid; - } - } - - public void createBoardMessage(String _board, String _author, String _message,String _editKey) - { - UUID time = TimeUUIDUtils.getUniqueTimeUUIDinMillis(); - createBoardMessage(time,_board,_author,_message,_editKey); - } - - public void editMessage(String _board,String _uuid,String _author,String _message,String _editKey) - { - Keyspace ksp = HFactory.createKeyspace(keyspace, cluster); - UUID time = UUID.fromString(_uuid); - ThriftSuperCfTemplate<String,UUID,String> template = - new ThriftSuperCfTemplate<String,UUID,String>(ksp,COLUMN_FAMILY_BOARD,StringSerializer.get(), - UUIDSerializer.get(),StringSerializer.get()); - - SuperCfResult<String,UUID,String> result = template.querySuperColumn(_board,time); - String editKey = result.getString(COLUMN_MESSAGE_EDIT_KEY); - if(!editKey.equals(editKey)){ - return; - } - - SuperCfUpdater<String, UUID, String> updater = template.createUpdater(_board,time); - updater.setString(COLUMN_MESSAGE_AUTHOR,_author); - updater.setString(COLUMN_MESSAGE_BODY,_message); - updater.setString(COLUMN_MESSAGE_EDIT_KEY,_editKey); - - template.update(updater); - } - -}
--- a/src/main/java/app/bbs/CreateBoardMessageServlet.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -package app.bbs; - -import java.io.PrintWriter; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class CreateBoardMessageServlet extends HttpServlet -{ - private final BulletinBoard bbs; - private static final String PARAM_BOARD_NAME = "bname"; - private static final String PARAM_BOARD_AUTHOR = "author"; - private static final String PARAM_BOARD_MESSAGE= "msg"; - private static final String PARAM_BOARD_EDITKEY = "key"; - - private static final long serialVersionUID = 1L; - - public CreateBoardMessageServlet(BulletinBoard _bbs) - { - bbs = _bbs; - } - - @Override - public void doPost(HttpServletRequest _req,HttpServletResponse _res) - { - String boardName = _req.getParameter(PARAM_BOARD_NAME); - String author = _req.getParameter(PARAM_BOARD_AUTHOR); - String msg = _req.getParameter(PARAM_BOARD_MESSAGE); - String key = _req.getParameter(PARAM_BOARD_EDITKEY); - - try{ - bbs.createBoardMessage(boardName,author,msg,key); - PrintWriter pw = _res.getWriter(); - pw.write("successfully written"); - }catch(Exception _e){ - _res.setStatus(500); - } - } -}
--- a/src/main/java/app/bbs/CreateBoardServlet.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -package app.bbs; - -import java.io.PrintWriter; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class CreateBoardServlet extends HttpServlet -{ - private final BulletinBoard bbs; - private static final String PARAM_BOARD_NAME = "bname"; - private static final String PARAM_BOARD_AUTHOR = "author"; - private static final String PARAM_BOARD_INITMESSAGE= "msg"; - private static final String PARAM_BOARD_EDITKEY = "key"; - - private static final long serialVersionUID = 1L; - - public CreateBoardServlet(BulletinBoard _bbs) - { - bbs = _bbs; - } - - public void doPost(HttpServletRequest _req,HttpServletResponse _res) - { - String boardName = _req.getParameter(PARAM_BOARD_NAME); - String author = _req.getParameter(PARAM_BOARD_AUTHOR); - String msg = _req.getParameter(PARAM_BOARD_INITMESSAGE); - String key = _req.getParameter(PARAM_BOARD_EDITKEY); - - try{ - bbs.createBoards(boardName,author,msg,key); - PrintWriter pw = _res.getWriter(); - pw.write("successfully written"); - }catch(Exception _e){ - _res.setStatus(500); - } - } -}
--- a/src/main/java/app/bbs/EditMessageServlet.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -package app.bbs; - -import java.io.PrintWriter; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class EditMessageServlet extends HttpServlet -{ - private final BulletinBoard bbs; - private static final String PARAM_BOARD_NAME = "bname"; - private static final String PARAM_BOARD_MSGID = "uuid"; - private static final String PARAM_BOARD_AUTHOR = "author"; - private static final String PARAM_BOARD_MESSAGE= "msg"; - private static final String PARAM_BOARD_EDITKEY = "key"; - - private static final long serialVersionUID = 1L; - - public EditMessageServlet(BulletinBoard _bbs) - { - bbs = _bbs; - } - - public void doGet(HttpServletRequest _req,HttpServletResponse _res) - { - String bname = _req.getParameter(PARAM_BOARD_NAME); - String uuid = _req.getParameter(PARAM_BOARD_MSGID); - - - try{ - PrintWriter pw = _res.getWriter(); - pw.write("<html><body><h1>edit message</h1>"); - pw.write("<form method='POST'\n"); - pw.write("<p>Author : <input type='text' name='author'/>" + - "<input type='hidden' name='key' value='"+uuid+"'/>" + - "<input type='hidden' name='bname' value='"+bname+"'</p>\n"); - pw.write("<p>Message<br/> <input type='textarea' name='msg'/> </p>\n"); - pw.write("<p><input type='submit' value='submit'/></p>\n"); - pw.write("</body></html>"); - pw.flush(); - }catch(Exception _e){ - _res.setStatus(500); - } - } - - public void doPost(HttpServletRequest _req,HttpServletResponse _res) - { - String boardName = _req.getParameter(PARAM_BOARD_NAME); - String author = _req.getParameter(PARAM_BOARD_AUTHOR); - String msg = _req.getParameter(PARAM_BOARD_MESSAGE); - String key = _req.getParameter(PARAM_BOARD_EDITKEY); - String uuid = _req.getParameter(PARAM_BOARD_MSGID); - - try{ - bbs.editMessage(boardName, uuid, author, msg, key); - PrintWriter pw = _res.getWriter(); - pw.write("successfully written"); - pw.flush(); - }catch(Exception _e){ - _res.setStatus(500); - } - } -}
--- a/src/main/java/app/bbs/HectorSample.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -package app.bbs; - -import java.util.List; -import java.util.UUID; -import me.prettyprint.cassandra.serializers.StringSerializer; -import me.prettyprint.cassandra.serializers.UUIDSerializer; -import me.prettyprint.cassandra.service.template.SuperCfUpdater; -import me.prettyprint.cassandra.service.template.ThriftSuperCfTemplate; -import me.prettyprint.cassandra.utils.TimeUUIDUtils; -import me.prettyprint.hector.api.*; -import me.prettyprint.hector.api.beans.HColumn; -import me.prettyprint.hector.api.beans.HSuperColumn; -import me.prettyprint.hector.api.beans.OrderedSuperRows; -import me.prettyprint.hector.api.beans.SuperRow; -import me.prettyprint.hector.api.beans.SuperSlice; -import me.prettyprint.hector.api.factory.HFactory; -import me.prettyprint.hector.api.query.QueryResult; -import me.prettyprint.hector.api.query.RangeSuperSlicesQuery; -import me.prettyprint.hector.api.query.SuperSliceQuery; - -public class HectorSample -{ - public static void main(String _args[]) - { - Cluster myCluster = HFactory.getOrCreateCluster("test-cluster","localhost:9160"); - - Keyspace ksp = HFactory.createKeyspace("cassaBBS",myCluster); - /* - ColumnFamilyDefinition newCF = HFactory.createColumnFamilyDefinition("DEMO","ccc",ComparatorType.UUIDTYPE); - newCF.setColumnType(ColumnType.SUPER); - myCluster.addColumnFamily(newCF); - */ - - ThriftSuperCfTemplate<String,UUID,String> template = - new ThriftSuperCfTemplate<String,UUID,String>(ksp,"boards",StringSerializer.get(), - UUIDSerializer.get(),StringSerializer.get()); - UUID time = TimeUUIDUtils.getUniqueTimeUUIDinMillis(); - SuperCfUpdater<String,UUID,String> updater = template.createUpdater("board1",TimeUUIDUtils.getTimeUUID(0)); - updater.setString("name","peter"); - updater.setString("message",time.toString()); - - template.update(updater); - - UUID start = TimeUUIDUtils.getTimeUUID(0); - - SuperSliceQuery<String, UUID, String, String> sq = HFactory.createSuperSliceQuery(ksp, StringSerializer.get(), UUIDSerializer.get(), StringSerializer.get(), StringSerializer.get()); - sq.setKey("board1").setColumnFamily("ccc").setRange(start,null,false,100); - - QueryResult<SuperSlice<UUID,String,String>> results = sq.execute(); - - SuperSlice<UUID,String,String> ss = results.get(); - List<HSuperColumn<UUID,String,String>> list = ss.getSuperColumns(); - for(HSuperColumn<UUID,String,String> sc : list){ - HColumn<String,String> sub = sc.getSubColumnByName("name"); - System.out.println(sub.getValue()); - sub = sc.getSubColumnByName("message"); - System.out.println(sub.getValue()); - } - - RangeSuperSlicesQuery<String,UUID,String,String> rsq = HFactory.createRangeSuperSlicesQuery(ksp,StringSerializer.get(), - UUIDSerializer.get(),StringSerializer.get(),StringSerializer.get()); - rsq.setKeys(null,null).setRange(null,null,false,0).setColumnFamily("ccc"); - - QueryResult<OrderedSuperRows<String,UUID,String,String>> rsqResult = rsq.execute(); - OrderedSuperRows<String, UUID, String, String> rows = rsqResult.get(); - for(SuperRow<String, UUID, String, String> row : rows.getList()){ - System.out.println(row.getKey()); - } - } -}
--- a/src/main/java/app/bbs/IterableConverter.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -package app.bbs; - -import java.util.Iterator; - -public class IterableConverter<A,B> implements Iterable<A> -{ - private final Iterable<B> iterable; - private final Converter<A,B> converter; - - public IterableConverter(Iterable<B> _iterable,Converter<A,B> _converter) - { - iterable = _iterable; - converter = _converter; - } - - public Iterator<A> iterator() - { - return new IteratorConverter<A,B>(iterable.iterator(),converter); - } - - private static final class IteratorConverter<A,B> implements Iterator<A> - { - private final Iterator<B> iterator; - private final Converter<A,B> converter; - - public IteratorConverter(Iterator<B> _iterator,Converter<A,B> _converter) - { - iterator = _iterator; - converter = _converter; - } - - public boolean hasNext() - { - return iterator.hasNext(); - } - - public A next() - { - return converter.conv(iterator.next()); - } - - public void remove() - { - iterator.remove(); - } - } - - public static interface Converter<A,B> - { - public A conv(B _b); - } -}
--- a/src/main/java/app/bbs/NetworkBulletinBoard.java Sat Jan 11 06:33:54 2014 +0900 +++ b/src/main/java/app/bbs/NetworkBulletinBoard.java Sat Jan 11 08:07:19 2014 +0900 @@ -1,5 +1,7 @@ package app.bbs; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BulletinBoard; + public interface NetworkBulletinBoard extends BulletinBoard { public void init();
--- a/src/main/java/app/bbs/NetworkJungleBulletinBoard.java Sat Jan 11 06:33:54 2014 +0900 +++ b/src/main/java/app/bbs/NetworkJungleBulletinBoard.java Sat Jan 11 08:07:19 2014 +0900 @@ -9,6 +9,7 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BoardMessage; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Children; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; @@ -185,7 +186,7 @@ JungleTree tree = jungle.getTreeByName(_boardName); Node node = tree.getRootNode(); Children<Node> chs = node.getChildren(); - + final AtomicInteger counter = new AtomicInteger(0); IterableConverter.Converter<BoardMessage,Node> converter = new IterableConverter.Converter<BoardMessage,Node>(){ public BoardMessage conv(Node _b) {
--- a/src/main/java/app/bbs/PersistentJungleBulletinBoard.java Sat Jan 11 06:33:54 2014 +0900 +++ b/src/main/java/app/bbs/PersistentJungleBulletinBoard.java Sat Jan 11 08:07:19 2014 +0900 @@ -10,6 +10,7 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BoardMessage; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Children; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList;
--- a/src/main/java/app/bbs/ShowBoardMessageServlet.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -package app.bbs; - -import java.io.PrintWriter; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class ShowBoardMessageServlet extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 1L; - private final BulletinBoard bbs; - private final String createBoardMessagePath; - private final String editMessagePath; - - private static final String PARAM_BOARD_NAME = "bname"; - - public ShowBoardMessageServlet(BulletinBoard _bbs,String _createBoardMessagePath, String _editMessagePath) - { - bbs = _bbs; - createBoardMessagePath = _createBoardMessagePath; - editMessagePath = _editMessagePath; - } - - public void doGet(HttpServletRequest _req,HttpServletResponse _res) - { - String bname = _req.getParameter(PARAM_BOARD_NAME); - - try{ - printBoard(bname,_res.getWriter()); - }catch(Exception _e){ - _res.setStatus(500); - } - - } - - private void printBoard(String _bname,PrintWriter _pw) throws Exception - { - _pw.write("<html><body>\n"); - _pw.write("<h1>"+_bname+"</h1>\n"); - - _pw.write("<form action='"+createBoardMessagePath+"' method='POST'\n"); - _pw.write("<p>Author : <input type='text' name='author'/> <input type='hidden' name='bname' value='"+_bname+"'/> EditKey : <input type='text' name='key'/></p>\n"); - _pw.write("<p>Message<br/> <input type='textarea' name='msg'/> </p>\n"); - _pw.write("<p><input type='submit' value='submit'/></p>\n"); - - for(BoardMessage msg : bbs.getMessages(_bname)){ - _pw.write("<hr/>"); - _pw.write("<p><b>"+msg.getAuthor()+"</b></p>"); - _pw.write("<p>"+msg.getMessage()+"</p>"); - _pw.write("<small><a href='"+editMessagePath+"?bname="+_bname+"&uuid="+msg.getUUID()+"'>edit</a></small>"); - } - - _pw.write("</body></html>"); - _pw.flush(); - } -}
--- a/src/main/java/app/bbs/ShowBoardsServlet.java Sat Jan 11 06:33:54 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -package app.bbs; - -import java.io.PrintWriter; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class ShowBoardsServlet extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 1L; - private final BulletinBoard bbs; - private final String createBoardPath; - private final String showBoardMessagePath; - - public ShowBoardsServlet(BulletinBoard _bbs, String _createBoardPath,String _showBoardMessagePath) - { - bbs = _bbs; - createBoardPath = _createBoardPath; - showBoardMessagePath = _showBoardMessagePath; - } - - public void doGet(HttpServletRequest _req,HttpServletResponse _res) - { - try{ - printBoard(_res.getWriter()); - }catch(Exception _e){ - _res.setStatus(500); - } - - } - - private void printBoard(PrintWriter _pw) throws Exception - { - _pw.write("<html><body>\n"); - _pw.write("<h1>BBS</h1>\n"); - _pw.write("<form action='"+createBoardPath+"' method='POST'\n"); - _pw.write("<p>Create new board.</p>"); - _pw.write("<p>BoardName : <input type='text' name='bname'/></p>\n"); - _pw.write("<p>Author : <input type='text' name='author'/> EditKey : <input type='text' name='key'/></p>\n"); - _pw.write("<p>Message<br/> <input type='textarea' name='msg'/> </p>\n"); - _pw.write("<p><input type='submit' value='submit'/></p><hr/>\n"); - - _pw.write("<h2>list of boards</h2>"); - for(String board : bbs.getBoards()){ - _pw.write("<p><a href='"+showBoardMessagePath+"?bname="+board+"'>"+board+"</a></p>"); - } - - _pw.write("</body></html>"); - _pw.flush(); - } -}
--- a/src/main/java/app/bbs/codesegment/StartBBSCodeSegment.java Sat Jan 11 06:33:54 2014 +0900 +++ b/src/main/java/app/bbs/codesegment/StartBBSCodeSegment.java Sat Jan 11 08:07:19 2014 +0900 @@ -6,6 +6,12 @@ import javax.servlet.Servlet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.CreateBoardMessageServlet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.CreateBoardServlet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.EditMessageServlet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.ShowBoardMessageServlet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.ShowBoardsServlet; + import org.mortbay.jetty.Server; import org.mortbay.jetty.servlet.ServletHandler; import org.mortbay.jetty.servlet.ServletHolder; @@ -13,14 +19,9 @@ import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; -import app.bbs.CreateBoardMessageServlet; -import app.bbs.CreateBoardServlet; -import app.bbs.EditMessageServlet; import app.bbs.NetworkBulletinBoard; import app.bbs.NetworkJungleBulletinBoard; import app.bbs.PersistentJungleBulletinBoard; -import app.bbs.ShowBoardMessageServlet; -import app.bbs.ShowBoardsServlet; public class StartBBSCodeSegment extends CodeSegment {