
com.centurylink.mdw.dataaccess.ProcessPersister Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mdw-common Show documentation
Show all versions of mdw-common Show documentation
MDW is a microservices based workflow framework
/*
* Copyright (C) 2017 CenturyLink, Inc.
*
* 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.
*/
package com.centurylink.mdw.dataaccess;
import com.centurylink.mdw.model.asset.Asset;
import com.centurylink.mdw.model.event.ExternalEvent;
import com.centurylink.mdw.model.task.TaskTemplate;
import com.centurylink.mdw.model.workflow.Package;
import com.centurylink.mdw.model.workflow.Process;
import org.apache.xmlbeans.XmlException;
/**
* common interface for all process persistence
*/
public interface ProcessPersister {
public static enum PersistType {
CREATE, CREATE_JSON, UPDATE, NEW_VERSION, IMPORT, IMPORT_JSON, SAVE
}
int getDatabaseVersion();
Long persistPackage(Package packageVO, PersistType persistType)
throws DataAccessException;
int deletePackage(Long packageId)
throws DataAccessException;
void deleteProcess(Process process)
throws DataAccessException;
Long persistProcess(Process process, PersistType persistType)
throws DataAccessException, XmlException;
void createExternalEvent(ExternalEvent eventHandler)
throws DataAccessException;
void deleteExternalEvent(Long handlerId)
throws DataAccessException;
void updateExternalEvent(ExternalEvent eventHandler)
throws DataAccessException;
void createTaskTemplate(TaskTemplate taskTemplate)
throws DataAccessException;
void deleteTaskTemplate(Long taskId)
throws DataAccessException;
void updateTaskTemplate(TaskTemplate taskTemplate)
throws DataAccessException;
long renameProcess(Long processId, String newName, int newVersion)
throws DataAccessException;
long renamePackage(Long packageId, String newName, int newVersion)
throws DataAccessException;
/**
* TODO: The signatures for renameProcess() and renamePackage() should be similar.
*/
void renameAsset(Asset asset, String newName)
throws DataAccessException;
long addProcessToPackage(Long processId, Long packageId)
throws DataAccessException;
void removeProcessFromPackage(Long processId, Long packageId)
throws DataAccessException;
long addExternalEventToPackage(Long externalEventId, Long packageId)
throws DataAccessException;
void removeExternalEventFromPackage(Long externalEventId, Long packageId)
throws DataAccessException;
long addTaskTemplateToPackage(Long taskId, Long packageId)
throws DataAccessException;
void removeTaskTemplateFromPackage(Long taskId, Long packageId)
throws DataAccessException;
long addAssetToPackage(Long assetId, Long packageId)
throws DataAccessException;
void removeAssetFromPackage(Long assetId, Long packageId)
throws DataAccessException;
Long createAsset(Asset asset)
throws DataAccessException;
void updateAsset(Asset asset)
throws DataAccessException;
void deleteAsset(Long assetId)
throws DataAccessException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy