getAllSessions

Description

getAllSessions returns the detail information of active sessions with XML format, which are opened for the specific application in the specific PowerServer.

Syntax

Syntax for .NET component

proxyobject.of_execinterface ( "getAllSessions", ref any paralist[] )

Argument

Description

proxyobject

The instance of the proxy object generated for AppeonDotNetComponent.

paralist[]

Arrays of Any type. Specifies the parameter arrays for the component function.

paralist[1] - The name of the PowerServer that the sessions are created in. The value should be IP address or IP address with port number, for example, 192.0.0.123, or 192.0.0.123:8080, and separated with semicolons (;) if there are multiple servers (for example in a PowerServer cluster). If paralist[1] is NULL or an empty string (""), getAllSessions returns the information of all active sessions in a PowerServer cluster (you will need to configure the cluster in AEM first).

paralist[2] - The name of the application that is deployed to the PowerServer. If paralist[2] is NULL or an empty string (""), getAllSessions returns the information of active sessions opened for all applications in the specified PowerServer.

paralist[3] - The return value of getAllSessions function: the session content in XML format. This parameter must be cleared, but need not to be assigned with values, as it is used to hold the return value.


Return value of of_execinterface

Returns 0 if the of_execinterface function succeeds and one of the following negative values if an error occurs.

-1: function fails to execute

-2: the specified PowerServer is not found

-3: the specified application is not found

Return value of getAllSessions

Returns an XML string. The XML string is stored in the paralist[3] parameter of the of_execinterface function.

The session content in the XML format will be like this.

<?xml version='1.0' encoding='utf-8'?>
<sessions>
  <error>
    <code>0</code>
    <text></text>
  </error>
  <sever name="172.16.8.40" port="80">
    <session name="826325974">
       <session_id>826325974</session_id>
       <client>172.16.8.40</client>
       <application-name>get_session</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:56:28</started>
       <last_accessed>2018-11-20 12:57:35</last_accessed>
       <duration>67</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>*</aws_id>
    </session>
    <session name="241910444">
       <session_id>241910444</session_id>
       <client>172.16.100.170</client>
       <application-name>34455</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:57:14</started>
       <last_accessed>2018-11-20 12:57:15</last_accessed>
       <duration>21</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>DBEA12D26A7E4C44A8715EDC4C46D8F3</aws_id>
    </session>
  </sever>
</sessions>

Method execution results are recorded in the error node.

Two parameters, code and text, are contained in the error node. The code parameter shows the execution result and the text parameter records the detail error information. If the execution result is not 0, only the error node is listed in the XML.

Values for the code parameter:

0: function succeeds in execution.

-1: function fails to execute.

-2: the specified PowerServer is not found.

-3: the specified application is not found.

Code example

Any la_l[] 
Long lRet 
...
la_l[1] = ls_servername                  
la_l[2] = ls_appname 
la_l[3] = ls_sessioncontent   

lRet = loadDBList.of_ExecInterface ("getAllSessions", la_l) //result is returned to la_l[3]

Syntax for EJB component

For Java:

io_ejb.regstring ( String serverName )

io_ejb.regstring ( String appName )

io_ejb.Invokeretstring ( long objid, "getAllSessions", true, ref string retval )

Argument

Description

io_ejb

A reference of Appeon EJBobject.

serverName

The name of the PowerServer in which the active sessions are created. The value should be IP address or IP address with port number, for example, 192.0.0.123, or 192.0.0.123:8080, and separated with semicolons (;) if there are multiple servers (for example in a PowerServer cluster). If serverName is NULL or an empty string (""), getAllSessions returns the information of active sessions opened for the specified application in all servers in a PowerServer cluster (you will need to configure the cluster in AEM first).

appName

The name of the application that is deployed to the specified PowerServer. If appName is NULL or empty string (""), getAllSessions returns the information of active sessions opened for all applications in the specified PowerServer.

objid

The handle to the component method.

retval

The return value of getAllSessions function: the session content in XML format. This parameter must be cleared, but need not to be assigned with values, as it is used to hold the return value.

Return value of Invokeretstring

Returns 1 if the Invokeretstring function succeeds and one of the following negative values if an error occurs.

-1: function fails to execute

-2: the specified PowerServer is not found

-3: the specified application is not found

Return value of getAllSessions

Returns an XML string. The XML string is stored in the retval parameter of Invokeretstring function.

The session content in the XML format will be like this.

<?xml version='1.0' encoding='utf-8'?>
<sessions>
  <error>
    <code>0</code>
    <text></text>
  </error>
  <sever name="172.16.8.40" port="80">
    <session name="826325974">
       <session_id>826325974</session_id>
       <client>172.16.8.40</client>
       <application-name>get_session</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:56:28</started>
       <last_accessed>2018-11-20 12:57:35</last_accessed>
       <duration>67</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>*</aws_id>
    </session>
    <session name="241910444">
       <session_id>241910444</session_id>
       <client>172.16.100.170</client>
       <application-name>34455</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:57:14</started>
       <last_accessed>2018-11-20 12:57:15</last_accessed>
       <duration>21</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>DBEA12D26A7E4C44A8715EDC4C46D8F3</aws_id>
    </session>
  </sever>
</sessions>

Method execution results are recorded in the error node.

Two parameters, code and text, are contained in the error node. The code parameter shows the execution result and the text parameter records the detail error information. If the execution result is not 0, only the error node is listed in the XML.

Values for the code parameter:

0: function succeeds in execution.

-1: function fails to execute.

-2: the specified PowerServer is not found.

-3: the specified application is not found.

Code example

Note that invokeretstring function is called because the return value is a string.

string ls_msg
string retval01
...
io_ejb.regstring (ls_servername) 
io_ejb.regstring (ls_appname)

ls_msg = io_ejb.invokeretstring (il_bean1, "getAllSessions", true, ref retval01) //result is returned to retval01

Syntax for Web Service

getAllSessions ( string serverName, string appName )

Argument

Description

serverName

The name of the PowerServer in which the active sessions are created. The value should be IP address or IP address with port number, for example, 192.0.0.123, or 192.0.0.123:8080, and separated with semicolons (;) if there are multiple servers (for example in a PowerServer cluster). If serverName is NULL or an empty string (""), getAllSessions returns the information of active sessions opened for the specified application in all servers in a PowerServer cluster (you will need to configure the cluster in AEM first).

appName

The name of the application that is deployed to the specified PowerServer. If appName is NULL or empty string (""), getAllSessions returns the information of active sessions opened for all applications in the specified PowerServer.

Return value

XML string. For example,

<?xml version='1.0' encoding='utf-8'?>
<sessions>
  <error>
    <code>0</code>
    <text></text>
  </error>
  <sever name="172.16.8.40" port="80">
    <session name="826325974">
       <session_id>826325974</session_id>
       <client>172.16.8.40</client>
       <application-name>get_session</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:56:28</started>
       <last_accessed>2018-11-20 12:57:35</last_accessed>
       <duration>67</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>*</aws_id>
    </session>
    <session name="241910444">
       <session_id>241910444</session_id>
       <client>172.16.100.170</client>
       <application-name>34455</application-name>
       <user/>
       <state>0</state>
       <started>2018-11-20 12:57:14</started>
       <last_accessed>2018-11-20 12:57:15</last_accessed>
       <duration>21</duration>
       <server_id>172.16.8.40:80</server_id>
       <aws_id>DBEA12D26A7E4C44A8715EDC4C46D8F3</aws_id>
    </session>
  </sever>
</sessions>

Method execution results are recorded in the error node.

Two parameters, code and text, are contained in the error node. The code parameter shows the execution result and the text parameter records the detail error information. If the execution result is not 0, only the error node is listed in the XML.

Values for the code parameter:

0: function succeeds in execution.

-1: function fails to execute.

-2: the specified PowerServer is not found.

-3: the specified application is not found.

Code example

//--connected to the web service
……
string ls_return, ls_server, ls_app
ls_server = sle_1.text
ls_app = sle_2.text
ls_return = ieon_ws.getAllSessions (ls_server, ls_app)