Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

Applet licensing mechanism - CPU license

Hi All,

I've got a commercial java applet which I usually license on a per-domain basis. I have a licensing mechanism in place for covering this, where the applet is supplied with a license key at runtime.

However, I have a requirement to be able to license the applet on a per-server (CPU) basis. I have seen a number of commercial applets licensed in this way, and I am hoping I can get some advice here on how to implement such a mechanism.

The licensing is used as a deterent obviously - I am well aware that licensing mechanisms in applets are not bullet-proof, but some sort of licensing effort is better than nothing! :-)

Just incase it makes any difference or opens up any options, the applet is digitally signed.

Any ideas / advice?

Thank you in advance.
0
richardoc
Asked:
richardoc
  • 5
  • 4
1 Solution
 
CEHJCommented:
0
 
richardocAuthor Commented:
Thanks for your suggestions!

Only problem is that, I need to restrict it to a particular server, not client. If I could get the IP address of the server that served up the applet, that might do the trick.
0
 
CEHJCommented:
If the IP address is fixed, you could try

InetAddress.getLocalHost()
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
CEHJCommented:
Correction - that's nonsense (returns client address). Try

this.getDocumentBase()

0
 
richardocAuthor Commented:
Yes, but surely that will return the ip address of the client machine that the applet is running on, and not the IP address of the server that served up the applet.
I'm trying to restrict the applet to a single server - not a single client.
0
 
CEHJCommented:
>>Yes, but surely that will return the ip address of the client machine

(See my correction above)
0
 
richardocAuthor Commented:
getDocumentBase will just return the url of the page the applet was loaded from:
http://java.sun.com/j2se/1.4.2/docs/api/java/applet/Applet.html#getDocumentBase()
And getHost() will just return the domain part of the url.

I need to get the IP it was served from, because the the applet could get served from 1 of 100 domains running on the server; hence the need for a cpu license.
0
 
richardocAuthor Commented:
Its actually very straightforward to get the IP from a hostname:

InetAddress inet = InetAddress.getByName("www.hostname.com");
System.out.println ("IP  : " + inet.getHostAddress());

Thanks anyway.
0
 
CEHJCommented:
:-)

Yes, the hostname *is* the IP address ;-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now