GatewayResource gatewayResource = new GatewayResource();
gatewayResource.setGatewayName((String) properties.get(GATEWAY_ID));
gatewayResource.setOwner((String) properties.get(GATEWAY_ID));
gatewayResource.save();
UserResource userResource1 = (UserResource) gatewayResource.create(ResourceType.USER);
userResource1.setUserName((String) properties.get(REGISTRY_USER));
userResource1.setPassword((String) properties.get(REGISTRY_PASSWORD));
userResource1.save();
UserResource userResource2 = (UserResource) gatewayResource.create(ResourceType.USER);
userResource2.setUserName("testUser");
userResource2.setPassword("testPassword");
userResource2.save();
WorkerResource workerResource1 = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
workerResource1.setUser(userResource1.getUserName());
workerResource1.save();
WorkerResource workerResource2 = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
workerResource2.setUser(userResource2.getUserName());
workerResource2.save();
}