Skip to main content

CMS

4 replies [Last post]
acid
Offline
Joined: 2008-03-03
Points: 0

Hey all,

Is there someone has implement CMS for file sharing ?? Could tell me how to retrieve the message being send like request message or get message?? could we view it in XML or plain text?

there is method notifyupdate(int percentage) , i can download file after read the code from omega , but how could we know like transfer rate for file being download??

thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
0vw3
Offline
Joined: 2007-11-18
Points: 0

Hi acid.

I'm developing a sharing app which uses JXTA CMS. The first you should know is that actually, if you inspect the code you'll see list requests and respones are defined but not used at all.
ContentAdvertisements are caught from DiscoveryService ( I think that's a pretty bad way).

a) The other two message types are get request and get response. See GetMessageProcessor class, they're processed there. I'm pretty sure you should be able to print them out to console or whatever.

b) When notifyupdate() is called, it gives you the percentage of the file. I use System.currentTimeMillis(); in order to measure the time between two calls to notifyupdate() And when you have two percentages, the total size of the file you're downloading and the time passed between the percentages....Yes, you've got the speed!

Hope it helps.

acid
Offline
Joined: 2008-03-03
Points: 0

Thanks for your reply, i will try it

acid
Offline
Joined: 2008-03-03
Points: 0

He,
Could you explain how to calculate transfer rate ??

i got difference ( elapsed time) between start download and finish donwload , i also count the length of the the file has been download.

Do i just need to divide the length file with the elapsed time ? or may be other calculation ?

thanks

davjoh
Offline
Joined: 2007-07-18
Points: 0

length of file in kb / elapsed time in seconds = transfer rate in kb per second