Creating a Variable Provider for Use by a REST Call
Procedure
-
Create a class that extends com.datasynapse.fabric.broker.userartifact.variable.AbstractVariableProvider and override the methods as needed. For example:
package com.tibco.sf.providers; import java.util.Properties; import com.datasynapse.fabric.broker.userartifact.variable.AbstractVariableProvider; public class My_Var_Provider extends AbstractVariableProvider { private static final long serialVersionUID = 1L; @Override public Properties getVariables() { Properties p = new Properties(); p.setProperty("MyApp/vars/name", "SomeString"); p.setProperty("MyApp/vars/episodic", "true"); p.setProperty("MyApp/vars/Xduration", "60"); return p; } @Override public void destroy() {} @Override public void init() throws Exception {} }
- Export a JAR from it and save it to the TIBCO Silver Fabric Broker directory: SILVERFABRIC_HOME/webapps/livecluster/deploy/config/variableProviders
-
Create an XML file with the properties shown as follows to associate the new class for TIBCO Silver Fabric.
<variableProvider class="com.tibco.sf.providers.My_Var_Provider"> <property name="name" value="Some_PROVIDER_Name"/> <property name="description" value="GV values are in the JAR"/> <property name="enabled" value="true"/> </variableProvider>
The variable provider name used by the REST statement is specified as "name" in the XML file.
Save the XML file in the same directory as the JAR:
SILVERFABRIC_HOME/webapps/livecluster/deploy/config/variableProvidersYou can verify what variable providers are ready for use by the REST invocation on the TIBCO Silver Fabric Administrator > Admin > Variables page.
- NoDeploy
- (Optional) The default value is
false which means that the archive(s) are uploaded to the Silver Fabric Broker
and
they are deployed to the application endpoints. When
NoDeploy is set to true, the archives are uploaded with associated service enabler bindings created in TIBCO Administrator, but the archives are not deployed to a Silver Fabric engine and the application endpoint.
-F "NoDeploy=true"
- NoStart
- (Optional) The default value is
false, meaning that the archives are both deployed and started by default. If
NoStart is set to
true, the application is deployed, but not started.
-F "NoStart=true"
- NoStop
- (Optional) The default value is
false, meaning that running applications are stopped when a new archive is deployed. If
NoStop is set to
true, the application is not stopped when deployed.
-F "NoStop=true"
- STREAMBASE_SERVERURI
- (Required if you are using Streambase Channel) A Uniform Resource Identifier containing information necessary to connect to a StreamBase server. Example: sb://10.128.88.96:10000
- STREAMBASE_USERNAME
- (Required if you are using Streambase Channel) Name of the user if created, to connect to the Streambase server. But it can be left blank if no user is created.
- STREAMBASE_PASSWORD
- (Required if you are using Streambase Channel) Password to connect to the Streambase server user if created. It can be left blank if no user is created.
Copyright © Cloud Software Group, Inc. All rights reserved.