Curling the Headless Client and Licences

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

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

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…

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!

change this:

<%@ 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 :

<%@ 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

mika:

  • 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.

I am probably jumping to conclusions but that way you will also ‘reserve’ one client/license for the operation you want.

IT2BE:
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:

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:

- 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 :)

I agree 200%!

But the poster doesn’t if I interpreted his replies correct…

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

Interesting discussion. What do you folks mean by “curling”? Haven’t seen that term used before.

Morley,

Check out:

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

Cheers,

Rich Coulombre

coulombre:
Morley,

Check out:

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

Cheers,

Rich Coulombre

Oh, fabulous!

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