getAttributeAsText(remoteApp, "key");
final String clientKey = getAttributeAsText(remoteApp, "clientKey");
final String baseUrl = getAttributeAsText(remoteApp, "baseUrl");
final AcHostModel acHost = AcHostModel.findByKey(clientKey)
.orElse(new Supplier<Option<AcHostModel>>()
{
@Override
public Option<AcHostModel> get()
{
return AcHostModel.findByUrl(baseUrl);
}
})
.getOrElse(new AcHostModel());
acHost.key = clientKey;
acHost.baseUrl = baseUrl;
acHost.publicKey = getAttributeAsText(remoteApp, "publicKey");
acHost.name = getAttributeAsText(remoteApp, "productType");