...
In order to compile your java class, you will need FlexDeployAPI.jar on classpath.
Implement getSecret method to return secret value for inputs provider in Map<String, Serializable> method input.
String key for the map is Input Name configured on credential store provider screen.
Serializable value for each map item is value configured for specific input. You will receive data types like String, Boolean, Double and Integer.
You can use property values by invoking getCSInstanceProperties() method which will return Map<String, Serializable> representing property values configured for credential store. Similar to inputs, this map has property name for key.
If you encounter an issue with accessing credential store you can throw exception. For example, throw new ApiException("Failed to get credential", e);
Once you are ready with unit testing, you can prepare Jar file for your credential store java class and other utility classes. This jar file can be placed on server classpath now.
For Tomcat, put this jar file in apache-tomcat-flexdeploy/lib folder.
For WebLogic, put this jar file in Domain lib folder.
If you are using any third party libraries from your Java implementation, then those jar files will also need to be added to same lib folder. Keep in mind that this can cause issues with server functioning, so be prepared to remove your additional library files.
...
Tip |
---|
As groovy is able to access Java classes, you can take advantage of Java libraries from Groovy script. For example, if there is Java library available for specific credential store, you can places place those in lib the libext folder and use those classes from Groovy script. This allows you to keep the dynamic part of implementation in Groovy and use a Java library. |