The SDK is a Java wrapper that uses the SDKService web service to access CA Configuration Automation data and present it in a logical, object-oriented manner. The SDK is shipped in the cca-api.jar JAR file. The SDK uses an auxiliary file (cca-aux.jar) that contains open-source utilities. Applications external to CA Configuration Automation can use the classes that the SDK defines to access the SDKService and to program against objects that represent CA Configuration Automation-managed data.
You can access Javadoc pages for classes in the cca-api.jar file in the following locations:
Note: If bulk SDK client API methods fail, they display the following message:
java.lang.StackOverflowError.
To avoid this issue, use the following JVM option to increase the native stack size to 2 MB:
>java -Xss2m
Gradually increase the native stack size until the error message does not appear if the issue persists.
The com.ca.acm.sdk.net package contains classes that establish the connectivity with, and provide session credentials to the CA Configuration Automation Server. As the following example shows, com.ca.acm.sdk.net.ACMSDKService is the primary class that CA Configuration Automation uses for this setup:
import com.ca.acm.sdk.net.ACMSDKService;
if (ACMSDKService.locateService(http://<yourserver>:port/services/SDKService) )
{
if (ACMSDKService.beginSession(username, password) )
{
// do some work
Server[] server = Server.getAllServers();
...
}
ACMSDKService.endsession();
}
The product uses ACMSDKService static methods to set up and tear down ThreadLocal connectivity and session credentials. After you use the locateServer() and beginSession() methods to set up a session, the product manages the connectivity and session parameters in the ACMSDKService class. The Subsequent calls to SDK methods use the ThreadLocal connectivity and session parameters without a need to view or handle session credentials directly.
Note: Connectivity and session setup are ThreadLocal. Therefore, in multithreaded applications, verify that SDK calls are made from the thread where the connectivity was originally established.
The ACMSDKService.endsession() method closes established sessions and clears the connectivity that the locateServer() call set up.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|