logger.error(e.getMessage(), e);
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
try{
GatewayResource gatewayResource = new GatewayResource();
gatewayResource.setGatewayName(RegistrySettings.getSetting(REGISTRY_DEFAULT_GATEWAY_ID));
gatewayResource.setOwner(RegistrySettings.getSetting(REGISTRY_DEFAULT_GATEWAY_ID));
gatewayResource.save();
UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
userResource.setUserName(RegistrySettings.getSetting(REGISTRY_DEFAULT_USER));
userResource.setPassword(RegistrySettings.getSetting(REGISTRY_DEFAULT_USER_PASSWORD));
userResource.save();
WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
workerResource.setUser(userResource.getUserName());
workerResource.save();
} catch (RegistrySettingsException e) {
logger.error("Unable to read properties", e);
}