Cisco Unified Application Environment Developer Forums

« Back to Developers

Etch-how to query CUAE server for application data

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi,
I posted the question in the Etch category but then I thought it is more appropriate here.
I want to try out a simple program to get the number of applications installed on the CUAE server and the names of each of the application. I followed the procedure and created the java files using the command prompt.
I used "mixin cisco.uc.cuae.mgmt.Management" module to generate the classes. But I am getting only the option to get the application by name.
How to get all the application names from the server?

Regards,
Prem

Prem, You would have to use the findApplications API to get all the
applications. It returns you an array of all the applications matching
your criteria.

Thanks,
Rajesh

-----Original Message-----
From: cuae-developers-bounces@developer.cisco.com
mailto:cuae-developers-bounces@developer.cisco.com On Behalf Of Prem
Yadav
Sent: Saturday, December 13, 2008 7:41 AM
To: cuae-developers@developer.cisco.com
Subject: [Cuae-developers] Etch-how to query CUAE server for application
data

Hi,
I posted the question in the Etch category but then I thought it is more
appropriate here.
I want to try out a simple program to get the number of applications
installed on the CUAE server and the names of each of the application. I
followed the procedure and created the java files using the command
prompt.
I used "mixin cisco.uc.cuae.mgmt.Management" module to generate the
classes. But I am getting only the option to get the application by
name.
How to get all the application names from the server?

Regards,
Prem
_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

Hi Prem,

Throughout the Management service, the pattern for retrieving lists of items (like applications) is to call the "count" message followed by the "find" message (e.g. countApplications then *findApplications*).

countApplications will give you the number of applications, which you'll use as the limit parameter in findApplications.

In both messages, you want the constraint parameter to be the empty string, and substitutions to be null (those fields provide SQL-like filtering of the result set).

Cheers,
Rick

Hi Thanks for the suggestions. I am following the steps as suggested. Is it possible to run the application without installing it on the CUAE server. I want a standalone program that I can run and get the results from the CUAE server without installing it.
How to do it? should I just ignore the trigger option while create the application using Etch commands?

Regards,
Prem

Yes, you do not need to install the app into CUAE if you only want to
consume Management API. Just run it as a normal java or c# process.

-----Original Message-----
From: cuae-developers-bounces@developer.cisco.com
mailto:cuae-developers-bounces@developer.cisco.com On Behalf Of Prem
Yadav
Sent: Thursday, December 18, 2008 8:21 PM
To: cuae-developers@developer.cisco.com
Subject: Re: [Cuae-developers] Etch-how to query CUAE server for
applicationdata

Hi Thanks for the suggestions. I am following the steps as suggested. Is
it possible to run the application without installing it on the CUAE
server. I want a standalone program that I can run and get the results
from the CUAE server without installing it.
How to do it? should I just ignore the trigger option while create the
application using Etch commands?

Regards,
Prem
_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

Adding to what JD mentioned.

Yes, you can ignore the trigger options if you are interested in the
management API using Etch.
You would need to worry about the triggers if you are planning to use
any of the call control or other legacy APIs.

Thanks,
Rajesh

-----Original Message-----
From: cuae-developers-bounces@developer.cisco.com
mailto:cuae-developers-bounces@developer.cisco.com On Behalf Of J.D.
Liau (jliau)
Sent: Friday, December 19, 2008 8:52 AM
To: cuae-developers@developer.cisco.com
Subject: Re: [Cuae-developers] Etch-how to query CUAE server
forapplicationdata

Yes, you do not need to install the app into CUAE if you only want to
consume Management API. Just run it as a normal java or c# process.

-----Original Message-----
From: cuae-developers-bounces@developer.cisco.com
mailto:cuae-developers-bounces@developer.cisco.com On Behalf Of Prem
Yadav
Sent: Thursday, December 18, 2008 8:21 PM
To: cuae-developers@developer.cisco.com
Subject: Re: [Cuae-developers] Etch-how to query CUAE server for
applicationdata

Hi Thanks for the suggestions. I am following the steps as suggested. Is
it possible to run the application without installing it on the CUAE
server. I want a standalone program that I can run and get the results
from the CUAE server without installing it.
How to do it? should I just ignore the trigger option while create the
application using Etch commands?

Regards,
Prem
_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

Aaron, Thanks for pointing it out. Yes, the API reference are not yet
updated on the developer.cisco.com site. We will look into it why the
new APIs are not showing up.

To keep you going, let me point you to the place where you can see the
etch file that defines the new APIs. In your CUAE installation, kindly
go to $install_dir\Framework\1.0\idl\cuae\uc\cuae\mgmt. The
Management.etch file includes the other .txt files. You would see the
findApplications API in this file.

Thanks,
Rajesh

-----Original Message-----
From: cuae-developers-bounces@developer.cisco.com
mailto:cuae-developers-bounces@developer.cisco.com On Behalf Of Aaron
Ragheb
Sent: Monday, December 22, 2008 1:58 PM
To: cuae-developers@developer.cisco.com
Subject: Re: [Cuae-developers] Etch-how to query CUAE server for
application data

Quick question, guys.

I am working CUAE 2.5 with C#.

I was following this thread, and so I too did a

mixin cisco.uc.cuae.mgmt.Management

and thus, I see that the server object now has the management API calls
(including countApplications and findApplications).

However, I do not see findApplications in the API reference (under the
management section) for either Java or C#. I do see the
countApplications call.
I also see a listApplications call...which is not in the code. It has a
different signature than findApplications.

Is this a typo in the reference?

Thanks,

Aaron
_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

Hi,
I tried to use the countApplications and findApplications as suggested. I am getting an exception while reistering the application.
I tried to print the created server Object:
test12.Remotetest12Server/PlainMailboxManager/KeepAlive/Messagizer/Packetizer/TlsConnection(down, 10.71.152.68:9000).
why does it show down?
The exception I get while I do registerApplication is as follows:

java.lang.RuntimeException: unexpected exception sending message
at etch.bindings.java.transport.DefaultDeliveryService.begincall(DefaultDeliveryService.java:189)
at etch.bindings.java.support.RemoteBase._begincall(RemoteBase.java:87)
at cisco.uc.cuae.RemoteEtchBridgeServer$_Async._begin_registerApplication(RemoteEtchBridgeServer.java:210)
at cisco.uc.cuae.RemoteEtchBridgeServer.registerApplication(RemoteEtchBridgeServer.java:75)
at test12.Remotetest12Server.registerApplication(Remotetest12Server.java:71)
at test12.Maintest12Client.main(Maintest12Client.java:53)
Caused by: java.lang.IllegalStateException: connection down
at etch.bindings.java.transport.PlainMailboxManager.register(PlainMailboxManager.java:174)
at etch.bindings.java.transport.PlainMailboxManager.transportCall(PlainMailboxManager.java:140)
at etch.bindings.java.transport.DefaultDeliveryService.begincall(DefaultDeliveryService.java:185)
... 5 more

Please help.
Regards,
Prem

prem,

everything points to connection being down. did you start it? did it
ever come up?
perhaps you could post your code, at least

Maintest12Client.java

thanks,
scott out

Prem Yadav wrote:
Hi,
I tried to use the countApplications and findApplications as suggested. I am getting an exception while reistering the application.
I tried to print the created server Object:
test12.Remotetest12Server/PlainMailboxManager/KeepAlive/Messagizer/Packetizer/TlsConnection(down, 10.71.152.68:9000).
why does it show down?
The exception I get while I do registerApplication is as follows:

java.lang.RuntimeException: unexpected exception sending message
at etch.bindings.java.transport.DefaultDeliveryService.begincall(DefaultDeliveryService.java:189)
at etch.bindings.java.support.RemoteBase._begincall(RemoteBase.java:87)
at cisco.uc.cuae.RemoteEtchBridgeServer$_Async._begin_registerApplication(RemoteEtchBridgeServer.java:210)
at cisco.uc.cuae.RemoteEtchBridgeServer.registerApplication(RemoteEtchBridgeServer.java:75)
at test12.Remotetest12Server.registerApplication(Remotetest12Server.java:71)
at test12.Maintest12Client.main(Maintest12Client.java:53)
Caused by: java.lang.IllegalStateException: connection down
at etch.bindings.java.transport.PlainMailboxManager.register(PlainMailboxManager.java:174)
at etch.bindings.java.transport.PlainMailboxManager.transportCall(PlainMailboxManager.java:140)
at etch.bindings.java.transport.DefaultDeliveryService.begincall(DefaultDeliveryService.java:185)
... 5 more

Please help.
Regards,
Prem
_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

Thanks Scott,
here is the code fpor Maintest12Client.java

// This file automatically generated by:
// Etch 1.0.1 (ETCH-RELEASE-3) / java 1.0.1 (ETCH-RELEASE-3)
// Wed Nov 26 15:21:54 JST 2008
// This file is automatically created for your convenience and will not be
// overwritten once it exists! Please edit this file as necessary to implement
// your service logic.

package test12;

import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List;

import cisco.uc.cuae.mgmt.ManagementServer;
import cisco.uc.cuae.mgmt.RemoteManagement;
import cisco.uc.cuae.mgmt.Management.Application;
import cisco.uc.cuae.mgmt.Management.Module;

/**
* Main program for test12Client. This program makes a connection to the
* listener created by Maintest12Listener.
*/
public class Maintest12Client implements test12Helper.test12ClientFactory
{
/**
* Main program for test12Client.
*
* @param args command line arguments.
* @throws Exception
*/
/**
* @param args
* @throws Exception
*/
public static void main( String[] args ) throws Exception
{
// TODO Change to correct URI

String uri = "tls://10.71.152.68:9000?TlsConnection.authReqd=false&filter=KeepAlive&KeepAlive.Count=5&Packetizer.maxPktSize=102400&TcpTransport.reconnectDelay=4000";

Remotetest12Server server = test12Helper.newServer( uri, null,
new Maintest12Client() );
System.out.println(server);

// Connect to the service
server._startAndWaitUp( 4000 );

// TODO Insert Your Code Here

// Disconnect from the service
try
{
System.out.println("here1");
server._stopAndWaitDown( 4000 );
String key = server.registerApplication("test12", "Default", "administrator", "notc1sc0");
//System.out.println("AnswerAndPlay is registered: " + key);
//System.in.read();
System.out.println("here2");
int tee=server.countApplications("test",null);
Application[] tttt=server.findApplications("test", null, tee, null, null);
System.out.println(tttt);

}
catch(Exception e)
{
System.out.println("exception caught");
e.printStackTrace();
}

}

public test12Client newtest12Client( Remotetest12Server server )
throws Exception
{
return new Impltest12Client( server );
}
}

Regards,
Prem

Scott,
I have tried restarting the App server. But I am still getting the same exception.

Regards,
Prem

prem,

after you start your service (server._startAndWaitUp), there is a
comment which
says "insert your code here". after that is a try block with your code
in it, but before
your code is this line:

server._stopAndWaitDown( 4000 );

that kills the connection. any code following that line will not
work. in a typical service implementation that line would not
presented. comment it out and things should be good.

scott out

_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

Hi,
Please help me resolve this problem. Its urgent.

Regards,
Prem

I used the uri as

String uri ="tls://10.71.152.68:9000?TlsConnection.authReqd=false&filter=KeepAlive,Logger&Logger.filePath=C:
tmpetchlogs.txt&KeepAlive.Count=5&Packetizer.maxPktSize=102400&TcpTransport.reconnectDelay=4000";
and the output in the log file is:

15:44:30.536: Incoming: KeepAlive/Messagizer/Packetizer/TlsConnection(up, /64.104.53.89:2991, /10.71.152.68:9000)
15:44:30.660: Outgoing: KeepAlive/Messagizer/Packetizer/TlsConnection(down, 10.71.152.68:9000)

the exception generated is :

test12.Remotetest12Server/PlainMailboxManager/Logger/KeepAlive/Messagizer/Packetizer/TlsConnection(down, 10.71.152.68:9000)
exception caught
java.lang.RuntimeException: unexpected exception sending message
at etch.bindings.java.transport.DefaultDeliveryService.begincall(DefaultDeliveryService.java:189)
at etch.bindings.java.support.RemoteBase._begincall(RemoteBase.java:87)
at cisco.uc.cuae.RemoteEtchBridgeServer$_Async._begin_registerApplication(RemoteEtchBridgeServer.java:210)
at cisco.uc.cuae.RemoteEtchBridgeServer.registerApplication(RemoteEtchBridgeServer.java:75)
at test12.Remotetest12Server.registerApplication(Remotetest12Server.java:71)
at test12.Maintest12Client.main(Maintest12Client.java:54)
Caused by: java.lang.IllegalStateException: connection down
at etch.bindings.java.transport.PlainMailboxManager.register(PlainMailboxManager.java:174)
at etch.bindings.java.transport.PlainMailboxManager.transportCall(PlainMailboxManager.java:140)
at etch.bindings.java.transport.DefaultDeliveryService.begincall(DefaultDeliveryService.java:185)
... 5 more

Did you follow Scott's comment yesterday and change your code? Please
paste your "main" routine into the message and we will take a look at
it.

-----Original Message-----
From: cuae-developers-bounces@developer.cisco.com
mailto:cuae-developers-bounces@developer.cisco.com On Behalf Of Prem
Yadav
Sent: Tuesday, January 06, 2009 12:48 AM
To: cuae-developers@developer.cisco.com
Subject: Re: [Cuae-developers] Etch-how to query CUAE server for
applicationdata

I used the uri as

String uri
="tls://10.71.152.68:9000?TlsConnection.authReqd=false&filter=KeepAlive,
Logger&Logger.filePath=C:
tmpetchlogs.txt&KeepAlive.Count=5&Packetizer.
maxPktSize=102400&TcpTransport.reconnectDelay=4000";
and the output in the log file is:

15:44:30.536: Incoming:
KeepAlive/Messagizer/Packetizer/TlsConnection(up, /64.104.53.89:2991,
/10.71.152.68:9000)
15:44:30.660: Outgoing:
KeepAlive/Messagizer/Packetizer/TlsConnection(down, 10.71.152.68:9000)

the exception generated is :

test12.Remotetest12Server/PlainMailboxManager/Logger/KeepAlive/Messagize
r/Packetizer/TlsConnection(down, 10.71.152.68:9000) exception caught
java.lang.RuntimeException: unexpected exception sending message
at
etch.bindings.java.transport.DefaultDeliveryService.begincall(DefaultDel
iveryService.java:189)
at
etch.bindings.java.support.RemoteBase._begincall(RemoteBase.java:87)
at
cisco.uc.cuae.RemoteEtchBridgeServer$_Async._begin_registerApplication(R
emoteEtchBridgeServer.java:210)
at
cisco.uc.cuae.RemoteEtchBridgeServer.registerApplication(RemoteEtchBridg
eServer.java:75)
at
test12.Remotetest12Server.registerApplication(Remotetest12Server.java:71
)
at test12.Maintest12Client.main(Maintest12Client.java:54)
Caused by: java.lang.IllegalStateException: connection down
at
etch.bindings.java.transport.PlainMailboxManager.register(PlainMailboxMa
nager.java:174)
at
etch.bindings.java.transport.PlainMailboxManager.transportCall(PlainMail
boxManager.java:140)
at
etch.bindings.java.transport.DefaultDeliveryService.begincall(DefaultDel
iveryService.java:185)
... 5 more
_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

_______________________________________________
Cuae-developers mailing list
Cuae-developers@developer.cisco.com

Thanks Richard,
I tried as you suggested but when I run the line server.countApplications("",null), the further lines are not getting executed. I am not getting an error either.
What could be the reason.
Also what methods do I need to implement in the ImplTest12Client.java?

Regards,
Premhhh

Hi Prem,

Just want to double check, but are you calling the login message in the management api before you are calling countApplications and findApplications ? Both of those calls require that you login to the management api with a user with user permissions (most calls require admin permissions, which is the default for the service).

But a little surprised if that would just cause your code to fail silently. Let me know if you didn't call login first, and it fails silently on that call when you introduce it.

There shouldn't be any messages you need to implement on the client in order to list all applications.

Hope that helps,
Rick

Edited by: Richard Bolkey on Jan 7, 2009 10:00 AM

eeeks ... you need to move your code up in the file:


-----
// Connect to the service
server._startAndWaitUp( 4000 );

// TODO Insert Your Code Here

Move the underlined code here

// Disconnect from the service
try
{
System.out.println("here1");
server._stopAndWaitDown( 4000 );

you will be disconnected to the server at this point, that is what stopandwaitdown does

String key = server.registerApplication("test12", "Default", "administrator", "notc1sc0");
//System.out.println("AnswerAndPlay is registered: " + key);
//System.in.read();
System.out.println("here2");
int tee=server.countApplications("test",null);
Application[] tttt=server.findApplications("test", null, tee, null, null);
System.out.println(tttt);

}
catch(Exception e)
{
System.out.println("exception caught");
e.printStackTrace();
}

-----