forked from conductor-oss/conductor
-
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 branch 'main' of github.com:Netflix/conductor
- Loading branch information
Showing
70 changed files
with
1,052 additions
and
975 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
52 changes: 52 additions & 0 deletions
52
common/src/main/java/com/netflix/conductor/common/metadata/BaseDef.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,52 @@ | ||
/* | ||
* Copyright 2022 Netflix, Inc. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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. | ||
*/ | ||
package com.netflix.conductor.common.metadata; | ||
|
||
import java.util.Collections; | ||
import java.util.EnumMap; | ||
import java.util.Map; | ||
|
||
import com.netflix.conductor.common.metadata.acl.Permission; | ||
|
||
/** | ||
* A base class for {@link com.netflix.conductor.common.metadata.workflow.WorkflowDef} and {@link | ||
* com.netflix.conductor.common.metadata.tasks.TaskDef}. | ||
*/ | ||
public abstract class BaseDef extends Auditable { | ||
|
||
private final Map<Permission, String> accessPolicy = new EnumMap<>(Permission.class); | ||
|
||
public void addPermission(Permission permission, String allowedAuthority) { | ||
this.accessPolicy.put(permission, allowedAuthority); | ||
} | ||
|
||
public void removePermission(Permission permission) { | ||
this.accessPolicy.remove(permission); | ||
} | ||
|
||
public String getAllowedAuthority(Permission permission) { | ||
return this.accessPolicy.get(permission); | ||
} | ||
|
||
public void clearAccessPolicy() { | ||
this.accessPolicy.clear(); | ||
} | ||
|
||
public Map<Permission, String> getAccessPolicy() { | ||
return Collections.unmodifiableMap(this.accessPolicy); | ||
} | ||
|
||
public void setAccessPolicy(Map<Permission, String> accessPolicy) { | ||
this.accessPolicy.putAll(accessPolicy); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
common/src/main/java/com/netflix/conductor/common/metadata/acl/Permission.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,21 @@ | ||
/* | ||
* Copyright 2022 Netflix, Inc. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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. | ||
*/ | ||
package com.netflix.conductor.common.metadata.acl; | ||
|
||
import com.netflix.conductor.annotations.protogen.ProtoEnum; | ||
|
||
@ProtoEnum | ||
public enum Permission { | ||
OWNER, | ||
OPERATOR | ||
} |
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
182 changes: 182 additions & 0 deletions
182
core/src/main/java/com/netflix/conductor/core/execution/StartWorkflowInput.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,182 @@ | ||
/* | ||
* Copyright 2022 Netflix, Inc. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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. | ||
*/ | ||
package com.netflix.conductor.core.execution; | ||
|
||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
import com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest; | ||
import com.netflix.conductor.common.metadata.workflow.WorkflowDef; | ||
|
||
public class StartWorkflowInput { | ||
|
||
private String name; | ||
private Integer version; | ||
private WorkflowDef workflowDefinition; | ||
private Map<String, Object> workflowInput; | ||
private String externalInputPayloadStoragePath; | ||
private String correlationId; | ||
private Integer priority; | ||
private String parentWorkflowId; | ||
private String parentWorkflowTaskId; | ||
private String event; | ||
private Map<String, String> taskToDomain; | ||
private String workflowId; | ||
|
||
public StartWorkflowInput() {} | ||
|
||
public StartWorkflowInput(StartWorkflowRequest startWorkflowRequest) { | ||
this.name = startWorkflowRequest.getName(); | ||
this.version = startWorkflowRequest.getVersion(); | ||
this.workflowDefinition = startWorkflowRequest.getWorkflowDef(); | ||
this.correlationId = startWorkflowRequest.getCorrelationId(); | ||
this.priority = startWorkflowRequest.getPriority(); | ||
this.workflowInput = startWorkflowRequest.getInput(); | ||
this.externalInputPayloadStoragePath = | ||
startWorkflowRequest.getExternalInputPayloadStoragePath(); | ||
this.taskToDomain = startWorkflowRequest.getTaskToDomain(); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Integer getVersion() { | ||
return version; | ||
} | ||
|
||
public void setVersion(Integer version) { | ||
this.version = version; | ||
} | ||
|
||
public WorkflowDef getWorkflowDefinition() { | ||
return workflowDefinition; | ||
} | ||
|
||
public void setWorkflowDefinition(WorkflowDef workflowDefinition) { | ||
this.workflowDefinition = workflowDefinition; | ||
} | ||
|
||
public Map<String, Object> getWorkflowInput() { | ||
return workflowInput; | ||
} | ||
|
||
public void setWorkflowInput(Map<String, Object> workflowInput) { | ||
this.workflowInput = workflowInput; | ||
} | ||
|
||
public String getExternalInputPayloadStoragePath() { | ||
return externalInputPayloadStoragePath; | ||
} | ||
|
||
public void setExternalInputPayloadStoragePath(String externalInputPayloadStoragePath) { | ||
this.externalInputPayloadStoragePath = externalInputPayloadStoragePath; | ||
} | ||
|
||
public String getCorrelationId() { | ||
return correlationId; | ||
} | ||
|
||
public void setCorrelationId(String correlationId) { | ||
this.correlationId = correlationId; | ||
} | ||
|
||
public Integer getPriority() { | ||
return priority; | ||
} | ||
|
||
public void setPriority(Integer priority) { | ||
this.priority = priority; | ||
} | ||
|
||
public String getParentWorkflowId() { | ||
return parentWorkflowId; | ||
} | ||
|
||
public void setParentWorkflowId(String parentWorkflowId) { | ||
this.parentWorkflowId = parentWorkflowId; | ||
} | ||
|
||
public String getParentWorkflowTaskId() { | ||
return parentWorkflowTaskId; | ||
} | ||
|
||
public void setParentWorkflowTaskId(String parentWorkflowTaskId) { | ||
this.parentWorkflowTaskId = parentWorkflowTaskId; | ||
} | ||
|
||
public String getEvent() { | ||
return event; | ||
} | ||
|
||
public void setEvent(String event) { | ||
this.event = event; | ||
} | ||
|
||
public Map<String, String> getTaskToDomain() { | ||
return taskToDomain; | ||
} | ||
|
||
public void setTaskToDomain(Map<String, String> taskToDomain) { | ||
this.taskToDomain = taskToDomain; | ||
} | ||
|
||
public String getWorkflowId() { | ||
return workflowId; | ||
} | ||
|
||
public void setWorkflowId(String workflowId) { | ||
this.workflowId = workflowId; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
StartWorkflowInput that = (StartWorkflowInput) o; | ||
return Objects.equals(name, that.name) | ||
&& Objects.equals(version, that.version) | ||
&& Objects.equals(workflowDefinition, that.workflowDefinition) | ||
&& Objects.equals(workflowInput, that.workflowInput) | ||
&& Objects.equals( | ||
externalInputPayloadStoragePath, that.externalInputPayloadStoragePath) | ||
&& Objects.equals(correlationId, that.correlationId) | ||
&& Objects.equals(priority, that.priority) | ||
&& Objects.equals(parentWorkflowId, that.parentWorkflowId) | ||
&& Objects.equals(parentWorkflowTaskId, that.parentWorkflowTaskId) | ||
&& Objects.equals(event, that.event) | ||
&& Objects.equals(taskToDomain, that.taskToDomain) | ||
&& Objects.equals(workflowId, that.workflowId); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash( | ||
name, | ||
version, | ||
workflowDefinition, | ||
workflowInput, | ||
externalInputPayloadStoragePath, | ||
correlationId, | ||
priority, | ||
parentWorkflowId, | ||
parentWorkflowTaskId, | ||
event, | ||
taskToDomain, | ||
workflowId); | ||
} | ||
} |
Oops, something went wrong.