I was a decent programmer in Python. Now i am forced to do a Wowza Module for my chat application. An application which will login by facebook account and the status of each user is saved on a Wowza Server, which use java for app development, connected via flash client & RTMP. The online status datastructure will be like this in Python.
Please tell me how to represent it in Java, I am not so familar with variable 'Types' in java :(
x = {
10001: {
'status': 0,
'friends': {}
},
10002: {
'status': 1,
'friends': {
10001: 0,
10003: 1
}
},
10003: {
'status': 1,
'friends': {
10001: 0,
10003: 1
}
}
}
10001,10002 etc will be facebook user ids.. and 0,1 will be their online/offline status. If 10001 is connected, the datastructure will have some little modifications, it will change the status of 10001 to 1, and add all his friends ids, retrieved from facebook and update their status too.
x = {
10001: {
'status': 1,
'friends': {
10002: 1,
10003: 1
}
},
10002: {
'status': 1,
'friends': {
10001: 1,
10003: 1
}
},
10003: {
'status': 1,
'friends': {
10001: 1,
10003: 1
}
}
}
And if the user 10001 is disconnected, it will goto earlier stage. Is there anyway i can store it as a json object? or is there any simple way to Store and retrieve data?