Curling the Headless Client and Licences

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

Curling the Headless Client and Licences

Postby mika » Tue Dec 13, 2005 5:10 am

Hi,

I'm currently curling a JSP running on the headless client. Everything works quite well - it logs in, passes a method some values, executes the method and logs out again.

In the event where all my client licences are being used by other users (and maybe even all three trial licences), it is critical that this curl be allowed to execute. To make sure the licensing will not stop the operation, as I see it I have three options:

- Have a special user for this operation which is ALWAYS logged in. (is there a way I can do this?)
- Kick another client off when the curl executes (not desirable)
- Make sure I have more licences than I have users (this solution isn't really desirable either, as the majority of users use this system for <10 minutes a week)

Any responses would be appreciated.

Cheers
mika
 
Posts: 9
Joined: Thu Dec 02, 2004 3:49 am

Postby mika » Tue Dec 13, 2005 5:17 am

Further to my previous message - I'm aware that if I remove the line

<%session.setAttribute("servoy",null);%>

from my JSP the user will not be logged out. However, that does mean that subsequent calls to that JSP will not work.

What I'm after is a way to execute the JSP multiple times without chewing up more than one licence.

Cheers
mika
 
Posts: 9
Joined: Thu Dec 02, 2004 3:49 am

Postby IT2Be » Tue Dec 13, 2005 7:57 am

A login expires after idle for xxx minutes. If I am correct we can set this however to the time we want.

I understand what you ask because this is something I am facing also.

Why do you say the last option (reserve a login) is not desirable? All logins are concurrent users so when a client doesn't log in for more than 10 minutes he/she won't use licenses for more than 10 minutes. The only thing is the license for the headless client. Not a big deal I guess when it is so important to reserve it!

At least that is the road I (think I) will follow...

Hope this helps a little...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby mika » Tue Dec 13, 2005 8:47 am

Thanks for your reply.

To answer your question about the last option:

The last option isn't desirable as although I have an expanding set of users, it would be rare that the number of concurrent users would exceeed the number of available licences. However, I'm concerned that the curl would fail in the case of all licences are being used, so I want to avoid taking that chance if I can.

Simply buying more licences to solve the problem would be a bit of a waste of money in this case, since there is only a slim chance the situation I've described would occur!
mika
 
Posts: 9
Joined: Thu Dec 02, 2004 3:49 am

Postby Harjo » Tue Dec 13, 2005 8:58 am

change this:

Code: Select all
<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page errorPage="errorpage.jsp" %>
<%
   ISessionBean servoy_hc = (ISessionBean)session.getAttribute("servoy");
   if (servoy_hc == null)
   {
      servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_02",null,null);
      session.setAttribute("servoy",servoy_hc);
   }


into :
Code: Select all
<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page errorPage="errorpage.jsp" %>
<%
   ISessionBean servoy_hc = (ISessionBean)application.getAttribute("servoy");
   if (servoy_hc == null)
   {
      servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_02",null,null);
      application.setAttribute("servoy",servoy_hc);
   }


Now the client is application based and not session based. It means that it will only use ONE client! :)
But be carefull, it means also that the requests will be handled after eachother.

So for example, one client is doing a search and edit, and another client is doing the same for another record. If the first client wants to save the data back, you first have to do a search again, and than save, because the headless-client, was in other record.

Hope this helps
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Curling the Headless Client and Licences

Postby ngervasi » Tue Dec 13, 2005 1:51 pm

mika wrote:- Have a special user for this operation which is ALWAYS logged in. (is there a way I can do this?)


Yes, you can use a Batch Processor instead of CURL and develop a mini solution to do the task you need at the right time, it's a kind of HC running on the server so you also have direct access to server HD, etc.
If you need to pass parameters to the batch solution you can use a special table accessible from the main solution and the batch solution.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Postby IT2Be » Tue Dec 13, 2005 2:13 pm

I am probably jumping to conclusions but that way you will also 'reserve' one client/license for the operation you want.
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby ngervasi » Tue Dec 13, 2005 2:26 pm

IT2BE wrote:I am probably jumping to conclusions but that way you will also 'reserve' one client/license for the operation you want.


Right, but you could use this batch processor for multiple operations just implementing a table to feed data to it and a cron job to check the table every x seconds, a table like this:
Code: Select all
operation_type | operation_creation_date | parameter A | parameter B | ...
do this                   today 13:20:15
do that                  today 13:25:00

and a method like:
Code: Select all
- search in operations table all records with:
operation_creation_date > date_last_check
- loop foundset
- switch(operation_type) {} ...


and using the eval() functions you could also feed "live methods" to the batch processor.
I'm happy to pay a license for a feature like this one :)
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Postby IT2Be » Tue Dec 13, 2005 2:31 pm

I agree 200%!

But the poster doesn't if I interpreted his replies correct...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby mika » Thu Dec 22, 2005 4:08 am

I agree as well!

Thanks for your suggestions - the problem has been sorted now. I now have all client machines on my network (about 800 of them) dumping their System Profiler/System Information data to XML and sending the XML to a postgres db via the curl every day. My servoy solution then parses the XML and updates my asset db accordingly. Now I always have up-to-date information for all machines on my network!

Cheers
mika
 
Posts: 9
Joined: Thu Dec 02, 2004 3:49 am

Postby Morley » Sun Jan 08, 2006 12:35 am

Interesting discussion. What do you folks mean by "curling"? Haven't seen that term used before.
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby coulombre » Sun Jan 08, 2006 12:46 am

Morley,

Check out:

http://en.wikipedia.org/wiki/Curling

Cheers,

Rich Coulombre
coulombre
 
Posts: 125
Joined: Wed May 28, 2003 4:56 pm
Location: Boston

Postby Morley » Sun Jan 08, 2006 8:39 am

coulombre wrote:Morley,

Check out:

http://en.wikipedia.org/wiki/Curling

Cheers,

Rich Coulombre
Oh, fabulous!
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby Harry Catharell » Fri Jan 13, 2006 11:37 am

Morley,

You may also want to check out http://curl.haxx.se/

Curling in the I.T. world as opposed to the ICE :lol: world is a syntax used for the transfer of files and data using URL constructs

Cheers
Harry
Harry Catharell
 
Posts: 812
Joined: Fri Sep 26, 2003 10:23 am
Location: Milton Keynes, England


Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 2 guests