forked from WeBankFinTech/Streamis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request WeBankFinTech#25 from WeDataSphere/dev-0.2.0-jobst…
…ate-interface [Feature] JobState component in launcher module
- Loading branch information
Showing
83 changed files
with
1,146 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>streamis</artifactId> | ||
<groupId>com.webank.wedatasphere.streamis</groupId> | ||
<version>0.2.0</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>streamis-appconn</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.webank.wedatasphere.dss</groupId> | ||
<artifactId>dss-appconn-core</artifactId> | ||
<version>${dss.version}</version> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>linkis-common</artifactId> | ||
<groupId>org.apache.linkis</groupId> | ||
</exclusion> | ||
<exclusion> | ||
<artifactId>json4s-jackson_2.11</artifactId> | ||
<groupId>org.json4s</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis-common</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis-module</artifactId> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> | ||
<artifactId>scala-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>2.3</version> | ||
<inherited>false</inherited> | ||
<executions> | ||
<execution> | ||
<id>make-assembly</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
<configuration> | ||
<descriptors> | ||
<descriptor>src/main/assembly/distribution.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<skipAssembly>false</skipAssembly> | ||
<finalName>out</finalName> | ||
<appendAssemblyId>false</appendAssemblyId> | ||
<attach>false</attach> | ||
<descriptors> | ||
<descriptor>src/main/assembly/distribution.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
<resources> | ||
<resource> | ||
<directory>src/main/java</directory> | ||
<includes> | ||
<include>**/*.xml</include> | ||
</includes> | ||
</resource> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<excludes> | ||
<exclude>**/application.yml</exclude> | ||
<exclude>**/bootstrap.yml</exclude> | ||
<exclude>**/log4j2.xml</exclude> | ||
</excludes> | ||
</resource> | ||
</resources> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!-- | ||
~ /* | ||
~ * Copyright 2021 WeBank | ||
~ * | ||
~ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ * you may not use this file except in compliance with the License. | ||
~ * You may obtain a copy of the License at | ||
~ * | ||
~ * http://www.apache.org/licenses/LICENSE-2.0 | ||
~ * | ||
~ * Unless required by applicable law or agreed to in writing, software | ||
~ * distributed under the License is distributed on an "AS IS" BASIS, | ||
~ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ * See the License for the specific language governing permissions and | ||
~ * limitations under the License. | ||
~ */ | ||
--> | ||
<assembly | ||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/2.3" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/2.3 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> | ||
<!-- Unique key --> | ||
<id>dss-streamis-appconn</id> | ||
<formats> | ||
<format>dir</format> | ||
</formats> | ||
<includeBaseDirectory>true</includeBaseDirectory> | ||
<baseDirectory>streamisAppConn</baseDirectory> | ||
|
||
<dependencySets> | ||
<dependencySet> | ||
<outputDirectory>lib</outputDirectory> | ||
<useProjectArtifact>true</useProjectArtifact> | ||
<useTransitiveDependencies>true</useTransitiveDependencies> | ||
<unpack>false</unpack> | ||
<useStrictFiltering>true</useStrictFiltering> | ||
<useTransitiveFiltering>true</useTransitiveFiltering> | ||
</dependencySet> | ||
</dependencySets> | ||
|
||
<fileSets> | ||
<!-- appconn.properties --> | ||
<fileSet> | ||
<directory>${basedir}/src/main/resources</directory> | ||
<includes> | ||
<include>appconn.properties</include> | ||
</includes> | ||
<fileMode>0777</fileMode> | ||
<outputDirectory>conf</outputDirectory> | ||
<lineEnding>unix</lineEnding> | ||
</fileSet> | ||
<!-- init.sql --> | ||
<fileSet> | ||
<directory>${basedir}/src/main/resources</directory> | ||
<includes> | ||
<include>init.sql</include> | ||
</includes> | ||
<fileMode>0777</fileMode> | ||
<outputDirectory>db</outputDirectory> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |
30 changes: 30 additions & 0 deletions
30
...s-appconn/src/main/java/com/webank/wedatasphere/streamis/dss/appconn/StreamisAppConn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.webank.wedatasphere.streamis.dss.appconn; | ||
|
||
import com.webank.wedatasphere.dss.appconn.core.ext.ThirdlyAppConn; | ||
import com.webank.wedatasphere.dss.appconn.core.impl.AbstractOnlySSOAppConn; | ||
import com.webank.wedatasphere.dss.standard.app.development.standard.DevelopmentIntegrationStandard; | ||
import com.webank.wedatasphere.dss.standard.app.structure.StructureIntegrationStandard; | ||
import com.webank.wedatasphere.streamis.dss.appconn.structure.StreamisStructureIntegrationStandard; | ||
import org.apache.linkis.common.conf.CommonVars; | ||
|
||
public class StreamisAppConn extends AbstractOnlySSOAppConn implements ThirdlyAppConn { | ||
|
||
public static final String STREAMIS_APPCONN_NAME = CommonVars.apply("wds.dss.appconn.streamis.name", "Streamis").getValue(); | ||
|
||
private StreamisStructureIntegrationStandard structureIntegrationStandard; | ||
|
||
@Override | ||
public DevelopmentIntegrationStandard getOrCreateDevelopmentStandard() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public StructureIntegrationStandard getOrCreateStructureStandard() { | ||
return structureIntegrationStandard; | ||
} | ||
|
||
@Override | ||
protected void initialize() { | ||
structureIntegrationStandard = new StreamisStructureIntegrationStandard(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ank/wedatasphere/streamis/dss/appconn/structure/StreamisStructureIntegrationStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.webank.wedatasphere.streamis.dss.appconn.structure; | ||
|
||
import com.webank.wedatasphere.dss.standard.app.structure.AbstractStructureIntegrationStandard; | ||
import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectService; | ||
import com.webank.wedatasphere.streamis.dss.appconn.structure.project.StreamisProjectService; | ||
|
||
/** | ||
* Structure integration standard | ||
*/ | ||
public class StreamisStructureIntegrationStandard extends AbstractStructureIntegrationStandard { | ||
|
||
/** | ||
* Singleton project service | ||
* @return | ||
*/ | ||
@Override | ||
protected ProjectService createProjectService() { | ||
return new StreamisProjectService(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...wedatasphere/streamis/dss/appconn/structure/project/StreamisProjectCreationOperation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.webank.wedatasphere.streamis.dss.appconn.structure.project; | ||
|
||
import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils; | ||
import com.webank.wedatasphere.dss.standard.app.sso.origin.request.action.DSSPostAction; | ||
import com.webank.wedatasphere.dss.standard.app.structure.AbstractStructureOperation; | ||
import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectCreationOperation; | ||
import com.webank.wedatasphere.dss.standard.app.structure.project.ref.DSSProjectContentRequestRef; | ||
import com.webank.wedatasphere.dss.standard.app.structure.project.ref.ProjectResponseRef; | ||
import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef; | ||
import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; | ||
import com.webank.wedatasphere.streamis.dss.appconn.StreamisAppConn; | ||
import com.webank.wedatasphere.streamis.dss.appconn.utils.StreamisCommonUtil; | ||
import org.apache.linkis.server.conf.ServerConfiguration; | ||
|
||
import java.util.List; | ||
|
||
public class StreamisProjectCreationOperation extends AbstractStructureOperation<DSSProjectContentRequestRef.DSSProjectContentRequestRefImpl, ProjectResponseRef> | ||
implements ProjectCreationOperation<DSSProjectContentRequestRef.DSSProjectContentRequestRefImpl> { | ||
|
||
private final static String PROJECT_CREATE_URL = "/api/rest_j/" + ServerConfiguration.BDP_SERVER_VERSION() + "/streamis/createProject"; | ||
|
||
@Override | ||
protected String getAppConnName() { | ||
return StreamisAppConn.STREAMIS_APPCONN_NAME; | ||
} | ||
|
||
@Override | ||
public ProjectResponseRef createProject(DSSProjectContentRequestRef.DSSProjectContentRequestRefImpl dssProjectContentRequestRef) throws ExternalOperationFailedException { | ||
String url = getBaseUrl() + PROJECT_CREATE_URL; | ||
DSSPostAction streamisPostAction = new DSSPostAction(); | ||
streamisPostAction.setUser(dssProjectContentRequestRef.getDSSProject().getCreateBy()); | ||
streamisPostAction.addRequestPayload("projectName",dssProjectContentRequestRef.getDSSProject().getName()); | ||
streamisPostAction.addRequestPayload("description", dssProjectContentRequestRef.getDSSProject().getDescription()); | ||
streamisPostAction.addRequestPayload("workspaceName", dssProjectContentRequestRef.getDSSProject().getWorkspaceName()); | ||
List<String> accessUsers = dssProjectContentRequestRef.getDSSProjectPrivilege().getAccessUsers(); | ||
List<String> editUsers = dssProjectContentRequestRef.getDSSProjectPrivilege().getEditUsers(); | ||
List<String> releaseUsers = dssProjectContentRequestRef.getDSSProjectPrivilege().getReleaseUsers(); | ||
streamisPostAction.addRequestPayload("accessUsers",accessUsers); | ||
streamisPostAction.addRequestPayload("editUsers",editUsers); | ||
streamisPostAction.addRequestPayload("releaseUsers",releaseUsers); | ||
ResponseRef responseRef = StreamisCommonUtil.getExternalResponseRef(dssProjectContentRequestRef, ssoRequestOperation, url, streamisPostAction); | ||
@SuppressWarnings("unchecked") | ||
Long projectId = DSSCommonUtils.parseToLong(responseRef.getValue("projectId")); | ||
return ProjectResponseRef.newExternalBuilder() | ||
.setRefProjectId(projectId.longValue()).success(); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.