Solution
A solution defines a set of managed objects that can be managed by agents other than the one defining the solution.
A solution can contain objects defined by the agent and can have links to other objects. A Solution must be registered before an agent is started.
For example,
final TeaSolution solution = new TeaSolution("sampleSolution", "This is my sample solution");
// Add tomcat reference
final TeaObjectHardLink hl = new TeaObjectHardLink() {
@Override
public String getName() {
return "Tomcat";
}
@Override
public String getDescription() {
return "Link to tomcat";
}
@Override
public String getObjectID() {
return "Tomcat:::server:t1";
}
};
solution.addMembers(devNode, platformapp, hl);
server.registerSolution(solution);
server.start();
Customizing the Solution
The
setCustomization method takes a String parameter to customize the UI for the solution. The following snippet shows an example of customizing the solution:
solution.setCustomization("{ " +
"\"solutionName\": \"SampleProductAgent Solution\"," +
"\"title\": \"SampleProductAgent\"," +
"\"subtitle\": \"SampleSolution\"," +
"\"columns\": [ " +
"{ \"label\": \"name\", \"expr\": \"name\", \"entityLink\": true }," +
"{ \"label\": \"agent name\", \"expr\": \"agentId\"}," +
"{ \"label\": \"type\", \"expr\": \"type.name\" }," +
"{ \"label\": \"description\", \"expr\": \"desc\" }," +
"{ \"label\": \"status\", \"expr\": \"status.state\" }" +
"]" +
"}");
The String passed to the method can customize the following:
Copyright © Cloud Software Group, Inc. All rights reserved.
