diff --git a/osam-core/async-jobs/pom.xml b/osam-core/async-jobs/pom.xml
new file mode 100644
index 0000000..1cc2ec6
--- /dev/null
+++ b/osam-core/async-jobs/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--/*-
+        * ============LICENSE_START=======================================================
+        * OSAM Core
+        * ================================================================================
+        * Copyright (C) 2018 Netsia
+        * ================================================================================
+        * 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.
+        * ============LICENSE_END=========================================================
+        */-->
+
+<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>osam-core</artifactId>
+        <groupId>org.onap.osam</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>async-jobs</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.osam</groupId>
+            <artifactId>common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.osam</groupId>
+            <artifactId>model</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/AsyncJobService.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/AsyncJobService.java
new file mode 100644
index 0000000..940bc5f
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/AsyncJobService.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+package org.onap.osam.job;
+
+import org.onap.osam.job.dao.job.JobStatus;
+
+import java.util.List;
+import java.util.UUID;
+
+public interface AsyncJobService {
+
+    JobStatus calcStatus(String asyncRequestStatus);
+
+    List<UUID> pushBulkJob(String userId, boolean isSuccessful, boolean isOLTDependant);
+
+/*
+    List<String> PARAMS_TO_IGNORE = Arrays.asList("vnf_name", "vf_module_name");
+
+    List<ServiceInfo> getAllServicesInfo();
+
+
+    String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest);
+
+    String getOrchestrationRequestsPath();
+
+    ServiceInfo getServiceInfoByJobId(UUID jobUUID);
+
+    List<JobAuditStatus> getAuditStatuses(UUID jobUUID, JobAuditStatus.SourceStatus source);
+
+    ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater);
+
+    ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus);
+
+    void auditVidStatus(UUID jobUUID, Job.JobStatus jobStatus);
+
+    void auditMsoStatus(UUID jobUUID, AsyncRequestStatus.Request msoRequestStatus);
+
+    void auditMsoStatus(UUID jobUUID, String jobStatus, String requestId, String additionalInfo);
+
+    void handleFailedInstantiation(UUID jobUUID);
+
+    void deleteJob(UUID jobId);
+
+    void hideServiceInfo(UUID jobUUID);
+
+    int getCounterForName(String name);
+
+    int getMaxRetriesGettingFreeNameFromAai();
+
+    void setMaxRetriesGettingFreeNameFromAai(int maxRetriesGettingFreeNameFromAai);
+
+    String getUniqueName(String name, ResourceType resourceType);
+*/
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobCommand.java
new file mode 100644
index 0000000..ca594c0
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobCommand.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job;
+
+import org.onap.osam.job.impl.JobSharedData;
+
+import java.util.Map;
+
+
+/**
+ * A callable instance, with serializable characteristics.
+ * Represents a step in a chain of steps, which eventualy
+ * resides into a packing Job.
+ */
+public interface IJobCommand {
+
+    /**
+     * Initialize the command state
+     * @param sharedData shared data cross all job commands
+     * @param commandData An input to be set into the command. Each implementation may expect different keys in the map.
+     * @return Returns itself
+     */
+    default IJobCommand init(JobSharedData sharedData, Map<String, Object> commandData) {
+        return this;
+    }
+
+    /**
+     * @return Returns the inner state of the command. This state, once passed into init(), should
+     *         bring the command back to it's state.
+     */
+    Map<String, Object> getData();
+
+    /**
+     * Execute the command represented by this instance. Assumes the instance is already init().
+     * @return A NextCommand containing the next command in chain of commands, or null if chain
+     *         should be terminated. Might return itself (packed in a NextCommand).
+     */
+    NextCommand call();
+
+    default JobType getType() {
+        return JobType.jobTypeOf(this.getClass());
+    }
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobFactory.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobFactory.java
new file mode 100644
index 0000000..460aba2
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobFactory.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job;
+
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.impl.JobSharedData;
+
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * kind of factory for creating jobs and converting them to Job Model
+ */
+public interface IJobFactory {
+/*
+    JobModel toModel(Job job);
+*/
+
+    OsamJob createRootJob(JobType jobType, AsyncJobRequest request, String userId, Integer indexInBulk, Map<String, Object> jobData);
+
+    OsamJob createChildJob(JobType jobType, JobStatus jobStatus, AsyncJobRequest request, JobSharedData parentSharedData, Map<String, Object> jobData);
+
+    // Marks types that are an AsyncJob payload
+    interface AsyncJobRequest {
+    }
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobsDataAccessService.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobsDataAccessService.java
new file mode 100644
index 0000000..231c057
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/IJobsDataAccessService.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job;
+
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+
+import java.util.Collection;
+import java.util.Optional;
+import java.util.UUID;
+
+public interface IJobsDataAccessService {
+
+    UUID add(OsamJob job);
+
+    Optional<OsamJob> pull(JobStatus topic, String ownerId);
+
+    void pushBack(OsamJob job);
+
+    Collection<OsamJob> peek();
+
+    OsamJob peek(UUID jobId);
+
+    void delete(UUID jobId);
+
+    boolean mute(UUID jobId);
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/JobType.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/JobType.java
new file mode 100644
index 0000000..1cabcad
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/JobType.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job;
+
+import org.onap.osam.job.command.HttpCallCommand;
+import org.onap.osam.job.command.NoOpCommand;
+import org.onap.osam.job.command.WatchingCommand;
+import org.onap.osam.job.command.demo.ChassisCommand;
+import org.onap.osam.job.command.demo.OLTCommand;
+
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+
+public enum JobType {
+
+    HttpCall(HttpCallCommand.class),
+    Watching(WatchingCommand.class),
+    NoOp(NoOpCommand.class),
+    //Demo
+    ChassisCreation(ChassisCommand.class),
+    OLTCreation(OLTCommand.class);
+
+    private static final Map<Class, JobType> REVERSE_MAP = Stream.of(values())
+            .collect(Collectors.toMap(t -> t.getCommandClass(), t -> t));
+
+    private final Class commandClass;
+
+    <T extends IJobCommand> JobType(Class<T> commandClass) {
+        this.commandClass = commandClass;
+    }
+
+    public Class getCommandClass() {
+        return commandClass;
+    }
+    static JobType jobTypeOf(Class commandClass) {
+        return REVERSE_MAP.get(commandClass);
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/NextCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/NextCommand.java
new file mode 100644
index 0000000..6a61322
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/NextCommand.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job;
+
+import org.onap.osam.job.dao.job.JobStatus;
+
+public class NextCommand {
+    private final JobStatus status;
+    private final IJobCommand command;
+
+    public NextCommand(JobStatus nextStatus, IJobCommand nextCommand) {
+        this.status = nextStatus;
+        this.command = nextCommand;
+    }
+
+    public NextCommand(JobStatus nextStatus) {
+        this.status = nextStatus;
+        this.command = null;
+    }
+
+    public JobStatus getStatus() {
+        return status;
+    }
+
+    public IJobCommand getCommand() {
+        return command;
+    }
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/BaseInProgressStatusCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/BaseInProgressStatusCommand.java
new file mode 100644
index 0000000..e1de031
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/BaseInProgressStatusCommand.java
@@ -0,0 +1,142 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import com.google.common.collect.ImmutableMap;
+import lombok.extern.slf4j.Slf4j;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.IJobFactory;
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.IJobsDataAccessService;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.AsyncJobService;
+import org.onap.osam.job.impl.JobSharedData;
+import org.onap.osam.job.utils.TimeUtils;
+
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeParseException;
+import java.util.Map;
+
+@Slf4j
+public abstract class BaseInProgressStatusCommand extends CommandBase implements IJobCommand {
+
+    protected AsyncJobService asyncInstantiationBL;
+
+    protected IJobsDataAccessService jobsDataAccessService;
+
+    protected IJobFactory jobAdapter;
+
+/*
+    @Inject
+    protected RestMsoImplementation restMso;
+
+    @Inject
+    protected AuditService auditService;
+*/
+
+    protected String requestId;
+
+    protected String instanceId;
+
+
+    @Override
+    public NextCommand call() {
+
+     //   try {
+            String asyncRequestStatus = getAsyncRequestStatus();
+            //asyncInstantiationBL.auditMsoStatus(getSharedData().getRootJobId(), asyncRequestStatus.get().request);
+            JobStatus jobStatus = asyncInstantiationBL.calcStatus(asyncRequestStatus);
+            ZonedDateTime jobStartTime = getZonedDateTime(asyncRequestStatus);
+            jobStatus = isExpired(jobStartTime) ? JobStatus.FAILED : jobStatus;
+            return processJobStatus(jobStatus);
+
+            //TODO error handling
+  /*      } catch (javax.ws.rs.ProcessingException e) {
+            // Retry when we can't connect MSO during getStatus
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "Cannot get orchestration status for {}, will retry: {}", requestId, e, e);
+            return new NextCommand(JobStatus.IN_PROGRESS, this);
+        } catch (BadResponseFromMso e) {
+            return handleFailedMsoResponse(e.getMsoResponse());
+        }
+        catch (RuntimeException e) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "Cannot get orchestration status for {}, stopping: {}", requestId, e, e);
+            return new NextCommand(JobStatus.STOPPED, this);
+        }*/
+    }
+
+    abstract NextCommand processJobStatus(JobStatus jobStatus);
+
+    abstract boolean isExpired(ZonedDateTime jobStartTime);
+
+    private String getAsyncRequestStatus() {
+/*
+        String path = asyncInstantiationBL.getOrchestrationRequestsPath()+"/"+requestId;
+        RestObject<AsyncRequestStatus> msoResponse = restMso.GetForObject(path, AsyncRequestStatus.class);
+        if (msoResponse.getStatusCode() >= 400 || msoResponse.get() == null) {
+            throw new BadResponseFromMso(msoResponse);
+        }
+*/
+        //TODO
+        return "dummy";
+    }
+
+    /*private NextCommand handleFailedMsoResponse(RestObject<AsyncRequestStatus> msoResponse) {
+        auditService.setFailedAuditStatusFromMso(getSharedData().getJobUuid(), requestId, msoResponse.getStatusCode(), msoResponse.getRaw());
+        LOGGER.error(EELFLoggerDelegate.errorLogger,
+                "Failed to get orchestration status for {}. Status code: {},  Body: {}",
+                requestId, msoResponse.getStatusCode(), msoResponse.getRaw());
+        return new NextCommand(JobStatus.IN_PROGRESS, this);
+    }*/
+
+    @Override
+    public BaseInProgressStatusCommand init(JobSharedData sharedData, Map<String, Object> commandData) {
+        return init(sharedData, (String) commandData.get("requestId"), (String) commandData.get("instanceId"));
+    }
+
+
+    protected BaseInProgressStatusCommand init(JobSharedData sharedData,
+                                               String requestId,
+                                               String instanceId) {
+        init(sharedData);
+        this.requestId = requestId;
+        this.instanceId = instanceId;
+        return this;
+    }
+
+    @Override
+    public Map<String, Object> getData() {
+        return ImmutableMap.of(
+            "requestId", requestId,
+            "instanceId", instanceId
+        );
+    }
+
+    private ZonedDateTime getZonedDateTime(String response) {
+        ZonedDateTime jobStartTime;
+        try {
+            //TODO dummy time until real impl is provided
+            jobStartTime = TimeUtils.parseZonedDateTime(ZonedDateTime.now().toString());
+        } catch (DateTimeParseException | NullPointerException e) {
+            log.error("Failed to parse start time for {}, body: {}. Current time will be used", requestId, response, e);
+            jobStartTime = ZonedDateTime.now();
+        }
+        return jobStartTime;
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/BaseWatchingCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/BaseWatchingCommand.java
new file mode 100644
index 0000000..711c27d
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/BaseWatchingCommand.java
@@ -0,0 +1,117 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import lombok.extern.slf4j.Slf4j;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.AsyncJobService;
+import org.onap.osam.job.impl.JobSharedData;
+import org.onap.osam.job.repository.job.OsamJobRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+@Slf4j
+public abstract class BaseWatchingCommand extends CommandBase implements IJobCommand {
+
+    @Autowired
+    protected AsyncJobService asyncInstantiationBL;
+
+    @Autowired
+    private OsamJobRepository osamJobRepository;
+
+    private List<UUID> childrenJobsIds;
+
+    protected boolean isRoot;
+
+    public BaseWatchingCommand() {}
+
+    public BaseWatchingCommand(JobSharedData sharedData, List<UUID> childrenJobsIds, boolean isRoot) {
+        init(sharedData, childrenJobsIds, isRoot);
+    }
+
+    @Override
+    public BaseWatchingCommand init(JobSharedData sharedData, Map<String, Object> commandData) {
+        return init(
+                sharedData,
+                ((List<String>) commandData.get("childrenJobs")).stream().map(x -> UUID.fromString(x)).collect(Collectors.toList()),
+                (boolean) commandData.get("isRoot")
+        );
+    }
+
+    protected BaseWatchingCommand init(JobSharedData sharedData, List<UUID> childrenJobsIds, boolean isRoot) {
+        super.init(sharedData);
+        this.childrenJobsIds = CollectionUtils.isEmpty(childrenJobsIds) ? new ArrayList<>() : childrenJobsIds;
+        this.isRoot = isRoot;
+        return this;
+    }
+
+    @Override
+    public NextCommand call() {
+        Map<UUID, OsamJob> jobs = getAllChildrenJobs();
+
+        boolean isAllChildrenFinal = true;
+        boolean hasFailedChild = false;
+        for (UUID jobId: childrenJobsIds) {
+            OsamJob job = jobs.get(jobId);
+
+
+            //if job not found - we assume it failed
+            if (job == null || job.getStatus() == null) {
+                hasFailedChild = true;
+                continue;
+            }
+
+            if (!job.getStatus().isFinal()) {
+                isAllChildrenFinal = false;
+            } else if (!job.getStatus().equals(JobStatus.COMPLETED)) {
+                //if job status is final - check if it failed status
+                hasFailedChild = true;
+            }
+        }
+
+        return getNextCommand(isAllChildrenFinal, hasFailedChild);
+    }
+
+    private Map<UUID, OsamJob> getAllChildrenJobs() {
+        List<OsamJob> jobs = osamJobRepository.findAllByUuid(childrenJobsIds);
+        return jobs.stream().collect(Collectors.toMap(OsamJob::getUuid, item -> item));
+    }
+
+    protected abstract NextCommand getNextCommand(boolean isAllChildrenFinal, boolean hasFailedChild);
+
+
+    @Override
+    public Map<String, Object> getData() {
+        Map<String, Object> data = new HashMap<>();
+        data.put("childrenJobs", childrenJobsIds);
+        data.put("isRoot", isRoot);
+        return data;
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/CommandBase.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/CommandBase.java
new file mode 100644
index 0000000..94c43e7
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/CommandBase.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+import org.onap.osam.job.impl.JobSharedData;
+@Slf4j
+@Getter
+@Setter
+public abstract class CommandBase {
+
+    private JobSharedData sharedData;
+
+    protected CommandBase init(JobSharedData sharedData) {
+        this.setSharedData(sharedData);
+        return this;
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/HttpCallCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/HttpCallCommand.java
new file mode 100644
index 0000000..372d751
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/HttpCallCommand.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import com.google.common.collect.ImmutableMap;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.impl.JobSharedData;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.http.HttpEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+import java.util.UUID;
+
+
+@Component
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class HttpCallCommand implements IJobCommand {
+    private String url;
+    private UUID uuid;
+
+    public HttpCallCommand() {
+    }
+
+    public HttpCallCommand(String url, UUID uuid) {
+        init(url, uuid);
+    }
+
+    @Override
+    public NextCommand call() {
+        RestTemplate restTemplate = new RestTemplate();
+        HttpEntity<String> request = new HttpEntity<>(new String(uuid.toString()));
+        String str = restTemplate.postForObject(url, request, String.class);
+        return new NextCommand(JobStatus.COMPLETED);
+    }
+
+    @Override
+    public HttpCallCommand init(JobSharedData sharedData, Map<String, Object> commandData) {
+        return init((String) commandData.get("url"), sharedData.getJobUuid());
+    }
+
+    private HttpCallCommand init(String url, UUID jobUuid) {
+        this.url = url;
+        this.uuid = jobUuid;
+        return this;
+    }
+
+    @Override
+    public Map<String, Object> getData() {
+        return ImmutableMap.of("url", url);
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/JobCommandFactory.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/JobCommandFactory.java
new file mode 100644
index 0000000..dc92182
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/JobCommandFactory.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import org.onap.osam.common.exception.GenericUncheckedException;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobCommand;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Component;
+
+import java.util.function.Function;
+
+@Component
+public class JobCommandFactory {
+
+    final Function<Class<? extends IJobCommand>, IJobCommand> jobFactory;
+
+    @Autowired
+    public JobCommandFactory(ApplicationContext applicationContext) {
+        this.jobFactory = (jobType -> {
+            final Object commandBean = applicationContext.getBean(jobType);
+
+            if (!(commandBean instanceof IJobCommand)) {
+                throw new GenericUncheckedException(commandBean.getClass() + " is not a IJobCommand");
+            }
+
+            return (IJobCommand) commandBean;
+        });
+    }
+
+    public JobCommandFactory(Function<Class<? extends IJobCommand>, IJobCommand> jobFactory) {
+        this.jobFactory = jobFactory;
+    }
+
+    public IJobCommand toCommand(OsamJob job) {
+
+        final IJobCommand command = jobFactory.apply(job.getType().getCommandClass());
+        command.init(job.getSharedData(), job.getDataMap());
+
+        return command;
+    }
+
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/NoOpCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/NoOpCommand.java
new file mode 100644
index 0000000..8f110a1
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/NoOpCommand.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.NextCommand;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.util.Collections;
+import java.util.Map;
+
+@Component
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class NoOpCommand implements IJobCommand {
+
+    @Override
+    public NextCommand call() {
+        return null;
+    }
+
+    @Override
+    public Map<String, Object> getData() {
+        return Collections.emptyMap();
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/WatchingCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/WatchingCommand.java
new file mode 100644
index 0000000..70b9f00
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/WatchingCommand.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.impl.JobSharedData;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.UUID;
+
+@Component
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class WatchingCommand extends BaseWatchingCommand {
+
+    public WatchingCommand() {}
+
+    public WatchingCommand(JobSharedData sharedData, List<UUID> childrenJobsIds, boolean isRoot) {
+        super(sharedData, childrenJobsIds, isRoot);
+    }
+
+    protected NextCommand getNextCommand(boolean isAllChildrenFinal, boolean hasFailedChild) {
+        if (isAllChildrenFinal) {
+            JobStatus jobStatus = hasFailedChild ?  JobStatus.COMPLETED_WITH_ERRORS : JobStatus.COMPLETED;
+            return new NextCommand(jobStatus);
+        } else {
+            if (isRoot) {
+                return new NextCommand(JobStatus.IN_PROGRESS, this);
+            }
+            return new NextCommand(JobStatus.RESOURCE_IN_PROGRESS, this);
+        }
+    }
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/demo/ChassisCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/demo/ChassisCommand.java
new file mode 100644
index 0000000..98de930
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/demo/ChassisCommand.java
@@ -0,0 +1,108 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command.demo;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import lombok.extern.slf4j.Slf4j;
+import org.onap.osam.job.command.WatchingCommand;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.JobType;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.command.CommandBase;
+import org.onap.osam.job.impl.DummyAsyncRequest;
+import org.onap.osam.job.impl.JobFactory;
+import org.onap.osam.job.impl.JobSharedData;
+import org.onap.osam.job.impl.JobsDataAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+@Slf4j
+@Component
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+
+/**
+ * In this example, Chassis job is successful and spawns off OLT job - without being dependent on it.
+ */
+
+public class ChassisCommand extends CommandBase implements IJobCommand {
+
+    private Boolean isSuccessful;
+
+    private Boolean isOltDependant;
+
+    @Autowired
+    protected JobsDataAccessService jobsDataAccessService;
+
+    @Autowired
+    protected JobFactory jobFactory;
+
+    public ChassisCommand(){}
+
+    @Override
+    public IJobCommand init(JobSharedData sharedData, Map<String, Object> commandData) {
+        super.init(sharedData);
+        isSuccessful = (Boolean) commandData.get("isSuccessful");
+        isOltDependant = (Boolean) commandData.get("isOltDependant");
+        return this;
+    }
+
+    @Override
+    public Map<String, Object> getData() {
+        return ImmutableMap.of("isSuccessful", isSuccessful,
+                "isOltDependant", isOltDependant);
+    }
+
+    @Override
+    public NextCommand call() {
+        NextCommand nextCommand;
+        if (isSuccessful){
+            log.debug("ChassisCommand - it's your LUCKY day! :) ChassisCreation created, continuing to OLTCreation...");
+
+            //Adding an OLTCreation child job
+            final List<UUID> oltChildJobs = getOltChildJobs();
+
+            if (isOltDependant){
+                log.debug("ChassisCommand - OLT Dependent scenario. Pending to wait if OLT job succeeds before deciding if Chassis job succeeds.");
+                nextCommand = new NextCommand(JobStatus.PENDING, new WatchingCommand(getSharedData(), oltChildJobs, true));
+            } else {
+                log.debug("ChassisCommand - independent scenario. This job is completed, regardless of child OLT job.");
+                nextCommand = new NextCommand(JobStatus.COMPLETED);
+            }
+         } else {
+            log.debug("ChassisCommand - it's your UNLUCKY day! :( ChassisCreation creation failed, your bulk request is finished here.");
+            nextCommand = new NextCommand(JobStatus.FAILED);
+        }
+        return nextCommand;
+    }
+
+    private List<UUID> getOltChildJobs() {
+        log.debug("Spinning off OLT child job....");
+        Map<String, Object> dataForOLTChild = ImmutableMap.of();
+        return Lists.newArrayList(jobsDataAccessService.add(jobFactory.createChildJob(JobType.OLTCreation, JobStatus.CREATING, new DummyAsyncRequest(), getSharedData(), ImmutableMap.of())));
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/demo/OLTCommand.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/demo/OLTCommand.java
new file mode 100644
index 0000000..4de73ad
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/command/demo/OLTCommand.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command.demo;
+
+import com.google.common.collect.ImmutableMap;
+import lombok.extern.slf4j.Slf4j;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.command.CommandBase;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Slf4j
+@Component
+@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+public class OLTCommand extends CommandBase implements IJobCommand {
+    @Override
+    public Map<String, Object> getData() {
+        return ImmutableMap.of();
+    }
+
+    @Override
+    public NextCommand call() {
+        log.debug("OLTCreation Command - for this demo, I'm always successful!!");
+        return new NextCommand(JobStatus.COMPLETED);
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/dao/job/JobStatus.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/dao/job/JobStatus.java
new file mode 100644
index 0000000..c3b031f
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/dao/job/JobStatus.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.dao.job;
+
+public enum JobStatus {
+    COMPLETED(true),
+    FAILED(true),
+    IN_PROGRESS(false),
+    RESOURCE_IN_PROGRESS(false),
+    PAUSE(false),
+    PENDING(false),
+    STOPPED(true),
+    COMPLETED_WITH_ERRORS(true),
+    CREATING(false);
+
+    private final Boolean finalStatus;
+    public Boolean isFinal(){return finalStatus;}
+
+    JobStatus(Boolean finalStatus)
+    {
+        this.finalStatus = finalStatus ;
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/dao/job/OsamJob.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/dao/job/OsamJob.java
new file mode 100644
index 0000000..807221f
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/dao/job/OsamJob.java
@@ -0,0 +1,181 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.dao.job;
+
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.MoreObjects;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+import org.hibernate.annotations.DynamicUpdate;
+import org.hibernate.annotations.SelectBeforeUpdate;
+import org.hibernate.annotations.Type;
+import org.onap.osam.job.JobType;
+import org.onap.osam.job.impl.JobData;
+import org.onap.osam.job.impl.JobSharedData;
+import org.onap.osam.model.dao.BaseEntity;
+import org.springframework.data.annotation.CreatedDate;
+import org.springframework.data.annotation.LastModifiedDate;
+
+import javax.persistence.AttributeConverter;
+import javax.persistence.Column;
+import javax.persistence.Converter;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.Lob;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
+
+/*
+ The following 2 annotations let hibernate to update only fields that actually have been changed.
+ DynamicUpdate tell hibernate to update only dirty fields.
+ SelectBeforeUpdate is needed since during update the entity is detached (get and update are in different sessions)
+*/
+@DynamicUpdate()
+@SelectBeforeUpdate()
+@Entity
+@Getter
+@Setter
+@Slf4j
+public class OsamJob extends BaseEntity {
+
+    @Column(unique = true, nullable = false, columnDefinition = "CHAR(36)")
+    @Type(type="org.hibernate.type.UUIDCharType")
+    private UUID uuid;
+
+    @CreatedDate
+    private Date createdDate;
+
+    @LastModifiedDate
+    private Date modifiedDate;
+
+    @Enumerated(value = EnumType.STRING)
+    private JobStatus status;
+
+    @Enumerated(value = EnumType.STRING)
+    private JobType type;
+
+    @Lob
+    @Column
+    private JobData data = new JobData();
+
+    @Column
+    private String takenBy;
+
+    @Column
+    private String userId;
+
+    @Column(nullable = false)
+    private Integer age = 0;
+
+    @Column(nullable = false)
+    private Integer indexInBulk = 0;
+
+    @Column
+    private Date deletedAt;
+
+    public Map<String, Object> getDataMap() {
+        return data.getCommandData().get(getType());
+    }
+
+    public void setTypeAndData(JobType jobType, Map<String, Object> data) {
+        // *add* the data to map,
+        // then change state to given type
+        this.type = jobType;
+        this.data.getCommandData().put(jobType, data);
+    }
+
+    public void setSharedData(JobSharedData sharedData) {
+        this.data.setSharedData(sharedData);
+    }
+
+    public JobSharedData getSharedData(){
+        return this.data.getSharedData();
+    };
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof OsamJob)) return false;
+        OsamJob daoJob = (OsamJob) o;
+        return Objects.equals(getUuid(), daoJob.getUuid());
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(getUuid());
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("status", status)
+                .add("type", type)
+                .add("uuid", uuid)
+                .add("takenBy", takenBy)
+                .add("userId", userId)
+                .add("age", age)
+                .add("createdDate", createdDate)
+                .add("modifiedDate", modifiedDate)
+                .add("deletedAt", deletedAt)
+                .add("data", data)
+                .toString();
+    }
+
+    @Converter(autoApply = true)
+    public static class JobDataConverter implements AttributeConverter<JobData, String> {
+
+        @Override
+        public String convertToDatabaseColumn(JobData jobData) {
+            if( jobData == null )
+                return null;
+
+            ObjectMapper mapper = new ObjectMapper();
+
+            try {
+                return mapper.writeValueAsString(jobData);
+            } catch (JsonProcessingException e) {
+                log.error("Couldn't persist JobData object {}, error: {}. Persisting null", jobData, e);
+                return null;
+            }
+        }
+
+        @Override
+        public JobData convertToEntityAttribute(String s) {
+            if( s == null )
+                return null;
+
+            ObjectMapper mapper = new ObjectMapper();
+
+            try {
+                return mapper.readValue(s, JobData.class);
+            } catch (IOException e) {
+                log.error("Couldn't deserialize {} to JobData object, error: {}. Returning null", s, e);
+                return null;
+            }
+        }
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/exceptions/JobException.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/exceptions/JobException.java
new file mode 100644
index 0000000..46ba80e
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/exceptions/JobException.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.exceptions;
+
+import java.util.UUID;
+
+public class JobException extends RuntimeException {
+    private final UUID jobUuid;
+
+    public JobException(String message, UUID jobUuid, Throwable cause) {
+        super(message, cause);
+        this.jobUuid = jobUuid;
+    }
+
+    public UUID getJobUuid() {
+        return jobUuid;
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/AsyncJobServiceImpl.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/AsyncJobServiceImpl.java
new file mode 100644
index 0000000..c964f01
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/AsyncJobServiceImpl.java
@@ -0,0 +1,506 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+package org.onap.osam.job.impl;
+
+import com.google.common.collect.ImmutableMap;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.AsyncJobService;
+import org.onap.osam.job.JobType;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+@Service
+public class AsyncJobServiceImpl implements AsyncJobService {
+
+    private final JobFactory jobFactory;
+
+    private final JobsDataAccessService jobsDataAccessService;
+
+    private Map<String, JobStatus> msoStateToJobStatusMap = ImmutableMap.<String, JobStatus>builder()
+            .put("inprogress", JobStatus.IN_PROGRESS)
+            .put("failed", JobStatus.FAILED)
+            .put("pause", JobStatus.PAUSE)
+            .put("paused", JobStatus.PAUSE)
+            .put("complete", JobStatus.COMPLETED)
+            .put("pending", JobStatus.IN_PROGRESS)
+            .put("pendingmanualtask", JobStatus.PAUSE)
+            .put("unlocked", JobStatus.IN_PROGRESS)
+            .build();
+
+
+    public AsyncJobServiceImpl(JobFactory jobFactory, JobsDataAccessService jobsDataAccessService) {
+        this.jobFactory = jobFactory;
+        this.jobsDataAccessService = jobsDataAccessService;
+    }
+
+    @Override
+    public JobStatus calcStatus(String asyncRequestStatus) {
+        JobStatus jobStatus = msoStateToJobStatusMap.get(asyncRequestStatus);
+        return (jobStatus != null ? jobStatus : JobStatus.IN_PROGRESS);
+    }
+
+    @Override
+    public List<UUID> pushBulkJob(String userId, boolean isSuccessful, boolean isOltDependant) {
+        List<UUID> uuids = new ArrayList<>();
+        Date createdBulkDate = Calendar.getInstance().getTime();
+        int bulkSize = 1;
+        for (int i = 0; i < bulkSize; i++) {
+            OsamJob job = jobFactory.createRootJob(JobType.ChassisCreation, new DummyAsyncRequest(), userId, i,
+                    ImmutableMap.of("isSuccessful", isSuccessful, "isOltDependant", isOltDependant));
+            UUID jobId = jobsDataAccessService.add(job);
+            uuids.add(jobId);
+        }
+        return uuids;
+    }
+
+
+
+/*
+    private final DataAccessService dataAccessService;
+
+    private final IJobFactory jobAdapter;
+
+    private final IJobsDataAccessService jobService;
+
+    private SessionFactory sessionFactory;
+
+    private AaiClientInterface aaiClient;
+
+    private int maxRetriesGettingFreeNameFromAai = MAX_RETRIES_GETTING_FREE_NAME_FROM_AAI;
+
+    private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AsyncInstantiationBusinessLogicImpl.class);
+
+
+
+    @Autowired
+    public AsyncInstantiationBusinessLogicImpl(DataAccessService dataAccessService,
+                                               IJobFactory jobAdapter,
+                                               IJobsDataAccessService jobService,
+                                               SessionFactory sessionFactory,
+                                               AaiClientInterface aaiClient) {
+        this.dataAccessService = dataAccessService;
+        this.jobAdapter = jobAdapter;
+        this.jobService = jobService;
+        this.sessionFactory = sessionFactory;
+        this.aaiClient = aaiClient;
+    }
+
+    @Override
+    public List<ServiceInfo> getAllServicesInfo() {
+        return dataAccessService.getList(ServiceInfo.class, filterByCreationDateAndNotDeleted(), orderByCreatedDateAndStatus(), null);
+    }
+
+    private String filterByCreationDateAndNotDeleted() {
+        LocalDateTime minus3Months = LocalDateTime.now().minusMonths(3);
+        Timestamp filterDate = Timestamp.valueOf(minus3Months);
+        return " where" +
+                "   hidden = false" +
+                "   and deleted_at is null" +  // don't fetch deleted
+                "   and created >= '" + filterDate + "' ";
+    }
+
+    private String orderByCreatedDateAndStatus() {
+        return " createdBulkDate DESC ,\n" +
+                "  (CASE jobStatus\n" +
+                "   WHEN 'COMPLETED' THEN 0\n" +
+                "   WHEN 'FAILED' THEN 0\n" +
+                "   WHEN 'IN_PROGRESS' THEN 1\n" +
+                "   WHEN 'PAUSE' THEN 2\n" +
+                "   WHEN 'PENDING' THEN 3\n" +
+                "   WHEN 'STOPPED' THEN 3 END),\n" +
+                "  statusModifiedDate ";
+    }
+
+    @Override
+    public List<UUID> pushBulkJob(ServiceInstantiation request, String userId) {
+        List<UUID> uuids = new ArrayList<>();
+        Date createdBulkDate = Calendar.getInstance().getTime();
+        int bulkSize = request.getBulkSize();
+        UUID templateId = UUID.randomUUID();
+        for (int i = 0; i < bulkSize; i++) {
+            //Job job = jobAdapter.createJob(JobType.ServiceInstantiation, request, templateId, userId, i);
+            Job job = jobAdapter.createJob(JobType.NoOp, request, templateId, userId, i);//should be some instatiation, this was changed as part of code cleaning
+
+            UUID jobId = jobService.add(job);
+            auditVidStatus(jobId,getStatus());
+            uuids.add(jobId);
+            dataAccessService.saveDomainObject(createServiceInfo(userId, request, jobId, templateId, createdBulkDate), DaoUtils.getPropsMap());
+        }
+        return uuids;
+    }
+
+    private ServiceInfo createServiceInfo(String userId, ServiceInstantiation serviceInstantiation, UUID jobId, UUID templateId, Date createdBulkDate) {
+        return new ServiceInfo(
+                userId, JobStatus.PENDING, serviceInstantiation.isPause(), jobId, templateId,
+                serviceInstantiation.getOwningEntityId(),
+                serviceInstantiation.getOwningEntityName(),
+                serviceInstantiation.getProjectName(),
+                serviceInstantiation.getAicZoneId(),
+                serviceInstantiation.getAicZoneName(),
+                serviceInstantiation.getTenantId(),
+                serviceInstantiation.getTenantName(),
+                serviceInstantiation.getLcpCloudRegionId(),
+                null,
+                serviceInstantiation.getSubscriptionServiceType(),
+                serviceInstantiation.getSubscriberName(),
+                null,
+                serviceInstantiation.getInstanceName(),
+                serviceInstantiation.getModelInfo().getModelInvariantId(),
+                serviceInstantiation.getModelInfo().getModelName(),
+                serviceInstantiation.getModelInfo().getModelVersion(),
+                createdBulkDate
+        );
+    }
+
+
+    */
+/*//*
+/@Override
+    public RequestDetailsWrapper<ServiceInstantiationRequestDetails> generateServiceInstantiationRequest(UUID jobId, ServiceInstantiation payload, String userId) {
+
+           ServiceInstantiationRequestDetails.ServiceInstantiationOwningEntity owningEntity = new ServiceInstantiationRequestDetails.ServiceInstantiationOwningEntity(payload.getOwningEntityId(), payload.getOwningEntityName());
+
+        SubscriberInfo subscriberInfo = new SubscriberInfo();
+        subscriberInfo.setGlobalSubscriberId(payload.getGlobalSubscriberId());
+
+        String serviceInstanceName = null;
+        if(payload.isUserProvidedNaming()) {
+            serviceInstanceName = getUniqueName(payload.getInstanceName(), ResourceType.SERVICE_INSTANCE);
+            String finalServiceInstanceName = serviceInstanceName;
+            updateServiceInfo(jobId, x -> x.setServiceInstanceName(finalServiceInstanceName));
+        }
+        ServiceInstantiationRequestDetails.RequestInfo requestInfo = new ServiceInstantiationRequestDetails.RequestInfo(
+                serviceInstanceName,
+                payload.getProductFamilyId(),
+                "VID",
+                payload.isRollbackOnFailure(),
+                userId);
+
+        List<ServiceInstantiationRequestDetails.ServiceInstantiationService> serviceInstantiationService = new LinkedList<>();
+        List<Map<String, String>> unFilteredInstanceParams = payload.getInstanceParams() != null ? payload.getInstanceParams() : new LinkedList<>();
+        List<Map<String, String>> filteredInstanceParams = removeUnNeededParams(unFilteredInstanceParams);
+        ServiceInstantiationRequestDetails.ServiceInstantiationService serviceInstantiationService1 = new ServiceInstantiationRequestDetails.ServiceInstantiationService(
+                payload.getModelInfo(),
+                serviceInstanceName,
+                filteredInstanceParams,
+                createServiceInstantiationVnfList(payload)
+        );
+        serviceInstantiationService.add(serviceInstantiationService1);
+
+        ServiceInstantiationRequestDetails.RequestParameters requestParameters = new ServiceInstantiationRequestDetails.RequestParameters(payload.getSubscriptionServiceType(), false, serviceInstantiationService);
+
+        ServiceInstantiationRequestDetails.Project project = payload.getProjectName() != null ?  new ServiceInstantiationRequestDetails.Project(payload.getProjectName()) : null;
+
+        ServiceInstantiationRequestDetails requestDetails = new ServiceInstantiationRequestDetails(payload.getModelInfo(), owningEntity, subscriberInfo,
+                project, requestInfo, requestParameters);
+
+        RequestDetailsWrapper<ServiceInstantiationRequestDetails> requestDetailsWrapper = new RequestDetailsWrapper(requestDetails);
+        debugRequestDetails(requestDetailsWrapper, logger);
+        return requestDetailsWrapper;
+    }*//*
+
+
+    private List<Map<String, String>> removeUnNeededParams(List<Map<String, String>> instanceParams) {
+        List<String> keysToRemove = new ArrayList<>();
+        if (instanceParams != null && !instanceParams.isEmpty()) {
+            for (String key : instanceParams.get(0).keySet()) {
+                for (String paramToIgnore : PARAMS_TO_IGNORE)
+                    if ((key.equalsIgnoreCase(paramToIgnore))) {
+                        keysToRemove.add(key);
+                    }
+            }
+            for (String key : keysToRemove) {
+                instanceParams.get(0).remove(key);
+            }
+            //TODO will be removed on once we stop using List<Map<String, String>>
+            if (instanceParams.get(0).isEmpty()) {
+                return Collections.emptyList();
+            }
+        }
+        return instanceParams;
+    }
+
+    private ServiceInstantiationRequestDetails.ServiceInstantiationVnfList createServiceInstantiationVnfList(ServiceInstantiation payload) {
+        CloudConfiguration cloudConfiguration = new CloudConfiguration();
+        cloudConfiguration.setTenantId(payload.getTenantId());
+        cloudConfiguration.setLcpCloudRegionId(payload.getLcpCloudRegionId());
+
+        Map<String, Vnf> vnfs = payload.getVnfs();
+        List<ServiceInstantiationRequestDetails.ServiceInstantiationVnf> vnfList = new ArrayList<>();
+        for (Vnf vnf : vnfs.values()) {
+            Map<String, Map<String, VfModule>> vfModules = vnf.getVfModules();
+            List<VfModule> convertedUnFilteredVfModules = convertVfModuleMapToList(vfModules);
+            List<VfModule> filteredVfModules = filterInstanceParamsFromVfModuleAndUniqueNames(convertedUnFilteredVfModules, vnf.isUserProvidedNaming());
+            ServiceInstantiationRequestDetails.ServiceInstantiationVnf serviceInstantiationVnf = new ServiceInstantiationRequestDetails.ServiceInstantiationVnf(
+                    vnf.getModelInfo(),
+                    cloudConfiguration,
+                    vnf.getPlatformName(),
+                    vnf.getLineOfBusiness(),
+                    payload.getProductFamilyId(),
+                    removeUnNeededParams(vnf.getInstanceParams()),
+                    filteredVfModules,
+                    vnf.isUserProvidedNaming() ? getUniqueName(vnf.getInstanceName(), ResourceType.GENERIC_VNF) : null
+            );
+            vnfList.add(serviceInstantiationVnf);
+        }
+
+        return new ServiceInstantiationRequestDetails.ServiceInstantiationVnfList(vnfList);
+    }
+
+    private List<VfModule> convertVfModuleMapToList(Map<String, Map<String, VfModule>> vfModules) {
+        return vfModules.values().stream().flatMap(vfModule -> vfModule.values().stream()).collect(Collectors.toList());
+    }
+
+    private List<VfModule> filterInstanceParamsFromVfModuleAndUniqueNames(List<VfModule> unFilteredVfModules, boolean isUserProvidedNaming) {
+        return unFilteredVfModules.stream().map(vfModule ->
+                new VfModule(
+                        vfModule.getModelInfo(),
+                        getUniqueNameIfNeeded(isUserProvidedNaming, vfModule.getInstanceName(), ResourceType.VF_MODULE),
+                        getUniqueNameIfNeeded(isUserProvidedNaming, vfModule.getVolumeGroupInstanceName(), ResourceType.VOLUME_GROUP),
+                        removeUnNeededParams(vfModule.getInstanceParams())))
+                .collect(Collectors.toList());
+    }
+
+    private String getUniqueNameIfNeeded(boolean isUserProvidedNaming, String name, ResourceType resourceType) {
+        return isUserProvidedNaming && !StringUtils.isEmpty(name) ?
+                getUniqueName(name, resourceType) : null;
+    }
+
+    @Override
+    public String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest) {
+        //in case pause flag is true - use assign , else - use create.
+        return MsoBusinessLogicImpl.validateEndpointPath(
+                serviceInstantiationRequest.isPause() ?
+                        "mso.restapi.serviceInstanceAssign" : "mso.restapi.serviceInstanceCreate"
+        );
+    }
+
+    @Override
+    public String getOrchestrationRequestsPath() {
+        return MsoBusinessLogicImpl.validateEndpointPath(MsoProperties.MSO_REST_API_GET_ORC_REQ);
+    }
+
+    @Override
+    public ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater) {
+        ServiceInfo serviceInfo = getServiceInfoByJobId(jobUUID);
+        serviceUpdater.accept(serviceInfo);
+        dataAccessService.saveDomainObject(serviceInfo, DaoUtils.getPropsMap());
+        return serviceInfo;
+    }
+
+
+
+    private void setServiceInfoStatus(ServiceInfo serviceInfo, JobStatus jobStatus) {
+        serviceInfo.setJobStatus(jobStatus);
+        serviceInfo.setStatusModifiedDate(new Date());
+    }
+
+    public ServiceInfo getServiceInfoByJobId(UUID jobUUID) {
+        List<ServiceInfo> serviceInfoList = dataAccessService.getList(ServiceInfo.class, String.format(" where jobId = '%s' ", jobUUID), null, null);
+        if (serviceInfoList.size() != 1) {
+            throw new GenericUncheckedException("Failed to retrieve job with uuid " + jobUUID + " from ServiceInfo table. Instances found: " + serviceInfoList.size());
+        }
+        return serviceInfoList.get(0);
+    }
+
+    public List<JobAuditStatus> getAuditStatuses(UUID jobUUID, JobAuditStatus.SourceStatus source) {
+        return dataAccessService.getList(
+            JobAuditStatus.class,
+            String.format(" where SOURCE = '%s' and JOB_ID = '%s'",source, jobUUID),
+            " CREATED_DATE ", null);
+    }
+
+    private JobAuditStatus getLatestAuditStatus(UUID jobUUID, JobAuditStatus.SourceStatus source){
+        List<JobAuditStatus> list = getAuditStatuses(jobUUID,source);
+        return !list.isEmpty() ? list.get(list.size()-1) : null;
+    }
+
+    @Override
+    public void auditVidStatus(UUID jobUUID, JobStatus jobStatus){
+        JobAuditStatus vidStatus = new JobAuditStatus(jobUUID, jobStatus.toString(), JobAuditStatus.SourceStatus.VID);
+        auditStatus(vidStatus);
+    }
+
+    @Override
+    public void auditMsoStatus(UUID jobUUID, AsyncRequestStatus.Request msoRequestStatus){
+        auditMsoStatus(jobUUID, msoRequestStatus.requestStatus.getRequestState(), msoRequestStatus.requestId, msoRequestStatus.requestStatus.getStatusMessage());
+    }
+
+    @Override
+    public void auditMsoStatus(UUID jobUUID, String jobStatus, String requestId, String additionalInfo){
+        JobAuditStatus msoStatus = new JobAuditStatus(jobUUID, jobStatus, JobAuditStatus.SourceStatus.MSO,
+                requestId != null ? UUID.fromString(requestId) : null,
+                additionalInfo);
+        auditStatus(msoStatus);
+    }
+
+    private void auditStatus(JobAuditStatus jobAuditStatus){
+        JobAuditStatus latestStatus = getLatestAuditStatus(jobAuditStatus.getJobId(),jobAuditStatus.getSource());
+        if (latestStatus == null || !latestStatus.equals(jobAuditStatus))
+            dataAccessService.saveDomainObject(jobAuditStatus, DaoUtils.getPropsMap());
+
+    }
+
+
+
+    @Override
+    public void handleFailedInstantiation(UUID jobUUID) {
+        ServiceInfo serviceInfo = updateServiceInfoAndAuditStatus(jobUUID, JobStatus.FAILED);
+        List<ServiceInfo> serviceInfoList = dataAccessService.getList(
+                ServiceInfo.class,
+                String.format(" where templateId = '%s' and jobStatus = '%s'",
+                        serviceInfo.getTemplateId(),
+                        JobStatus.PENDING),
+                null, null);
+        serviceInfoList.forEach(si -> updateServiceInfoAndAuditStatus(si.getJobId(), JobStatus.STOPPED));
+    }
+
+    @Override
+    public void deleteJob(UUID jobId) {
+        jobService.delete(jobId);
+        Date now = new Date();
+        updateServiceInfo(jobId, x -> x.setDeletedAt(now));
+    }
+
+    @Override
+    public void hideServiceInfo(UUID jobUUID) {
+        ServiceInfo serviceInfo = getServiceInfoByJobId(jobUUID);
+        if (!serviceInfo.getJobStatus().isFinal()) {
+            String message = String.format( "jobId %s: Service status does not allow hide service, status = %s",
+                    serviceInfo.getJobId(),
+                    serviceInfo.getJobStatus());
+            logger.error(EELFLoggerDelegate.errorLogger, message);
+            throw new OperationNotAllowedException(message);
+        }
+        serviceInfo.setHidden(true);
+        dataAccessService.saveDomainObject(serviceInfo, DaoUtils.getPropsMap());
+    }
+
+    @Override
+    public int
+
+
+    getCounterForName(String name) {
+
+        String hqlSelectNC = "from NameCounter where name = :name";
+        String hqlUpdateCounter = "update NameCounter set counter = :newCounter " +
+                "where name= :name " +
+                "and counter= :prevCounter";
+
+        Integer counter = null;
+        GenericUncheckedException lastException = null;
+        for (int i = 0; i< MAX_RETRIES_GETTING_COUNTER && counter==null; i++) {
+            try {
+                counter = calcCounter(name, hqlSelectNC, hqlUpdateCounter);
+            }
+            catch (GenericUncheckedException exception) {
+                lastException = exception; //do nothing, we will try again in the loop
+            }
+        }
+
+        if (counter!=null) {
+            return counter;
+        }
+
+        throw lastException!=null ? new DbFailureUncheckedException(lastException) :
+                new DbFailureUncheckedException("Failed to get counter for "+name+" due to unknown error");
+
+    }
+
+    private Integer calcCounter(String name, String hqlSelectNC, String hqlUpdateCounter) {
+        Integer counter;
+        counter = DaoUtils.tryWithSessionAndTransaction(sessionFactory, session -> {
+            NameCounter nameCounter = (NameCounter) session.createQuery(hqlSelectNC)
+                    .setText("name", name)
+                    .uniqueResult();
+            if (nameCounter != null) {
+                int updatedRows = session.createQuery(hqlUpdateCounter)
+                        .setText("name", nameCounter.getName())
+                        .setInteger("prevCounter", nameCounter.getCounter())
+                        .setInteger("newCounter", nameCounter.getCounter() + 1)
+                        .executeUpdate();
+                if (updatedRows == 1) {
+                    return nameCounter.getCounter() + 1;
+                }
+            } else {
+                Object nameAsId = session.save(new NameCounter(name));
+                //if save success
+                if (nameAsId != null) {
+                    return 1;
+                }
+            }
+            //in case of failure return null, in order to continue the loop
+            return null;
+        });
+        return counter;
+    }
+
+    @Override
+    public int getMaxRetriesGettingFreeNameFromAai() {
+        return maxRetriesGettingFreeNameFromAai;
+    }
+
+    @Override
+    public void setMaxRetriesGettingFreeNameFromAai(int maxRetriesGettingFreeNameFromAai) {
+        this.maxRetriesGettingFreeNameFromAai = maxRetriesGettingFreeNameFromAai;
+    }
+
+    @Override
+    public String getUniqueName(String name, ResourceType resourceType) {
+        //check that name aai response well before increasing counter from DB
+        //Prevents unnecessary increasing of the counter while AAI doesn't response
+        isNameFreeInAai(NAME_FOR_CHECK_AAI_STATUS, resourceType);
+
+        for (int i=0; i<getMaxRetriesGettingFreeNameFromAai(); i++) {
+            int counter = getCounterForName(name);
+            String newName = formatNameAndCounter(name, counter);
+            if (isNameFreeInAai(newName, resourceType)) {
+                return newName;
+            }
+        }
+
+        throw new MaxRetriesException("find unused name for "+name, getMaxRetriesGettingFreeNameFromAai());
+    }
+
+    //the method is protected so we can call it in the UT
+    protected String formatNameAndCounter(String name, int counter) {
+        return name + "_" + String.format("%03d", counter);
+    }
+
+    private boolean isNameFreeInAai(String name, ResourceType resourceType) throws InvalidAAIResponseException {
+        AaiResponse<AaiNodeQueryResponse> aaiResponse = aaiClient.searchNodeTypeByName(name, resourceType);
+        if (aaiResponse.getHttpCode() > 399 || aaiResponse.getT() == null) {
+            throw new InvalidAAIResponseException(aaiResponse);
+        }
+        return CollectionUtils.isEmpty(aaiResponse.getT().resultData);
+    }
+*/
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/DummyAsyncRequest.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/DummyAsyncRequest.java
new file mode 100644
index 0000000..22ce508
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/DummyAsyncRequest.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.osam.job.IJobFactory;
+
+/**
+ * Currently - dummy class for demo purposes
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class DummyAsyncRequest implements IJobFactory.AsyncJobRequest {
+
+    @JsonProperty("dummyString")
+    private String dummyString;
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobData.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobData.java
new file mode 100644
index 0000000..4e9ceff
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobData.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import org.onap.osam.job.JobType;
+
+import java.util.Map;
+import java.util.Objects;
+import java.util.TreeMap;
+
+public class JobData {
+
+    private TreeMap<JobType, Map<String, Object>> commandData;
+    private JobSharedData sharedData;
+
+    public JobData() {
+        commandData = new TreeMap<>();
+        sharedData = new JobSharedData();
+    }
+
+    public JobData(TreeMap<JobType, Map<String, Object>> commandData, JobSharedData sharedData) {
+        this.commandData = commandData;
+        this.sharedData = sharedData;
+    }
+
+    public TreeMap<JobType, Map<String, Object>> getCommandData() {
+        return commandData;
+    }
+
+    public void setCommandData(TreeMap<JobType, Map<String, Object>> commandData) {
+        this.commandData = commandData;
+    }
+
+    public JobSharedData getSharedData() {
+        return sharedData;
+    }
+
+    public void setSharedData(JobSharedData sharedData) {
+        this.sharedData = sharedData;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof JobData)) return false;
+        JobData jobData = (JobData) o;
+        return Objects.equals(getCommandData(), jobData.getCommandData()) &&
+                Objects.equals(getSharedData(), jobData.getSharedData());
+    }
+
+    @Override
+    public int hashCode() {
+
+        return Objects.hash(getCommandData(), getSharedData());
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobFactory.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobFactory.java
new file mode 100644
index 0000000..a8ab0ce
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobFactory.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobFactory;
+import org.onap.osam.job.JobType;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.UUID;
+
+@Component
+public class JobFactory implements IJobFactory {
+
+    @Override
+    public OsamJob createRootJob(JobType jobType, AsyncJobRequest request, String userId, Integer indexInBulk, Map<String, Object> jobData){
+        OsamJob job = new OsamJob();
+        job.setStatus(JobStatus.PENDING);
+        job.setUuid(UUID.randomUUID());
+        job.setUserId(userId);
+        job.setTypeAndData(jobType, jobData);
+        job.setSharedData(new JobSharedData(job.getUuid(), userId, request));
+        job.setIndexInBulk(indexInBulk);
+        return job;
+    }
+
+    @Override
+    public OsamJob createChildJob(JobType jobType, JobStatus jobStatus, AsyncJobRequest request, JobSharedData parentSharedData, Map<String, Object> jobData) {
+        OsamJob job = new OsamJob();
+        job.setStatus(jobStatus);
+        job.setUuid(UUID.randomUUID());
+        job.setUserId(parentSharedData.getUserId());
+        job.setTypeAndData(jobType, jobData);
+        job.setSharedData(new JobSharedData(job.getUuid(), request, parentSharedData));
+        return job;
+    }
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobSchedulerInitializer.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobSchedulerInitializer.java
new file mode 100644
index 0000000..526b823
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobSchedulerInitializer.java
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import com.google.common.collect.ImmutableMap;
+import lombok.extern.slf4j.Slf4j;
+import org.onap.osam.common.exception.GenericUncheckedException;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.IJobsDataAccessService;
+import org.onap.osam.job.command.JobCommandFactory;
+import org.quartz.JobBuilder;
+import org.quartz.JobDataMap;
+import org.quartz.JobDetail;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.SimpleTrigger;
+import org.quartz.TriggerBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+
+import static org.quartz.SimpleScheduleBuilder.simpleSchedule;
+
+@Slf4j
+@Component
+public class JobSchedulerInitializer {
+
+    private IJobsDataAccessService jobsDataAccessService;
+    private SchedulerFactoryBean schedulerFactoryBean;
+    private JobCommandFactory jobCommandFactory;
+
+    @Autowired
+    public JobSchedulerInitializer(
+            IJobsDataAccessService jobsDataAccessService,
+            SchedulerFactoryBean schedulerFactoryBean,
+            JobCommandFactory JobCommandFactory
+    ) {
+        this.jobsDataAccessService = jobsDataAccessService;
+        this.schedulerFactoryBean = schedulerFactoryBean;
+        this.jobCommandFactory = JobCommandFactory;
+
+    }
+
+    @PostConstruct
+    public void init() {
+        scheduleJobWorker(JobStatus.PENDING, 1);
+        scheduleJobWorker(JobStatus.CREATING, 1);
+        scheduleJobWorker(JobStatus.IN_PROGRESS, 1);
+        scheduleJobWorker(JobStatus.RESOURCE_IN_PROGRESS, 1);
+    }
+
+    private void scheduleJobWorker(JobStatus topic, int intervalInSeconds) {
+        final Scheduler scheduler = schedulerFactoryBean.getScheduler();
+        JobDetail jobDetail = JobBuilder.newJob().ofType(JobWorker.class)
+                .withIdentity("AsyncWorkersJob" + topic)
+                .withDescription("Job that run async worker for " + topic)
+                .setJobData(new JobDataMap(ImmutableMap.of(
+                        "jobsDataAccessService", jobsDataAccessService,
+                        "jobCommandFactory", jobCommandFactory,
+                        "topic", topic
+                )))
+                .build();
+        SimpleTrigger asyncWorkerTrigger = TriggerBuilder.newTrigger().forJob(jobDetail)
+                .withIdentity("AsyncWorkersTrigger" + topic)
+                .withDescription("Trigger to run async worker for " + topic)
+                .withSchedule(simpleSchedule().repeatForever().withIntervalInSeconds(intervalInSeconds))
+                .build();
+        try {
+            scheduler.scheduleJob(jobDetail, asyncWorkerTrigger);
+        } catch (SchedulerException e) {
+            log.error("Failed to schedule trigger for async worker jobs: {}", e.getMessage());
+            throw new GenericUncheckedException(e);
+        }
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobSharedData.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobSharedData.java
new file mode 100644
index 0000000..2c16c95
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobSharedData.java
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import org.onap.osam.job.IJobFactory;
+
+import java.util.Objects;
+import java.util.UUID;
+
+public class JobSharedData {
+
+    protected UUID jobUuid;
+    protected String userId;
+    protected Class requestType;
+    protected UUID rootJobId;
+
+    @JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, property="class")
+    protected IJobFactory.AsyncJobRequest request;
+
+    public JobSharedData() {
+    }
+
+    public JobSharedData(UUID jobUuid, String userId, IJobFactory.AsyncJobRequest request) {
+        this.jobUuid = jobUuid;
+        this.userId = userId;
+        this.requestType = request.getClass();
+        this.request = request;
+        this.rootJobId = jobUuid;
+    }
+
+    public JobSharedData(UUID jobUuid, IJobFactory.AsyncJobRequest request, JobSharedData parentData) {
+        this(jobUuid, parentData.getUserId(), request);
+        rootJobId = parentData.getRootJobId() != null ? parentData.getRootJobId() : parentData.getJobUuid();
+    }
+
+
+    public UUID getJobUuid() {
+        return jobUuid;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public Class getRequestType() {
+        return requestType;
+    }
+
+    public void setRequestType(Class requestType) {
+        this.requestType = requestType;
+    }
+
+    public IJobFactory.AsyncJobRequest getRequest() {
+        return request;
+    }
+
+    public void setRequest(IJobFactory.AsyncJobRequest request) {
+        this.request = request;
+    }
+
+    public UUID getRootJobId() {
+        return rootJobId;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof JobSharedData)) return false;
+        JobSharedData that = (JobSharedData) o;
+        return Objects.equals(getJobUuid(), that.getJobUuid()) &&
+                Objects.equals(getUserId(), that.getUserId()) &&
+                Objects.equals(getRequestType(), that.getRequestType()) &&
+                Objects.equals(getRootJobId(), that.getRootJobId()) &&
+                Objects.equals(getRequest(), that.getRequest());
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(getJobUuid(), getUserId(), getRequestType(), getRootJobId(), getRequest());
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobWorker.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobWorker.java
new file mode 100644
index 0000000..97d52a5
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobWorker.java
@@ -0,0 +1,162 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.onap.osam.job.exceptions.JobException;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.IJobsDataAccessService;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.command.JobCommandFactory;
+import org.quartz.JobExecutionContext;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+import org.springframework.stereotype.Component;
+
+import java.util.Optional;
+import java.util.UUID;
+
+
+@Slf4j
+@Component
+public class JobWorker extends QuartzJobBean {
+
+    private IJobsDataAccessService jobsDataAccessService;
+    private JobCommandFactory jobCommandFactory;
+    private JobStatus topic;
+
+    @Override
+    protected void executeInternal(JobExecutionContext context) {
+        Optional<OsamJob> job;
+
+        job = pullJob();
+
+        while (job.isPresent()) {
+            OsamJob nextStateOfJob = executeJobAndGetNext(job.get());
+            pushBack(nextStateOfJob);
+            job = pullJob();
+        }
+    }
+
+    private Optional<OsamJob> pullJob() {
+        try {
+            return jobsDataAccessService.pull(topic, UUID.randomUUID().toString());
+        } catch (Exception e) {
+            log.error("failed to pull job from queue, breaking: {}", e, e);
+            tryMutingJobFromException(e);
+
+            return Optional.empty();
+        }
+    }
+
+    private void pushBack(OsamJob nextJob) {
+        try {
+            jobsDataAccessService.pushBack(nextJob);
+        } catch (Exception e) {
+            log.error("failed pushing back job to queue: {}", e, e);
+        }
+    }
+
+    protected OsamJob executeJobAndGetNext(OsamJob job) {
+        //TODO Pavel find out about teplateId
+        log.debug("going to execute job {}: {}/{}",
+                //log.debug("going to execute job {} of {}: {}/{}",
+                String.valueOf(job.getUuid()).substring(0,8),
+                //String.valueOf(job.getTemplateId()).substring(0, 8),
+                job.getStatus(), job.getType());
+
+        NextCommand nextCommand = executeCommandAndGetNext(job);
+
+        return setNextCommandInJob(nextCommand, job);
+    }
+
+    private NextCommand executeCommandAndGetNext(OsamJob job) {
+        NextCommand nextCommand;
+        try {
+            final IJobCommand jobCommand = jobCommandFactory.toCommand(job);
+            nextCommand = jobCommand.call();
+        } catch (Exception e) {
+            log.error("error while executing job from queue: {}", e);
+            nextCommand = new NextCommand(JobStatus.FAILED);
+        }
+
+        if (nextCommand == null) {
+            nextCommand = new NextCommand(JobStatus.STOPPED);
+        }
+        return nextCommand;
+    }
+
+    private OsamJob setNextCommandInJob(NextCommand nextCommand, OsamJob job) {
+        log.debug("transforming job {}: {}/{} -> {}{}",
+                String.valueOf(job.getUuid()).substring(0, 8),
+                job.getStatus(), job.getType(),
+                nextCommand.getStatus(),
+                nextCommand.getCommand() != null ? ("/" + nextCommand.getCommand().getType()) : "");
+
+        job.setStatus(nextCommand.getStatus());
+
+        if (nextCommand.getCommand() != null) {
+            job.setTypeAndData(nextCommand.getCommand().getType(), nextCommand.getCommand().getData());
+        }
+
+        return job;
+    }
+
+
+    private void tryMutingJobFromException(Exception e) {
+        // If there's JobException in the stack, read job uuid from
+        // the exception, and mute it in DB.
+        final int indexOfJobException =
+                ExceptionUtils.indexOfThrowable(e, JobException.class);
+
+        if (indexOfJobException >= 0) {
+            try {
+                final JobException jobException = (JobException) ExceptionUtils.getThrowableList(e).get(indexOfJobException);
+                log.info("muting job: {} ({})", jobException.getJobUuid(), jobException.toString());
+                final boolean success = jobsDataAccessService.mute(jobException.getJobUuid());
+                if (!success) {
+                    log.error("failed to mute job {}", jobException.getJobUuid());
+                }
+            } catch (Exception e1) {
+                log.error("failed to mute job: {}", e1, e1);
+            }
+        }
+    }
+
+    //used by quartz to inject IJobsDataAccessService into the job
+    //see JobSchedulerInitializer
+    public void setJobsDataAccessService(IJobsDataAccessService jobsDataAccessService) {
+        this.jobsDataAccessService = jobsDataAccessService;
+    }
+
+    /*public void setFeatureManager(FeatureManager featureManager) {
+        this.featureManager = featureManager;
+    }*/
+
+    public void setJobCommandFactory(JobCommandFactory jobCommandFactory) {
+        this.jobCommandFactory = jobCommandFactory;
+    }
+
+    public void setTopic(JobStatus topic) {
+        this.topic = topic;
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobsDataAccessService.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobsDataAccessService.java
new file mode 100644
index 0000000..18ae378
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/impl/JobsDataAccessService.java
@@ -0,0 +1,211 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import com.google.common.collect.Lists;
+import lombok.extern.slf4j.Slf4j;
+import org.onap.osam.common.exception.GenericUncheckedException;
+import org.onap.osam.common.exception.InvalidOperationException;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobsDataAccessService;
+import org.onap.osam.job.repository.job.OsamJobRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import javax.annotation.PostConstruct;
+import java.nio.ByteBuffer;
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Optional;
+import java.util.UUID;
+
+@Slf4j
+@Service
+public class JobsDataAccessService implements IJobsDataAccessService {
+
+    private OsamJobRepository osamJobRepository;
+    private Long maxOpenedRequestsToAbstractOlt;
+    private int pollingIntervalSeconds;
+
+    @Autowired
+    public JobsDataAccessService(OsamJobRepository osamJobRepository,
+                                 @Value("0") Long maxOpenedRequestsToAbstractOlt,
+                                 @Value("10") int pollingIntervalSeconds) {
+        // tha @Value will inject conservative defaults; overridden in @PostConstruct from configuration
+        this.osamJobRepository = osamJobRepository;
+        this.maxOpenedRequestsToAbstractOlt = maxOpenedRequestsToAbstractOlt;
+        this.pollingIntervalSeconds = pollingIntervalSeconds;
+    }
+
+    @PostConstruct
+    public void configure() {
+        //TODO define defaults
+        /*maxOpenedRequestsToAbstractOlt = Integer.parseInt(System.getProperty(VidProperties.MSO_MAX_OPENED_INSTANTIATION_REQUESTS));
+        pollingIntervalSeconds = Integer.parseInt(System.getProperty(VidProperties.MSO_ASYNC_POLLING_INTERVAL_SECONDS));*/
+    }
+
+    public void deleteAll() {
+        osamJobRepository.deleteAll();
+    }
+
+    @Override
+    public UUID add(OsamJob job) {
+        osamJobRepository.save(job);
+        return job.getUuid();
+    }
+
+    @Override
+    public Optional<OsamJob> pull(JobStatus topic, String ownerId) {
+        OsamJob osamJob;
+        int updatedEntities;
+        do {
+
+            Optional<OsamJob> optionalOsamJob = selectQueryByJobStatus(topic);
+            if (!optionalOsamJob.isPresent()) {
+                return optionalOsamJob;
+            }
+
+            osamJob = optionalOsamJob.get();
+            final UUID uuid = osamJob.getUuid();
+            final Integer age = osamJob.getAge();
+
+            osamJob.setTakenBy(ownerId);
+
+            // It might become that a job was taken and pushed-back already, before we
+            // arrived here, so we're verifying the age was not pushed forward.
+            // Age is actually forwarded upon pushBack().
+            updatedEntities = osamJobRepository.updateOsamCoreJobsAge(ownerId, uuid, age);
+
+        } while (updatedEntities == 0);
+
+        return Optional.ofNullable(osamJob);
+    }
+
+    private java.sql.Timestamp nowMinusInterval() {
+        return Timestamp.valueOf(LocalDateTime.now().minusSeconds(pollingIntervalSeconds));
+    }
+
+    private Optional<OsamJob> selectQueryByJobStatus(JobStatus topic){
+        //TODO Pavel understand this interval
+        //String intervalCondition = (topic==JobStatus.CREATING) ? "" : (" and MODIFIED_DATE <= '" + nowMinusInterval()+"'");
+        return osamJobRepository.queryFirst1ByStatusAndTakenByIsNullAndDeletedAtIsNullOrderByModifiedDateAsc(topic).stream().findFirst();
+
+    }
+
+    private Optional<OsamJob> sqlQueryForTopic(JobStatus topic) {
+        switch (topic) {
+            case IN_PROGRESS:
+            case RESOURCE_IN_PROGRESS:
+            case CREATING:
+            case PENDING:
+                return selectQueryByJobStatus(topic);
+            //TODO Pavel - at first stage, using the naive query for pending topic
+            /*case PENDING:
+                return osamJobRepository.findOsamJobsPending(maxOpenedRequestsToAbstractOlt);*/
+            default:
+                throw new GenericUncheckedException("Unsupported topic to pull from: " + topic);
+        }
+    }
+
+
+    private byte[] getUuidAsByteArray(UUID owner) {
+        ByteBuffer bb = ByteBuffer.wrap(new byte[16]);
+        bb.putLong(owner.getMostSignificantBits());
+        bb.putLong(owner.getLeastSignificantBits());
+        return bb.array();
+    }
+
+    @Override
+    public void pushBack(OsamJob job) {
+        final Optional<OsamJob> remoteDaoJob = osamJobRepository.findByUuid(job.getUuid());
+
+        if (!remoteDaoJob.isPresent()) {
+            throw new IllegalStateException("Can push back only pulled jobs. Add new jobs using add()");
+        }
+
+        if (remoteDaoJob.get().getTakenBy() == null) {
+            throw new IllegalStateException("Can push back only pulled jobs. This one already pushed back.");
+        }
+
+        job.setTakenBy(null);
+
+        Integer age = job.getAge();
+        job.setAge(age + 1);
+
+        log.debug("{}/{}", job.getStatus(), job.getType());
+
+        osamJobRepository.save(job);
+    }
+
+    /*private OsamJob castToOsamJob(OsamJob job) {
+        if (!(job instanceof OsamJob)) {
+            throw new UnsupportedOperationException("Can't add " + job.getClass() + " to " + this.getClass());
+        }
+        return (OsamJob) job;
+    }*/
+
+    @Override
+    public Collection<OsamJob> peek() {
+        return Lists.newArrayList(osamJobRepository.findAll());
+    }
+
+    @Override
+    public OsamJob peek(UUID jobId) {
+        return osamJobRepository.findByUuid(jobId).orElse(null);
+    }
+
+    @Override
+    public void delete(UUID jobId) {
+        Date now = new Date();
+        Integer updatedEntities = osamJobRepository.updateOsamCoreJobToBeDeleted(now, jobId, JobStatus.PENDING.toString(), JobStatus.STOPPED.toString());
+
+        if (updatedEntities == 0) {
+            final Optional<OsamJob> remoteDaoJob = osamJobRepository.findByUuid(jobId);
+
+            if (!remoteDaoJob.isPresent() || remoteDaoJob.get().getUuid() == null) {
+                log.debug("jobId {}: Service does not exist", jobId);
+                throw new InvalidOperationException("Service does not exist");
+            }
+
+            if (!remoteDaoJob.get().equals(JobStatus.PENDING) && !remoteDaoJob.get().getStatus().equals(JobStatus.STOPPED) || !StringUtils.isEmpty(remoteDaoJob.get().getTakenBy())) {
+                log.debug("jobId {}: Service status does not allow deletion from the queue, status = {}", jobId, remoteDaoJob.get().getStatus() +
+                ", takenBy " + remoteDaoJob.get().getTakenBy());
+                throw new InvalidOperationException("Service status does not allow deletion from the queue");
+            }
+
+            throw new InvalidOperationException("Service deletion failed");
+        }
+    }
+
+    @Override
+    public boolean mute(UUID jobId) {
+        if (jobId == null) {
+            return false;
+        }
+        final String prefix = "DUMP";
+        Integer updatedEntities = osamJobRepository.muteOsamCoreJob(jobId, prefix);
+        return updatedEntities != 0;
+    }
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/repository/job/OsamJobRepository.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/repository/job/OsamJobRepository.java
new file mode 100644
index 0000000..f473c5d
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/repository/job/OsamJobRepository.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.repository.job;
+
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.data.repository.query.Param;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.UUID;
+
+public interface OsamJobRepository extends CrudRepository<OsamJob, Long> {
+
+
+
+    Optional<OsamJob> findByUuid(UUID uuid);
+
+    List<OsamJob> findAllByUuid(Iterable<UUID> uuids);
+
+    //TODO Pavel add intervalCondition to the query
+    //String intervalCondition = (topic==JobStatus.CREATING) ? "" : (" and MODIFIED_DATE <= '" + nowMinusInterval()+"'");
+    //@Query("select o from OsamJob o where o.status = :status and o.takenBy is null and o.deletedAt is null order by o.modifiedDate asc")
+    //List<OsamJob> queryFirst1ByStatusAndTakenByIsNullAndDeleteAtIsNullOrderByModifiedDateAsc(@Param("status") JobStatus status);
+    List<OsamJob> queryFirst1ByStatusAndTakenByIsNullAndDeletedAtIsNullOrderByModifiedDateAsc(@Param("status") JobStatus status);
+
+    //Updates
+
+    @Transactional
+    @Modifying
+    @Query("update OsamJob job set job.takenBy = :takenBy where job.uuid = :uuid and job.age = :age and job.takenBy is null")
+    Integer updateOsamCoreJobsAge(@Param("takenBy") String takenBy, @Param("uuid") UUID uuid, @Param("age") Integer age);
+
+    @Transactional
+    @Modifying
+    @Query("update OsamJob job set job.deletedAt = :now where job.uuid = :uuid and job.status in(:pending, :stopped) and job.takenBy is null")
+    Integer updateOsamCoreJobToBeDeleted(@Param("now") Date date, @Param("uuid") UUID uuid, @Param("pending") String pending, @Param("stopped") String stopped);
+
+    @Transactional
+    @Modifying
+    @Query("update OsamJob job set job.status = concat(':prefix_',job.status), job.takenBy = null where job.uuid = :uuid and job.status not like ':prefix_%'")
+    Integer muteOsamCoreJob(@Param("uuid") UUID uuid, @Param("")String prefix);
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/utils/Streams.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/utils/Streams.java
new file mode 100644
index 0000000..35ffb98
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/utils/Streams.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.utils;
+
+import java.util.Iterator;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+
+public class Streams {
+    public static <R> Predicate<R> not(Predicate<R> predicate) {
+        return predicate.negate();
+    }
+
+    public static <T> Stream<T> fromIterator(final Iterator<T> iterator) {
+        Iterable<T> iterable = () -> iterator;
+        return StreamSupport.<T>stream(iterable.spliterator(), false);
+    }
+
+
+    // https://stackoverflow.com/questions/20746429/limit-a-stream-by-a-predicate
+    private static <T> Spliterator<T> takeWhile(
+            Spliterator<T> splitr, Predicate<? super T> predicate) {
+        return new Spliterators.AbstractSpliterator<T>(splitr.estimateSize(), 0) {
+            boolean stillGoing = true;
+            @Override public boolean tryAdvance(Consumer<? super T> consumer) {
+                if (stillGoing) {
+                    boolean hadNext = splitr.tryAdvance(elem -> {
+                        if (predicate.test(elem)) {
+                            consumer.accept(elem);
+                        } else {
+                            stillGoing = false;
+                        }
+                    });
+                    return hadNext && stillGoing;
+                }
+                return false;
+            }
+        };
+    }
+
+    public static <T> Stream<T> takeWhile(Stream<T> stream, Predicate<? super T> predicate) {
+        return StreamSupport.stream(takeWhile(stream.spliterator(), predicate), false);
+    }
+
+}
diff --git a/osam-core/async-jobs/src/main/java/org/onap/osam/job/utils/TimeUtils.java b/osam-core/async-jobs/src/main/java/org/onap/osam/job/utils/TimeUtils.java
new file mode 100644
index 0000000..bbd7ec3
--- /dev/null
+++ b/osam-core/async-jobs/src/main/java/org/onap/osam/job/utils/TimeUtils.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.utils;
+
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+
+public class TimeUtils {
+    private static DateTimeFormatter formatter = DateTimeFormatter.RFC_1123_DATE_TIME;
+
+    private TimeUtils() {
+        // explicit private constructor, to hide the implicit public constructor
+    }
+
+    public static ZonedDateTime parseZonedDateTime(String time) {
+
+        return ZonedDateTime.from(formatter.parse(time));
+    }
+
+    public static String zonedDateTimeToString(ZonedDateTime time) {
+        return formatter.format(time);
+    }
+}
diff --git a/osam-core/async-jobs/src/test/java/org/onap/osam/job/command/JobCommandFactoryTest.java b/osam-core/async-jobs/src/test/java/org/onap/osam/job/command/JobCommandFactoryTest.java
new file mode 100644
index 0000000..0ea9933
--- /dev/null
+++ b/osam-core/async-jobs/src/test/java/org/onap/osam/job/command/JobCommandFactoryTest.java
@@ -0,0 +1,122 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.collect.ImmutableMap;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobFactory;
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.JobType;
+import org.onap.osam.job.command.JobCommandFactory;
+import org.onap.osam.job.impl.JobSharedData;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Objects;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class JobCommandFactoryTest {
+
+    private JobCommandFactory jobCommandFactory;
+
+    @Mock
+    private OsamJob job;
+
+    @Mock
+    private IJobCommand mockCommand;
+
+    @BeforeMethod
+    public void initMocks() {
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @BeforeMethod
+    public void setUp() {
+        jobCommandFactory = new JobCommandFactory(any -> mockCommand);
+    }
+
+    @DataProvider
+    public Object[][] jobTypes() {
+        return Arrays.stream(
+                JobType.values()
+        ).map(v -> new Object[]{v}).collect(Collectors.toList()).toArray(new Object[][]{});
+
+    }
+
+    public static class MockedRequest implements IJobFactory.AsyncJobRequest {
+
+        final public int x;
+        final public String y;
+
+        @JsonCreator
+        public MockedRequest(@JsonProperty("x")int x, @JsonProperty("y")String y) {
+            this.x = x;
+            this.y = y;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (!(o instanceof MockedRequest)) return false;
+            MockedRequest that = (MockedRequest) o;
+            return x == that.x &&
+                    Objects.equals(y, that.y);
+        }
+
+        @Override
+        public int hashCode() {
+
+            return Objects.hash(x, y);
+        }
+    }
+
+    @Test(dataProvider = "jobTypes")
+    public void givenJob_createCommandCallsTheInitAndReturnsTheInstance(JobType jobType) {
+
+        final UUID uuid = UUID.randomUUID();
+        final Map<String, Object> data = ImmutableMap.of("foo", "bar");
+        final JobSharedData sharedData = new JobSharedData(uuid, "userid", new MockedRequest(1,"a"));
+
+        when(job.getType()).thenReturn(jobType);
+        when(job.getUuid()).thenReturn(uuid);
+        when(job.getDataMap()).thenReturn(data);
+        when(job.getSharedData()).thenReturn(sharedData);
+
+        final IJobCommand command = jobCommandFactory.toCommand(job);
+
+        verify(mockCommand).init(sharedData, data);
+
+        assertThat(command, equalTo(mockCommand));
+    }
+
+}
diff --git a/osam-core/async-jobs/src/test/java/org/onap/osam/job/command/WatchingCommandTest.java b/osam-core/async-jobs/src/test/java/org/onap/osam/job/command/WatchingCommandTest.java
new file mode 100644
index 0000000..0e595a6
--- /dev/null
+++ b/osam-core/async-jobs/src/test/java/org/onap/osam/job/command/WatchingCommandTest.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.command;
+
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobFactory;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.AsyncJobService;
+import org.onap.osam.job.command.WatchingCommand;
+import org.onap.osam.job.impl.JobSharedData;
+import org.onap.osam.job.repository.job.OsamJobRepository;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.*;
+
+public class WatchingCommandTest {
+
+    @Mock
+    private AsyncJobService asyncInstantiationBL;
+
+    @Mock
+    private OsamJobRepository osamJobRepository;
+
+    @InjectMocks
+    private WatchingCommand watchingCommand = new WatchingCommand();
+
+    @DataProvider
+    public static Object[][] expectedJobStatusDataProvider() {
+        return new Object[][]{
+                {Arrays.asList(JobStatus.COMPLETED, JobStatus.COMPLETED), JobStatus.COMPLETED, true},
+                {Arrays.asList(JobStatus.FAILED, JobStatus.COMPLETED), JobStatus.COMPLETED_WITH_ERRORS, true},
+                {Arrays.asList(JobStatus.STOPPED, JobStatus.COMPLETED), JobStatus.COMPLETED_WITH_ERRORS, false},
+                {Arrays.asList(JobStatus.IN_PROGRESS, JobStatus.FAILED), JobStatus.IN_PROGRESS, true},
+                {Arrays.asList(JobStatus.IN_PROGRESS, JobStatus.COMPLETED), JobStatus.IN_PROGRESS, true},
+                {Arrays.asList(JobStatus.IN_PROGRESS, JobStatus.IN_PROGRESS), JobStatus.IN_PROGRESS, true},
+                {Arrays.asList(null, JobStatus.COMPLETED), JobStatus.COMPLETED_WITH_ERRORS, true},
+                {Arrays.asList(null, JobStatus.IN_PROGRESS), JobStatus.IN_PROGRESS, true},
+                {Arrays.asList(null, JobStatus.FAILED), JobStatus.COMPLETED_WITH_ERRORS, false},
+                {new ArrayList<>(), JobStatus.COMPLETED, true}
+        };
+    }
+
+    @BeforeMethod
+    public void initMocks() {
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @Test(dataProvider = "expectedJobStatusDataProvider")
+    public void testAssertNextCommandIsValid(List<JobStatus> childJobs, JobStatus expectedCommandStatus, boolean isService) {
+        //init sql result mock
+        List<OsamJob> mockChildren = childJobs.stream().map(st -> {
+            OsamJob job = new OsamJob();
+            job.setUuid(UUID.randomUUID());
+            job.setStatus(st);
+            return job;
+        }).collect(Collectors.toList());
+        when(osamJobRepository.findAllByUuid(any()))
+                .thenReturn(mockChildren);
+
+        //init job data for watching command
+        UUID jobUUID = UUID.randomUUID();
+        JobSharedData sharedData = new JobSharedData(jobUUID, "mockedUserID", mock(TestRequest.class));
+        List<UUID> uuids = mockChildren.stream().map(job -> job.getUuid()).collect(Collectors.toList());
+        watchingCommand.init(sharedData, uuids, isService);
+
+        //execute command and verify
+        NextCommand nextCommand = watchingCommand.call();
+        assertThat(nextCommand.getStatus(), is(expectedCommandStatus));
+    }
+
+    public static class TestRequest implements IJobFactory.AsyncJobRequest{}
+}
diff --git a/osam-core/async-jobs/src/test/java/org/onap/osam/job/impl/JobAdapterTest.java b/osam-core/async-jobs/src/test/java/org/onap/osam/job/impl/JobAdapterTest.java
new file mode 100644
index 0000000..289cd99
--- /dev/null
+++ b/osam-core/async-jobs/src/test/java/org/onap/osam/job/impl/JobAdapterTest.java
@@ -0,0 +1,113 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.commons.lang3.RandomUtils;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobFactory;
+import org.onap.osam.job.JobType;
+import org.onap.osam.job.command.JobCommandFactoryTest;
+import org.testng.annotations.Test;
+
+import java.util.UUID;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+public class JobAdapterTest {
+
+    @Test
+    public void testCreateServiceInstantiationJob() {
+        IJobFactory jobAdapter = new JobFactory();
+
+        JobType jobType = JobType.NoOp;
+        IJobFactory.AsyncJobRequest request = new JobCommandFactoryTest.MockedRequest(42,"nothing");
+        String userId = "ou012t";
+        String optimisticUniqueServiceInstanceName = "optimisticUniqueServiceInstanceName";
+        int indexInBulk = RandomUtils.nextInt();
+        OsamJob job = jobAdapter.createRootJob(
+                jobType,
+                request,
+                userId,
+                indexInBulk,
+                ImmutableMap.of());
+
+        assertEquals(job.getType(), jobType);
+        assertEquals(job.getSharedData().getRequest(), request);
+        assertEquals(job.getSharedData().getRequestType(), request.getClass());
+        assertEquals(job.getSharedData().getUserId(), userId);
+        assertEquals(job.getSharedData().getJobUuid(), job.getUuid());
+        assertEquals(job.getSharedData().getRootJobId(), job.getUuid());
+        assertNotNull(job.getUuid());
+        assertEquals((int)job.getIndexInBulk(), indexInBulk );
+        assertEquals(job.getStatus(), JobStatus.PENDING);
+    }
+
+    @Test
+    public void testCreateChildJob() {
+
+        IJobFactory jobAdapter = new JobFactory();
+
+        String userId = "ou012t";
+        String optimisticUniqueServiceInstanceName = "optimisticUniqueServiceInstanceName";
+        int indexInBulk = RandomUtils.nextInt();
+        OsamJob grandJob = jobAdapter.createRootJob(
+                JobType.HttpCall,
+                new JobCommandFactoryTest.MockedRequest(99, "anything"),
+                userId,
+                indexInBulk,
+                ImmutableMap.of()
+        );
+
+        JobStatus jobStatus = JobStatus.PAUSE;
+        JobType jobType = JobType.NoOp;
+        IJobFactory.AsyncJobRequest request = new JobCommandFactoryTest.MockedRequest(42,"nothing");
+        OsamJob parentJob = jobAdapter.createChildJob(jobType, jobStatus, request, grandJob.getSharedData(), ImmutableMap.of());
+
+        assertEquals(parentJob.getType(), jobType);
+        assertEquals(parentJob.getSharedData().getRequest(), request);
+        assertEquals(parentJob.getSharedData().getRequestType(), request.getClass());
+        assertEquals(parentJob.getSharedData().getUserId(), userId);
+        assertEquals(parentJob.getSharedData().getJobUuid(), parentJob.getUuid());
+        assertNotNull(parentJob.getUuid());
+        assertNotEquals(parentJob.getUuid(), grandJob.getUuid());
+        assertEquals(parentJob.getStatus(), jobStatus);
+        assertEquals(parentJob.getSharedData().getRootJobId(), grandJob.getUuid());
+
+        JobStatus jobStatus2 = JobStatus.IN_PROGRESS;
+        JobType jobType2 = JobType.HttpCall;
+        IJobFactory.AsyncJobRequest request2 = new JobCommandFactoryTest.MockedRequest(66,"abc");
+        OsamJob job = jobAdapter.createChildJob(jobType2, jobStatus2, request2, parentJob.getSharedData(), ImmutableMap.of());
+
+        assertEquals(job.getType(), jobType2);
+        assertEquals(job.getSharedData().getRequest(), request2);
+        assertEquals(job.getSharedData().getRequestType(), request2.getClass());
+        assertEquals(job.getSharedData().getUserId(), userId);
+        assertEquals(job.getSharedData().getJobUuid(), job.getUuid());
+        assertNotNull(job.getUuid());
+        assertNotEquals(job.getUuid(), parentJob.getUuid());
+        assertEquals(job.getStatus(), jobStatus2);
+        assertEquals(job.getSharedData().getRootJobId(), grandJob.getUuid());
+
+    }
+}
diff --git a/osam-core/async-jobs/src/test/java/org/onap/osam/job/impl/JobWorkerTest.java b/osam-core/async-jobs/src/test/java/org/onap/osam/job/impl/JobWorkerTest.java
new file mode 100644
index 0000000..f38c238
--- /dev/null
+++ b/osam-core/async-jobs/src/test/java/org/onap/osam/job/impl/JobWorkerTest.java
@@ -0,0 +1,129 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.osam.job.impl;
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.commons.lang3.RandomUtils;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.hamcrest.Matcher;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.onap.osam.job.dao.job.JobStatus;
+import org.onap.osam.job.dao.job.OsamJob;
+import org.onap.osam.job.IJobFactory;
+import org.onap.osam.job.IJobCommand;
+import org.onap.osam.job.JobType;
+import org.onap.osam.job.NextCommand;
+import org.onap.osam.job.command.HttpCallCommand;
+import org.onap.osam.job.command.JobCommandFactory;
+import org.onap.osam.job.impl.JobFactory;
+import org.onap.osam.job.impl.JobWorker;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.Map;
+import java.util.UUID;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.*;
+import static org.hamcrest.core.Is.is;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public class JobWorkerTest {
+
+
+    @Mock
+    private JobCommandFactory jobCommandFactory;
+
+    @InjectMocks
+    private JobWorker jobWorker = new JobWorker();
+
+    private final IJobCommand jobCommand = mock(IJobCommand.class);
+    private OsamJob jobUnderTest;
+    private IJobFactory.AsyncJobRequest originalData;
+    private JobType originalType;
+
+    @BeforeMethod
+    public void initMocks() {
+        MockitoAnnotations.initMocks(this);
+
+        when(jobCommandFactory.toCommand(any())).thenReturn(jobCommand);
+
+        originalData = new IJobFactory.AsyncJobRequest() {
+            public final Map datum = ImmutableMap.of("some", "data");
+            public final String foobar = "aux";
+        };
+
+        originalType = JobType.HttpCall;
+        jobUnderTest = new JobFactory().createRootJob(
+                originalType,
+                originalData,
+                "my user id",
+                RandomUtils.nextInt(),
+                ImmutableMap.of()
+        );
+    }
+
+    @Test
+    public void executeJobAndStepToNext_givenNull_onlyStatusModified() {
+
+        assertNextJobAfterExecuteJob(null, new String[]{"status"}, allOf(
+                hasProperty("status", is(JobStatus.STOPPED)),
+                hasProperty("sharedData", hasProperty("request", is(originalData))),
+                hasProperty("type", is(originalType)))
+        );
+    }
+
+    @Test
+    public void executeJobAndStepToNext_givenNextJob_jobDataIsModified() {
+
+        final JobStatus nextStatus = JobStatus.IN_PROGRESS;
+
+        final UUID jobUuid = UUID.randomUUID();
+        final NextCommand nextCommand = new NextCommand(nextStatus, new HttpCallCommand("my strange url", jobUuid));
+
+        String[] excludedFields = {"status", "data", "type"};
+
+        assertNextJobAfterExecuteJob(nextCommand, excludedFields, allOf(
+                hasProperty("status", is(nextStatus)),
+                hasProperty("dataMap", is(nextCommand.getCommand().getData())),
+                hasProperty("type", is(nextCommand.getCommand().getType())))
+        );
+    }
+
+    private void assertNextJobAfterExecuteJob(NextCommand nextCommand, String[] excludedFields, Matcher<OsamJob> jobMatcher) {
+        when(jobCommand.call()).thenReturn(nextCommand);
+
+        String jobBefore = new ReflectionToStringBuilder(jobUnderTest, ToStringStyle.SHORT_PREFIX_STYLE).setExcludeFieldNames(excludedFields).toString();
+
+        ////// FUNCTION UNDER TEST /////
+        OsamJob nextJob = jobWorker.executeJobAndGetNext(jobUnderTest);
+        ////////////////////////////////
+
+        String jobAfter = new ReflectionToStringBuilder(nextJob, ToStringStyle.SHORT_PREFIX_STYLE).setExcludeFieldNames(excludedFields).toString();
+
+        assertThat(nextJob, jobMatcher);
+        assertThat(jobAfter, equalTo(jobBefore));
+    }
+}
