forked from jhermes/twissjava
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWicketApplication.java
More file actions
43 lines (36 loc) · 1.46 KB
/
WicketApplication.java
File metadata and controls
43 lines (36 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package example;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
/**
* Application object for your web application. If you want to run this application without deploying, run the Start class.
*/
public class WicketApplication extends WebApplication {
private static final String hostPort = "10.18.101.211:9160";
private static final String clusterName = "Nebula Cassandra Cluster";
private static final String keyspace = "twissjava";
/**
* Constructor
*/
public WicketApplication() {
//Pelops.addPool("Twissjava Pool", new String[] {"127.0.0.1"}, 9160, false, "not used", new Policy());
Base.cassandra = new CassandraService(hostPort, clusterName, keyspace);
Base.cassandra.createColumnFamilyIfAbsent(Base.USERS);
Base.cassandra.createColumnFamilyIfAbsent(Base.TWEETS);
Base.cassandra.createColumnFamilyIfAbsent(Base.FOLLOWERS);
Base.cassandra.createColumnFamilyIfAbsent(Base.FRIENDS);
Base.cassandra.createColumnFamilyIfAbsent(Base.TIMELINE);
Base.cassandra.createColumnFamilyIfAbsent(Base.USERLINE);
}
/**
* @see org.apache.wicket.Application#getHomePage()
*/
public Class<Userline> getHomePage() {
return Userline.class;
}
@Override
public Session newSession(Request request, Response response) {
return new TwissSession(request);
}
}