use of io.fabric8.api.FabricService in project fabric8 by jboss-fuse.
the class FabricResource method setRequirements.
@POST
@Path("requirements")
public void setRequirements(FabricRequirements requirements) throws IOException {
Objects.notNull(requirements, "requirements");
FabricService service = getFabricService();
Objects.notNull(service, "FabricService");
service.setRequirements(requirements);
}
use of io.fabric8.api.FabricService in project fabric8 by jboss-fuse.
the class ProfileResource method deleteProfile.
@DELETE
public void deleteProfile() {
FabricService fabricService = getFabricService();
Objects.notNull(fabricService, "fabricService");
ProfileService profileService = getProfileService();
Objects.notNull(profileService, "profileService");
profileService.deleteProfile(fabricService, profile.getVersion(), profile.getId(), true);
}
use of io.fabric8.api.FabricService in project fabric8 by jboss-fuse.
the class ResourceSupport method getProfileService.
protected ProfileService getProfileService() {
FabricService fabricService = getFabricService();
ProfileService profileService = null;
if (fabricService != null) {
profileService = fabricService.adapt(ProfileService.class);
}
return profileService;
}
use of io.fabric8.api.FabricService in project fabric8 by jboss-fuse.
the class CamelProfileScriptTest method testFeatures.
@Test
public void testFeatures() throws Exception {
System.out.println(executeCommand("fabric:create -n --wait-for-provisioning"));
// System.out.println(executeCommand("shell:info"));
// System.out.println(executeCommand("fabric:info"));
// System.out.println(executeCommand("fabric:profile-list"));
ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);
try {
FabricService fabricService = fabricProxy.getService();
Set<ContainerProxy> containers = ContainerBuilder.create(fabricProxy).withName("feature-camel").withProfiles("feature-camel").assertProvisioningResult().build();
try {
CuratorFramework curator = fabricService.adapt(CuratorFramework.class);
assertProvisionedFeature(fabricService, curator, containers, "camel-script-javascript", "feature-camel", "scriptengines-javascript");
} finally {
ContainerBuilder.destroy(containers);
}
} finally {
fabricProxy.close();
}
}
use of io.fabric8.api.FabricService in project fabric8 by jboss-fuse.
the class CamelProfileTest method testFeatures.
@Test
public void testFeatures() throws Exception {
System.out.println(executeCommand("fabric:create -n --wait-for-provisioning"));
// System.out.println(executeCommand("shell:info"));
// System.out.println(executeCommand("fabric:info"));
// System.out.println(executeCommand("fabric:profile-list"));
ServiceProxy<FabricService> fabricProxy = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);
try {
FabricService fabricService = fabricProxy.getService();
Set<ContainerProxy> containers = ContainerBuilder.create(fabricProxy).withName("feature-camel").withProfiles("feature-camel").assertProvisioningResult().build();
try {
CuratorFramework curator = fabricService.adapt(CuratorFramework.class);
assertProvisionedFeature(fabricService, curator, containers, "camel-http", "feature-camel", "camel-http");
assertProvisionedFeature(fabricService, curator, containers, "camel-jetty", "feature-camel", "camel-jetty");
assertProvisionedFeature(fabricService, curator, containers, "camel-jms", "feature-camel", "camel-jms");
assertProvisionedFeature(fabricService, curator, containers, "camel-ftp", "feature-camel", "camel-ftp");
assertProvisionedFeature(fabricService, curator, containers, "camel-quartz", "feature-camel", "camel-quartz");
} finally {
ContainerBuilder.destroy(containers);
}
} finally {
fabricProxy.close();
}
}
Aggregations