Subversion Repositories SmartDukaan

Rev

Rev 15595 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15595 Rev 15597
Line 17... Line 17...
17
	
17
	
18
	private static Logger log = LoggerFactory.getLogger(SnapdealSessionCookie .class);
18
	private static Logger log = LoggerFactory.getLogger(SnapdealSessionCookie .class);
19
	private static MongoClient mongo;
19
	private static MongoClient mongo;
20
	private static final String SNAPDEAL_DB = "Snapdeal";
20
	private static final String SNAPDEAL_DB = "Snapdeal";
21
	private static final String COOKIE_COLLECTION = "Cookies";
21
	private static final String COOKIE_COLLECTION = "Cookies";
-
 
22
	private static final String VOI_COOKIE_COLLECTION = "VoiCookies";
-
 
23
	
22
	
24
	
23
	static{
25
	static{
24
		String mongoHost = "localhost";
26
		String mongoHost = "localhost";
25
		try {
27
		try {
26
			mongoHost = ConfigClient.getClient().get("support_backup_host");
28
			mongoHost = ConfigClient.getClient().get("support_backup_host");
Line 40... Line 42...
40
		DBObject result = collection.findOne();
42
		DBObject result = collection.findOne();
41
		if (result==null){
43
		if (result==null){
42
			throw new Exception();
44
			throw new Exception();
43
		}
45
		}
44
		return result.toString();
46
		return result.toString();
-
 
47
	}
-
 
48
	
-
 
49
	public String getVoiCookies() throws Exception{
-
 
50
		DB db = mongo.getDB(SNAPDEAL_DB);
-
 
51
		DBCollection collection = db.getCollection(VOI_COOKIE_COLLECTION);
-
 
52
		DBObject result = collection.findOne();
-
 
53
		if (result==null){
-
 
54
			throw new Exception();
-
 
55
		}
-
 
56
		return result.toString();
45
	}
57
	}
46
	
58
	
47
	public static void main(String[] args) throws Exception{
59
	public static void main(String[] args) throws Exception{
48
		SnapdealSessionCookie sc = new SnapdealSessionCookie();
60
		SnapdealSessionCookie sc = new SnapdealSessionCookie();
49
		sc.getCookies();
61
		sc.getCookies();