Dec. 22, 2015
This topic is for the developers/partners who would implement OSS Connector for CloudPortal Business Manager.
Downloading and Installing the OSS Service SDK
Creating the CS SDK Maven STS Project
Various package structure and their responsibilities
com.salesforce.ticket.lifecycle: Contains various Life Cycle Handlers
Default classes generated by the project and their functions
The project will generate three packages and will have default classes included in these packages. You must rename these classes to suit the functionality provided by the class. And also as a note, it is a default project structure generated for the ease of use and so packages/classes can be reorganized.
|Java package||Class Name||Functionality|
|XServiceConnectorImpl||Implementation class for com.citrix.cpbm.platform.spi .CloudServiceAdapter|
|XServiceImpl||Implements respective OSS Service. In case of ticketing it implements TicketService. Provides the actual service that is offered by this bundle.|
|XSUserLifeCycleHandler||Implements com.citrix.cpbm.platform.spi. UserLifeCycleHandler|
ServiceDefinition.xml file is located inside /com.salesforce.ticket/src/main/resources/ServiceDefinition.xml. When the mvn install is run, the config file is copied to the root folder of the package. By default, CloudPortal Business Manager platform searches for "ServiceDefinition.xml" file in the root folder of the deployed bundle. On locating the file, CloudPortal Business Manager parses the xml file and executes the steps to register the OSS Service.
OSS Service Connector
You may rename com.salesforce.ticket.connector.XServiceConnectorImpl to an appropriate Cloud Service Connector Implementation and provide its corresponding implementation.
CloudPortal Business Manager invokes this initialize method whenever required, to retrieve a OSS Service instance. On this instance, corresponding lifecycle handlers and collectors are invoked.
Configuring Connector and ServiceDefinition.xml
At this stage, we are ready with the connector and various class implementations required by the OSS Service connector.
Locate the sample ServiceDefinition.xml file and modify the parameters as per your needs. Most important parameters would be the Connector xml tag, ref attribute in the Connector xml tag and vendor version. Ref attribute should be the bean name of the implementation of "CloudConnectorFactory" interface, and version in the vendor should match with the version defined in the pom.xml file of the STS project.
Building OSGI Bundle from the project
Run mvn clean install at the root of the project path. An OSGI bundle jar will be generated in the target folder.
Publishing the OSGI Bundle to CloudPortal Business Manager
service cloud-portal stop
service cloud-portal start