GatewayResource gatewayResource = new GatewayResource();
gatewayResource.setGatewayName(RegistrySettings.getSetting("default.registry.gateway"));
gatewayResource.setOwner(RegistrySettings.getSetting("default.registry.gateway"));
gatewayResource.save();
UserResource userResource = new UserResource();
userResource.setUserName(RegistrySettings.getSetting("default.registry.user"));
userResource.setPassword(RegistrySettings.getSetting("default.registry.password"));
userResource.save();
WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
workerResource.setUser(userResource.getUserName());
workerResource.save();
ProjectResource projectResource = (ProjectResource)workerResource.create(ResourceType.PROJECT);
projectResource.setGateway(gatewayResource);
projectResource.setId("default");