public class org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager extends java.lang.Object implements org.finos.legend.engine.functionActivator.deployment.DeploymentManager
{
private static final org.slf4j.Logger LOGGER;
public static com.fasterxml.jackson.databind.ObjectMapper mapper;
public void <init>()
{
org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager v;
v := @this: org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager;
specialinvoke v.<java.lang.Object: void <init>()>();
return;
}
public boolean canDeploy(org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorArtifact)
{
org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager v;
org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorArtifact v;
boolean v;
v := @this: org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager;
v := @parameter: org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorArtifact;
v = v instanceof org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact;
return v;
}
public java.util.List selectConfig(java.util.List)
{
java.util.List v;
org.eclipse.collections.api.factory.list.MutableListFactory v;
org.eclipse.collections.api.list.MutableList v, v;
org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager v;
v := @this: org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager;
v := @parameter: java.util.List;
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.MutableListFactory mutable>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.MutableListFactory: org.eclipse.collections.api.list.MutableList withAll(java.lang.Iterable)>(v);
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: org.eclipse.collections.api.list.MutableList selectInstancesOf(java.lang.Class)>(class "Lorg/finos/legend/engine/protocol/hostedService/deployment/HostedServiceDeploymentConfiguration;");
return v;
}
public org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult deploy(org.finos.legend.engine.shared.core.identity.Identity, org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact)
{
org.finos.legend.engine.shared.core.identity.Identity v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact v;
org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorDeploymentConfiguration v;
org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager v;
v := @this: org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager;
v := @parameter: org.finos.legend.engine.shared.core.identity.Identity;
v := @parameter: org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact;
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact: org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorDeploymentConfiguration deploymentConfiguration>;
v = virtualinvoke v.<org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager: org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult doDeploy(org.finos.legend.engine.shared.core.identity.Identity,org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration,org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact)>(v, v, v);
return v;
}
public org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult deploy(org.finos.legend.engine.shared.core.identity.Identity, org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact, java.util.List)
{
org.finos.legend.engine.shared.core.identity.Identity v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact v;
org.eclipse.collections.api.block.predicate.Predicate v;
org.eclipse.collections.api.factory.list.MutableListFactory v;
org.eclipse.collections.api.list.MutableList v, v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration v;
java.util.List v;
org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorDeploymentConfiguration v;
java.lang.Object v;
java.lang.String v;
org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager v;
v := @this: org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager;
v := @parameter: org.finos.legend.engine.shared.core.identity.Identity;
v := @parameter: org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact;
v := @parameter: java.util.List;
v = <org.eclipse.collections.api.factory.Lists: org.eclipse.collections.api.factory.list.MutableListFactory mutable>;
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.MutableListFactory: org.eclipse.collections.api.list.MutableList withAll(java.lang.Iterable)>(v);
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact: java.lang.String version>;
if v != null goto label;
v = staticinvoke <org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager$lambda_deploy_a691df4d_1__10: org.eclipse.collections.api.block.predicate.Predicate bootstrap$()>();
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: org.eclipse.collections.api.list.MutableList select(org.eclipse.collections.api.block.predicate.Predicate)>(v);
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: java.lang.Object getFirst()>();
v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact: org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorDeploymentConfiguration deploymentConfiguration> = v;
goto label;
label:
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact: org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorDeploymentConfiguration deploymentConfiguration>;
label:
v = virtualinvoke v.<org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager: org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult doDeploy(org.finos.legend.engine.shared.core.identity.Identity,org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration,org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact)>(v, v, v);
return v;
}
public org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult doDeploy(org.finos.legend.engine.shared.core.identity.Identity, org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration, org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact)
{
org.apache.http.client.methods.HttpPost v;
org.finos.legend.engine.shared.core.identity.Identity v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact v;
org.apache.http.client.HttpClient v;
java.lang.String v, v, v, v;
java.net.URI v;
org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager v;
org.slf4j.Logger v;
org.apache.http.client.utils.URIBuilder v, v, v, v;
com.fasterxml.jackson.databind.ObjectMapper v;
org.apache.http.entity.StringEntity v;
java.security.PrivilegedExceptionAction v;
java.lang.Exception v;
javax.security.auth.Subject v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration v;
org.apache.http.impl.client.BasicCookieStore v;
org.finos.legend.engine.shared.core.operational.errorManagement.EngineException v;
java.util.Optional v;
java.lang.Object v;
v := @this: org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager;
v := @parameter: org.finos.legend.engine.shared.core.identity.Identity;
v := @parameter: org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration;
v := @parameter: org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact;
v = new org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult;
specialinvoke v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult: void <init>()>();
label:
v = new org.apache.http.client.methods.HttpPost;
v = new org.apache.http.client.utils.URIBuilder;
specialinvoke v.<org.apache.http.client.utils.URIBuilder: void <init>()>();
v = virtualinvoke v.<org.apache.http.client.utils.URIBuilder: org.apache.http.client.utils.URIBuilder setScheme(java.lang.String)>("http");
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration: java.lang.String domain>;
v = virtualinvoke v.<org.apache.http.client.utils.URIBuilder: org.apache.http.client.utils.URIBuilder setHost(java.lang.String)>(v);
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration: java.lang.String path>;
v = virtualinvoke v.<org.apache.http.client.utils.URIBuilder: org.apache.http.client.utils.URIBuilder setPath(java.lang.String)>(v);
v = virtualinvoke v.<org.apache.http.client.utils.URIBuilder: java.net.URI build()>();
specialinvoke v.<org.apache.http.client.methods.HttpPost: void <init>(java.net.URI)>(v);
v = new org.apache.http.entity.StringEntity;
v = <org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager: com.fasterxml.jackson.databind.ObjectMapper mapper>;
v = virtualinvoke v.<com.fasterxml.jackson.databind.ObjectMapper: java.lang.String writeValueAsString(java.lang.Object)>(v);
specialinvoke v.<org.apache.http.entity.StringEntity: void <init>(java.lang.String)>(v);
virtualinvoke v.<org.apache.http.entity.StringEntity: void setContentType(java.lang.String)>("application/json");
virtualinvoke v.<org.apache.http.client.methods.HttpPost: void setEntity(org.apache.http.HttpEntity)>(v);
v = new org.apache.http.impl.client.BasicCookieStore;
specialinvoke v.<org.apache.http.impl.client.BasicCookieStore: void <init>()>();
v = staticinvoke <org.finos.legend.engine.shared.core.kerberos.HttpClientBuilder: org.apache.http.client.HttpClient getHttpClient(org.apache.http.client.CookieStore)>(v);
v = virtualinvoke v.<org.finos.legend.engine.shared.core.identity.Identity: java.util.Optional getCredential(java.lang.Class)>(class "Lorg/finos/legend/engine/shared/core/identity/credential/LegendKerberosCredential;");
v = virtualinvoke v.<java.util.Optional: java.lang.Object get()>();
v = virtualinvoke v.<org.finos.legend.engine.shared.core.identity.credential.LegendKerberosCredential: javax.security.auth.Subject getSubject()>();
v = staticinvoke <org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager$lambda_doDeploy_0__11: java.security.PrivilegedExceptionAction bootstrap$(org.apache.http.impl.client.CloseableHttpClient,org.apache.http.client.methods.HttpPost,org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentResult)>(v, v, v);
staticinvoke <javax.security.auth.Subject: java.lang.Object doAs(javax.security.auth.Subject,java.security.PrivilegedExceptionAction)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = <org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager: org.slf4j.Logger LOGGER>;
interfaceinvoke v.<org.slf4j.Logger: void error(java.lang.String,java.lang.Throwable)>("Error deploying hosted service", v);
v = new org.finos.legend.engine.shared.core.operational.errorManagement.EngineException;
v = virtualinvoke v.<java.lang.Exception: java.lang.String getMessage()>();
specialinvoke v.<org.finos.legend.engine.shared.core.operational.errorManagement.EngineException: void <init>(java.lang.String)>(v);
throw v;
label:
return v;
catch java.lang.Exception from label to label with label;
}
public java.lang.String buildDeployStub(org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration, org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact)
{
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact v;
org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration v;
org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorDeploymentContent v;
int v;
java.lang.String v, v, v, v;
org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager v;
v := @this: org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager;
v := @parameter: org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration;
v := @parameter: org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact;
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration: java.lang.String domain>;
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration: int port>;
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceDeploymentConfiguration: java.lang.String path>;
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceArtifact: org.finos.legend.engine.protocol.functionActivator.deployment.FunctionActivatorDeploymentContent content>;
v = v.<org.finos.legend.engine.protocol.hostedService.deployment.HostedServiceContent: java.lang.String pattern>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String,int,java.lang.String,java.lang.String)>(v, v, v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("http://\u0001:\u0001\u0001\u0001");
return v;
}
static void <clinit>()
{
com.fasterxml.jackson.databind.ObjectMapper v;
org.slf4j.Logger v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lorg/finos/legend/engine/language/hostedService/generation/deployment/HostedServiceDeploymentManager;");
<org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager: org.slf4j.Logger LOGGER> = v;
v = staticinvoke <org.finos.legend.engine.shared.core.ObjectMapperFactory: com.fasterxml.jackson.databind.ObjectMapper getNewStandardObjectMapperWithPureProtocolExtensionSupports()>();
<org.finos.legend.engine.language.hostedService.generation.deployment.HostedServiceDeploymentManager: com.fasterxml.jackson.databind.ObjectMapper mapper> = v;
return;
}
}