It's all about the answers!

Ask a question

is it possibile read session timeout by api plain?


Vincent permgen (623) | asked Nov 06 '14, 6:55 a.m.
hello guys
i need to know if exists any way to read session timeout of RTC server using Java Api Plain.
in my project login to platform is very slowly, for this reason i need session hold on.

in this forum i find info about how to read timeout param from web.xml but unfortunately i don't have access to this file and i wanto build a strong application that can run also RTC master change this parameter.

tnx at all
bye Vincenzo

3 answers



permanent link
sam detweiler (12.5k6195201) | answered Nov 06 '14, 7:14 a.m.
Yes, here is how I set the timeout

srcServer = TeamPlatform.getTeamRepositoryService().getTeamRepository(Properties.get(SourceServerURL));          
 // setup for login
            srcServer.registerLoginHandler(new LoginHandler(Properties.get(SourceUserID), userpw));
            // and set the connection timeout, has to be set before login
            // in seconds
            srcServer.setConnectionTimeout(master_connection_timeout);
            // login, will throw error if not authorized
            srcServer.login(null);

permanent link
Vincent permgen (623) | answered Nov 06 '14, 8:54 a.m.
tnx
but i read on javadoc
"Returns the connection timeout used for contacting the repository"
i don't understand if this param is about api or server.
also this param is in second but the setting timeout in server side is in minute.
i think this parameter is timeout of client platform.

bye V

Comments
sam detweiler commented Nov 06 '14, 9:16 a.m.

You asked for Plain java, which is client.
this is the total elapsed connect time for the client to the server
(as the name says set 'ConnectionTimeout'

this api returns the current timeout value, but also allows setting the value.

my code uses 246060 to set the timeout to 1 days worth of seconds.

there is no 'server side' timeout..  there are timeouts when clients interact with server side services.. (query elapsed time timeout for example), or server side operations ( email send timeout, ...)   some may be specified in seconds or minutes


permanent link
Vincent permgen (623) | answered Nov 06 '14, 9:24 a.m.
there is no 'server side' timeout..
then only way to logged out my java client is by explicit logout method.
is right?


Comments
sam detweiler commented Nov 06 '14, 9:29 a.m.

there are two approaches..

1. you can explicitly logout if your app continues to run after you close the connection
2. when your application ends, the connecxtion manager handler closes the session for you (typical app cleanup)

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.