Skip to content

Commit

Permalink
Cleanup Validation flow (#3171)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasirmod17 authored Oct 10, 2024
1 parent ea575d9 commit 87ae254
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public MutableList<? extends FunctionActivatorError> validate(Identity identity,
MutableList<HostedServiceError> errors = Lists.mutable.empty();
try
{
this.hostedServiceArtifactgenerator.validateOwner(identity, pureModel, activator, routerExtensions);
core_hostedservice_generation_generation.Root_meta_external_function_activator_hostedService_validator_validateService_HostedService_1__Boolean_1_(activator, pureModel.getExecutionSupport()); //returns true or errors out

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-protocol-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-extensions</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import org.eclipse.collections.api.factory.Maps;
import org.eclipse.collections.api.list.ListIterable;
import org.eclipse.collections.api.list.MutableList;
import org.finos.legend.engine.language.hostedService.generation.control.HostedServiceOwnerValidationService;
import org.finos.legend.engine.language.hostedService.generation.control.HostedServiceOwnerValidator;
import org.finos.legend.engine.plan.generation.extension.PlanGeneratorExtension;
import org.finos.legend.engine.plan.generation.transformers.PlanTransformer;
import org.finos.legend.engine.protocol.hostedService.deployment.model.GenerationInfoData;
Expand All @@ -35,10 +33,7 @@
import org.finos.legend.engine.protocol.pure.v1.model.executionPlan.CompositeExecutionPlan;
import org.finos.legend.engine.protocol.pure.v1.model.executionPlan.ExecutionPlan;
import org.finos.legend.engine.protocol.pure.v1.model.executionPlan.SingleExecutionPlan;
import org.finos.legend.engine.shared.core.identity.Identity;
import org.finos.legend.pure.generated.Root_meta_external_function_activator_Ownership;
import org.finos.legend.pure.generated.Root_meta_external_function_activator_hostedService_HostedService;
import org.finos.legend.pure.generated.Root_meta_external_function_activator_Ownership;
import org.finos.legend.pure.generated.Root_meta_pure_extension_Extension;
import org.finos.legend.pure.generated.core_hostedservice_generation_generation;
import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.ConcreteFunctionDefinition;
Expand Down Expand Up @@ -89,22 +84,6 @@ public static String generateLineage(PureModel pureModel, Root_meta_external_fun
return core_hostedservice_generation_generation.Root_meta_external_function_activator_hostedService_generation_computeLineage_HostedService_1__Extension_MANY__String_1_(activator, routerExtensions.apply(pureModel), pureModel.getExecutionSupport());
}

public boolean validateOwner(Identity identity, PureModel pureModel, Root_meta_external_function_activator_hostedService_HostedService activator, Function<PureModel, RichIterable<? extends Root_meta_pure_extension_Extension>> routerExtensions)
{
HostedServiceOwnerValidator<Root_meta_external_function_activator_Ownership> service = getOwnerValidatorService(activator,pureModel);
return service.isOwner(identity, activator._ownership());
}

public HostedServiceOwnerValidator<Root_meta_external_function_activator_Ownership> getOwnerValidatorService(Root_meta_external_function_activator_hostedService_HostedService activator, PureModel pureModel)
{
HostedServiceOwnerValidator<Root_meta_external_function_activator_Ownership> service = HostedServiceOwnerValidationService.extensions().select(c -> c.supports(activator._ownership())).getFirst();
if (service == null)
{
throw new RuntimeException(activator._ownership().getClass().getSimpleName() + "is not yet supported as an ownership model!");
}
return service;
}

public static PureModelContextData fetchHostedService(Root_meta_external_function_activator_hostedService_HostedService activator, PureModelContextData data, PureModel pureModel)
{
return PureModelContextData.newBuilder()
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 87ae254

Please sign in to comment.