diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java
index 4d9bb27..3a8c730 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/comp/LockHelperImpl.java
@@ -8,9 +8,9 @@
  * 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.
@@ -26,12 +26,15 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
-
 import org.onap.ccsdk.sli.adaptors.lock.dao.ResourceLockDao;
 import org.onap.ccsdk.sli.adaptors.lock.data.ResourceLock;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class LockHelperImpl implements LockHelper {
 
+    private static final Logger log = LoggerFactory.getLogger(LockHelperImpl.class);
+
     private ResourceLockDao resourceLockDao;
     private int retryCount = 10;
     private int lockWait = 5; // Seconds
@@ -51,10 +54,12 @@
         for (int i = 0; true; i++) {
             try {
                 tryLock(resourceNameList, lockRequester, lockTimeout);
+                log.info("Resources locked: " + resourceNameList);
                 return;
             } catch (ResourceLockedException e) {
-                if (i > retryCount)
+                if (i > retryCount) {
                     throw e;
+                }
                 try {
                     Thread.sleep(lockWait * 1000);
                 } catch (InterruptedException ex) {
@@ -65,58 +70,64 @@
 
     @Override
     public void unlock(Collection<String> lockNames, boolean force) {
-        if (lockNames == null || lockNames.size() == 0)
+        if (lockNames == null || lockNames.size() == 0) {
             return;
-
-        resourceLockDao.lockTable();
+        }
 
         try {
             for (String name : lockNames) {
                 ResourceLock l = resourceLockDao.getByResourceName(name);
-                if (l != null)
-                    if (force || l.lockCount == 1)
+                if (l != null) {
+                    if (force || l.lockCount == 1) {
                         resourceLockDao.delete(l.id);
-                    else
+                    } else {
                         resourceLockDao.decrementLockCount(l.id);
+                    }
+                }
             }
+
+            resourceLockDao.commit();
+
+            log.info("Resources unlocked: " + lockNames);
         } finally {
-            resourceLockDao.unlockTable();
+            resourceLockDao.rollback();
         }
     }
 
     public void tryLock(Collection<String> resourceNameList, String lockRequester, int lockTimeout /* Seconds */) {
-        if (resourceNameList == null || resourceNameList.size() == 0)
+        if (resourceNameList == null || resourceNameList.size() == 0) {
             return;
+        }
 
         lockRequester = generateLockRequester(lockRequester, 100);
 
-        resourceLockDao.lockTable();
+        // First check if all requested records are available to lock
+
+        Date now = new Date();
 
         try {
-            // First check if all requested records are available to lock
-
-            Date now = new Date();
-
-            List<ResourceLock> dbLockList = new ArrayList<ResourceLock>();
-            List<String> insertLockNameList = new ArrayList<String>();
+            List<ResourceLock> dbLockList = new ArrayList<>();
+            List<String> insertLockNameList = new ArrayList<>();
             for (String name : resourceNameList) {
                 ResourceLock l = resourceLockDao.getByResourceName(name);
 
-                boolean canLock =
-                        l == null || now.getTime() > l.expirationTime.getTime() || lockRequester != null &&
-                                lockRequester.equals(l.lockHolder) || l.lockCount <= 0;
-                if (!canLock)
+                boolean canLock = l == null || now.getTime() > l.expirationTime.getTime() ||
+                        lockRequester != null && lockRequester.equals(l.lockHolder) || l.lockCount <= 0;
+                if (!canLock) {
                     throw new ResourceLockedException(l.resourceName, l.lockHolder, lockRequester);
+                }
 
-                if (l != null)
+                if (l != null) {
                     dbLockList.add(l);
-                else
+                } else {
                     insertLockNameList.add(name);
+                }
             }
 
             // Update the lock info in DB
-            for (ResourceLock l : dbLockList)
+            for (ResourceLock l : dbLockList) {
                 resourceLockDao.update(l.id, now, new Date(now.getTime() + lockTimeout * 1000), l.lockCount + 1);
+            }
 
             // Insert records for those that are not yet there
             for (String lockName : insertLockNameList) {
@@ -126,16 +137,26 @@
                 l.lockTime = now;
                 l.expirationTime = new Date(now.getTime() + lockTimeout * 1000);
                 l.lockCount = 1;
-                resourceLockDao.add(l);
+
+                try {
+                    resourceLockDao.add(l);
+                } catch (Exception e) {
+                    log.info("Failed to insert lock record: " + lockName);
+                    throw new ResourceLockedException(l.resourceName, "unknown", lockRequester);
+                }
             }
+
+            resourceLockDao.commit();
+
         } finally {
-            resourceLockDao.unlockTable();
+            resourceLockDao.rollback();
         }
     }
 
     private static String generateLockRequester(String name, int maxLength) {
-        if (name == null)
+        if (name == null) {
             name = "";
+        }
         int l1 = name.length();
         String tname = Thread.currentThread().getName();
         int l2 = tname.length();
@@ -146,8 +167,9 @@
                 l1 = maxl1;
             }
             int maxl2 = maxLength - l1 - 1;
-            if (l2 > maxl2)
+            if (l2 > maxl2) {
                 tname = tname.substring(0, 6) + "..." + tname.substring(l2 - maxl2 + 9);
+            }
         }
         return tname + '-' + name;
     }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/dao/ResourceLockDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/dao/ResourceLockDao.java
index bcabb36..f9d4113 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/dao/ResourceLockDao.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/dao/ResourceLockDao.java
@@ -8,9 +8,9 @@
  * 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.
@@ -22,15 +22,10 @@
 package org.onap.ccsdk.sli.adaptors.lock.dao;
 
 import java.util.Date;
-
 import org.onap.ccsdk.sli.adaptors.lock.data.ResourceLock;
 
 public interface ResourceLockDao {
 
-    void lockTable();
-
-    void unlockTable();
-
     void add(ResourceLock l);
 
     void update(long id, Date lockTime, Date expirationTime, int lockCount);
@@ -40,4 +35,8 @@
     void delete(long id);
 
     void decrementLockCount(long id);
+
+    void commit();
+
+    void rollback();
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/dao/ResourceLockDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/dao/ResourceLockDaoImpl.java
index d68317f..4854192 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/dao/ResourceLockDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/lock/dao/ResourceLockDaoImpl.java
@@ -8,9 +8,9 @@
  * 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.
@@ -25,7 +25,6 @@
 import java.sql.SQLException;
 import java.util.Date;
 import java.util.List;
-
 import org.onap.ccsdk.sli.adaptors.lock.data.ResourceLock;
 import org.onap.ccsdk.sli.adaptors.util.db.CachedDataSourceWrap;
 import org.slf4j.Logger;
@@ -35,29 +34,10 @@
 
 public class ResourceLockDaoImpl implements ResourceLockDao {
 
+    @SuppressWarnings("unused")
     private static final Logger log = LoggerFactory.getLogger(ResourceLockDaoImpl.class);
 
     private JdbcTemplate jdbcTemplate;
-    private boolean testing = false;
-
-    @Override
-    public void lockTable() {
-        if (!testing) {
-            jdbcTemplate.update("LOCK TABLES RESOURCE_LOCK WRITE");
-        log.info("Table RESOURCE_LOCK locked.");
-    }
-    }
-
-    @Override
-    public void unlockTable() {
-        if (!testing) {
-            jdbcTemplate.update("UNLOCK TABLES");
-        log.info("Table RESOURCE_LOCK unlocked.");
-
-            CachedDataSourceWrap ds = (CachedDataSourceWrap) jdbcTemplate.getDataSource();
-            ds.releaseConnection();
-        }
-    }
 
     @Override
     public void add(ResourceLock l) {
@@ -109,7 +89,21 @@
         this.jdbcTemplate = jdbcTemplate;
     }
 
-    public void setTesting(boolean testing) {
-        this.testing = testing;
+    @Override
+    public void commit() {
+        if (jdbcTemplate.getDataSource() instanceof CachedDataSourceWrap) {
+            CachedDataSourceWrap ds = (CachedDataSourceWrap) jdbcTemplate.getDataSource();
+            ds.commit();
+            ds.releaseConnection();
+        }
+    }
+
+    @Override
+    public void rollback() {
+        if (jdbcTemplate.getDataSource() instanceof CachedDataSourceWrap) {
+            CachedDataSourceWrap ds = (CachedDataSourceWrap) jdbcTemplate.getDataSource();
+            ds.rollback();
+            ds.releaseConnection();
+        }
     }
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ReleaseRequestType.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ReleaseRequestType.java
deleted file mode 100644
index d3df91c..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ReleaseRequestType.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra;
-
-public enum ReleaseRequestType {
-    Cancel, Activate, Disconnect;
-
-    public static ReleaseRequestType convert(Object o) {
-        if (o == null)
-            return null;
-        String s = o.toString();
-        s = s.trim();
-        if (s.length() == 0)
-            return null;
-
-        if (s.equalsIgnoreCase("Cancel"))
-            return Cancel;
-        if (s.equalsIgnoreCase("Activate"))
-            return Activate;
-        if (s.equalsIgnoreCase("Disconnect"))
-            return Disconnect;
-
-        throw new IllegalArgumentException("Invalid request-type: " + s +
-                ". Supported values are Cancel, Activate, Disconnect.");
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ReserveRequestType.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ReserveRequestType.java
deleted file mode 100644
index b46b7de..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ReserveRequestType.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra;
-
-public enum ReserveRequestType {
-    New, Change;
-
-    public static ReserveRequestType convert(Object o) {
-        if (o == null)
-            return null;
-        String s = o.toString();
-        s = s.trim();
-        if (s.length() == 0)
-            return null;
-
-        if (s.equalsIgnoreCase("New"))
-            return New;
-        if (s.equalsIgnoreCase("Change"))
-            return Change;
-
-        throw new IllegalArgumentException("Invalid request-type: " + s +
-                ". Supported values are New, Change.");
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java
index 8e7c63c..426fd28 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 							reserved.
  * ================================================================================
  * 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.
@@ -21,48 +21,25 @@
 
 package org.onap.ccsdk.sli.adaptors.ra;
 
-import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
+import java.util.Set;
+import org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocator;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceData;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceEntity;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceRequest;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceTarget;
+import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
+import org.onap.ccsdk.sli.adaptors.rm.data.AllocationStatus;
+import org.onap.ccsdk.sli.adaptors.util.speed.SpeedUtil;
+import org.onap.ccsdk.sli.adaptors.util.str.StrUtil;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
-import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
-import org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocator;
-import org.onap.ccsdk.sli.adaptors.ra.comp.EndPointData;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.dao.ServerDao;
-import org.onap.ccsdk.sli.adaptors.ra.equip.dao.VpePortDao;
-import org.onap.ccsdk.sli.adaptors.ra.equip.dao.VplspePortDao;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
-import org.onap.ccsdk.sli.adaptors.ra.rule.comp.AllocationRequestBuilder;
-import org.onap.ccsdk.sli.adaptors.ra.rule.dao.MaxPortSpeedDao;
-import org.onap.ccsdk.sli.adaptors.ra.rule.dao.MaxServerSpeedDao;
-import org.onap.ccsdk.sli.adaptors.ra.rule.dao.ParameterDao;
-import org.onap.ccsdk.sli.adaptors.ra.rule.data.ThresholdStatus;
-import org.onap.ccsdk.sli.adaptors.ra.service.dao.ServiceResourceDao;
-import org.onap.ccsdk.sli.adaptors.ra.service.data.ServiceResource;
-import org.onap.ccsdk.sli.adaptors.ra.service.data.ServiceStatus;
-import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationAction;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationOutcome;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationStatus;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationOutcome;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitResource;
-import org.onap.ccsdk.sli.adaptors.rm.data.MultiResourceAllocationOutcome;
-import org.onap.ccsdk.sli.adaptors.rm.data.RangeAllocationItem;
-import org.onap.ccsdk.sli.adaptors.rm.data.RangeResource;
-import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
-import org.onap.ccsdk.sli.adaptors.util.speed.SpeedUtil;
-import org.onap.ccsdk.sli.adaptors.util.str.StrUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -70,24 +47,16 @@
 
     private static final Logger log = LoggerFactory.getLogger(ResourceAllocator.class);
 
+    private static final String[] INPUT_PREFIX = {"ra-input.", "tmp.resource-allocator."};
+
+    private ResourceManager resourceManager;
+    private EndPointAllocator endPointAllocator;
+    private SpeedUtil speedUtil;
+
     public ResourceAllocator() {
         log.info("ResourceAllocator created.");
     }
 
-    private ServerDao serverDao;
-    private VpePortDao vpePortDao;
-    private VplspePortDao vplspePortDao;
-    private MaxPortSpeedDao maxPortSpeedDao;
-    private MaxServerSpeedDao maxServerSpeedDao;
-    private ServiceResourceDao serviceResourceDao;
-    private ParameterDao parameterDao;
-
-    private AllocationRequestBuilder allocationRequestBuilder;
-    private ResourceManager resourceManager;
-    private SpeedUtil speedUtil;
-
-    private EndPointAllocator endPointAllocator;
-
     @Override
     public QueryStatus notify(String resource, String action, String key, SvcLogicContext ctx)
             throws SvcLogicException {
@@ -95,11 +64,7 @@
     }
 
     @Override
-    public QueryStatus update(
-            String resource,
-            String key,
-            Map<String, String> parms,
-            String prefix,
+    public QueryStatus update(String resource, String key, Map<String, String> parms, String prefix,
             SvcLogicContext ctx) throws SvcLogicException {
 
         return QueryStatus.SUCCESS;
@@ -117,13 +82,7 @@
     }
 
     @Override
-    public QueryStatus save(
-            String arg0,
-            boolean arg1,
-            boolean arg2,
-            String arg3,
-            Map<String, String> arg4,
-            String arg5,
+    public QueryStatus save(String arg0, boolean arg1, boolean arg2, String arg3, Map<String, String> arg4, String arg5,
             SvcLogicContext arg6) throws SvcLogicException {
         return QueryStatus.SUCCESS;
     }
@@ -131,886 +90,355 @@
     @Override
     public QueryStatus isAvailable(String resource, String key, String prefix, SvcLogicContext ctx)
             throws SvcLogicException {
-        String serviceModel = ctx.getAttribute("tmp.resource-allocator.service-model");
-        if (serviceModel != null && serviceModel.trim().length() > 0)
-            return allocateResources(serviceModel, ctx, true, prefix);
-        return allocateResourcesL3SDN(ctx, true, prefix);
+        return allocateResources(ctx, true, prefix);
     }
 
     @Override
-    public QueryStatus query(
-            String resource,
-            boolean localOnly,
-            String select,
-            String key,
-            String prefix,
-            String orderBy,
-            SvcLogicContext ctx) throws SvcLogicException {
+    public QueryStatus query(String resource, boolean localOnly, String select, String key, String prefix,
+            String orderBy, SvcLogicContext ctx) throws SvcLogicException {
 
+        String resourceEntityId = getParam(ctx,
+                new String[] {"service-instance-id", "reservation-entity-id", "resource-entity-id"}, false, null);
+        String resourceEntityType =
+                getParam(ctx, new String[] {"reservation-entity-type", "resource-entity-type"}, false, null);
+        String resourceEntityVersion =
+                getParam(ctx, new String[] {"reservation-entity-version", "resource-entity-version"}, false, "1");
+
+        String resourceTargetId =
+                getParam(ctx, new String[] {"reservation-target-id", "resource-target-id"}, false, null);
+        String resourceTargetType =
+                getParam(ctx, new String[] {"reservation-target-type", "resource-target-type"}, false, null);
+        String resourceName = getParam(ctx, "resource-name", false, null);
+
+        if (resourceEntityId != null && resourceEntityType != null) {
+            List<ResourceData> rdlist = endPointAllocator.getResourcesForEntity(resourceEntityType, resourceEntityId,
+                    resourceEntityVersion);
+            setResourceDataInContext(ctx, prefix, rdlist);
+        } else if (resourceTargetId != null && resourceTargetType != null && resourceName != null) {
+            ResourceData rd = endPointAllocator.getResource(resourceTargetType, resourceTargetId, resourceName);
+            setResourceDataInContext(ctx, prefix, Collections.singletonList(rd));
+        }
+
+        return QueryStatus.SUCCESS;
+    }
+
+    public AllocationStatus query(ResourceEntity sd, ResourceTarget rt, ResourceRequest rr,
+            List<ResourceResponse> rsList) throws Exception {
+
+        if (sd.resourceEntityId != null && sd.resourceEntityType != null) {
+            List<ResourceData> rdlist = endPointAllocator.getResourcesForEntity(sd.resourceEntityType,
+                    sd.resourceEntityId, sd.resourceEntityVersion);
+            setResourceDataInResponse(rdlist, rsList);
+        } else if (rt.resourceTargetId != null && rt.resourceTargetType != null && rr.resourceName != null) {
+            ResourceData rd =
+                    endPointAllocator.getResource(rt.resourceTargetType, rt.resourceTargetId, rr.resourceName);
+            setResourceDataInResponse(Collections.singletonList(rd), rsList);
+        }
+
+        return AllocationStatus.Success;
+    }
+
+    private void setResourceDataInContext(SvcLogicContext ctx, String prefix, List<ResourceData> rdlist) {
         prefix = prefix == null ? "" : prefix + '.';
 
-        if (!"NetworkCapacity".equals(resource)) {
-            log.info("resource: " + resource);
-            log.info("key: " + key);
+        setAttr(ctx, prefix + "resource-list_length", String.valueOf(rdlist.size()));
 
-            Resource r = resourceManager.getResource(resource, key);
-            if (r == null)
-                return QueryStatus.NOT_FOUND;
+        for (int i = 0; i < rdlist.size(); i++) {
+            ResourceData rd = rdlist.get(i);
 
-            if (r instanceof LimitResource) {
-                ctx.setAttribute(prefix + "used", String.valueOf(((LimitResource) r).used));
+            String pp = prefix + "resource-list[" + i + "].";
 
-                log.info("Added context attr: " + prefix + "used: " + String.valueOf(((LimitResource) r).used));
-            }
+            setAttr(ctx, pp + "resource-name", rd.resourceName);
+            setAttr(ctx, pp + "endpoint-position", rd.endPointPosition);
+            setAttr(ctx, pp + "resource-target-type", rd.resourceTargetType);
+            setAttr(ctx, pp + "resource-target-id", rd.resourceTargetId);
+            // SDNGC-7687
+            setAttr(ctx, pp + "resource-target-value", rd.resourceTargetValue);
+            setAttr(ctx, pp + "status", rd.status);
 
-            return QueryStatus.SUCCESS;
-        }
-
-        log.info("key: " + key);
-        log.info("prefix: " + prefix);
-
-        if (key == null)
-            return QueryStatus.SUCCESS;
-
-        if (key.startsWith("'") && key.endsWith("'"))
-            key = key.substring(1, key.length() - 1);
-
-        String endPointPosition = "VPE-Cust";
-
-        String resourceUnionId = key + '/' + endPointPosition;
-        List<Resource> rlist = resourceManager.getResourceUnion(resourceUnionId);
-
-        log.info("Resources found for " + resourceUnionId + ": " + rlist.size());
-
-        String assetId = null;
-        for (Resource r : rlist) {
-            log.info("Resource: " + r.resourceKey.resourceName);
-
-            if (r instanceof RangeResource) {
-                RangeResource rr = (RangeResource) r;
-                for (AllocationItem ai : r.allocationItems)
-                    if (ai.resourceUnionId.equals(resourceUnionId)) {
-                        RangeAllocationItem rai = (RangeAllocationItem) ai;
-                        ctx.setAttribute(prefix + r.resourceKey.resourceName, String.valueOf(rai.used.first()));
-
-                        log.info("Added context attr: " + prefix + r.resourceKey.resourceName + ": " +
-                                String.valueOf(rr.used.first()));
-
-                        assetId = r.resourceKey.assetId;
-                        String vpeName = assetId;
-                        int i1 = assetId.indexOf('/');
-                        if (i1 > 0)
-                            vpeName = assetId.substring(0, i1);
-                        ctx.setAttribute(prefix + "vpe-name", vpeName);
-
-                        log.info("Added context attr: " + prefix + "vpe-name: " + vpeName);
-                    }
-            }
-        }
-
-        String affinityLink = "1";
-        if (assetId != null) {
-            for (Resource r : rlist) {
-                if (r instanceof LimitResource) {
-                    LimitResource ll = (LimitResource) r;
-                    if (ll.resourceKey.assetId.startsWith(assetId + '-')) {
-                        int i1 = ll.resourceKey.assetId.lastIndexOf('-');
-                        affinityLink = ll.resourceKey.assetId.substring(i1 + 1);
-                        break;
-                    }
+            if (rd.data != null && !rd.data.isEmpty()) {
+                for (String kk : rd.data.keySet()) {
+                    String value = String.valueOf(rd.data.get(kk));
+                    setAttr(ctx, pp + kk, value);
                 }
             }
         }
-
-        ctx.setAttribute(prefix + "affinity-link", affinityLink);
-
-        log.info("Added context attr: " + prefix + "affinity-link: " + affinityLink);
-
-        return QueryStatus.SUCCESS;
     }
 
     @Override
     public QueryStatus reserve(String resource, String select, String key, String prefix, SvcLogicContext ctx)
             throws SvcLogicException {
-        String serviceModel = ctx.getAttribute("tmp.resource-allocator.service-model");
-        if (serviceModel != null && serviceModel.trim().length() > 0)
-            return allocateResources(serviceModel, ctx, false, prefix);
-        return allocateResourcesL3SDN(ctx, false, prefix);
+        return allocateResources(ctx, false, prefix);
+    }
+
+    public AllocationStatus reserve(ResourceEntity sd, ResourceTarget rt, ResourceRequest rr,
+            List<ResourceResponse> rsList) throws Exception {
+        return allocateResources(sd, rt, rr, rsList);
     }
 
     @Override
     public QueryStatus release(String resource, String key, SvcLogicContext ctx) throws SvcLogicException {
-        String serviceInstanceId = ctx.getAttribute("tmp.resource-allocator.service-instance-id");
-        if (serviceInstanceId == null)
-            throw new SvcLogicException("tmp.resource-allocator.service-instance-id is required in ResourceAllocator");
+        String resourceEntityId = getParam(ctx,
+                new String[] {"service-instance-id", "reservation-entity-id", "resource-entity-id"}, true, null);
+        String resourceEntityType =
+                getParam(ctx, new String[] {"reservation-entity-type", "resource-entity-type"}, true, null);
+        String resourceEntityVersion =
+                getParam(ctx, new String[] {"reservation-entity-version", "resource-entity-version"}, false, null);
 
-        String requestTypeStr = ctx.getAttribute("tmp.resource-allocator.request-type");
-        if (requestTypeStr == null)
-            throw new SvcLogicException("tmp.resource-allocator.request-type is required in ResourceAllocator");
+        ResourceEntity sd = new ResourceEntity();
+        sd.resourceEntityId = resourceEntityId;
+        sd.resourceEntityType = resourceEntityType;
+        sd.resourceEntityVersion = resourceEntityVersion;
 
-        ReleaseRequestType requestType = null;
         try {
-            requestType = ReleaseRequestType.convert(requestTypeStr);
-        } catch (IllegalArgumentException e) {
-            throw new SvcLogicException("Invalid tmp.resource-allocator.request-type: " + requestTypeStr +
-                    ". Supported values are Cancel, Activate, Disconnect.");
+            this.release(sd);
+        } catch (Exception e) {
+            throw new SvcLogicException(e.getMessage());
         }
-
-        log.info("Starting release: " + requestType + " for: " + serviceInstanceId);
-
-        ServiceResource activeServiceResource =
-                serviceResourceDao.getServiceResource(serviceInstanceId, ServiceStatus.Active);
-        ServiceResource pendingServiceResource =
-                serviceResourceDao.getServiceResource(serviceInstanceId, ServiceStatus.Pending);
-
-        log.info("Active ServiceResource: ");
-        StrUtil.info(log, activeServiceResource);
-        log.info("Pending ServiceResource: ");
-        StrUtil.info(log, pendingServiceResource);
-
-        if (requestType == ReleaseRequestType.Cancel) {
-            if (pendingServiceResource != null) {
-                log.info("Releasing pending resources: " + pendingServiceResource.resourceSetId);
-
-                resourceManager.releaseResourceSet(pendingServiceResource.resourceSetId);
-                serviceResourceDao.deleteServiceResource(serviceInstanceId, ServiceStatus.Pending);
-            } else {
-                log.info("Pending record not found for service instance: " + serviceInstanceId + ". Nothing to do.");
-            }
-
-        } else if (requestType == ReleaseRequestType.Activate) {
-            if (pendingServiceResource != null) {
-                if (activeServiceResource != null) {
-                    log.info("Releasing active resources: " + activeServiceResource.resourceSetId);
-
-                    resourceManager.releaseResourceSet(activeServiceResource.resourceSetId);
-                    serviceResourceDao.deleteServiceResource(serviceInstanceId, ServiceStatus.Active);
-                }
-
-                log.info("Updating the status of the pending record to active.");
-
-                serviceResourceDao.updateServiceStatus(serviceInstanceId, ServiceStatus.Pending, ServiceStatus.Active);
-            } else {
-                log.info("Pending record not found for service instance: " + serviceInstanceId + ". Nothing to do.");
-            }
-
-        } else if (requestType == ReleaseRequestType.Disconnect) {
-            if (pendingServiceResource != null) {
-                log.info("Releasing pending resources: " + pendingServiceResource.resourceSetId);
-
-                resourceManager.releaseResourceSet(pendingServiceResource.resourceSetId);
-                serviceResourceDao.deleteServiceResource(serviceInstanceId, ServiceStatus.Pending);
-            }
-            if (activeServiceResource != null) {
-                log.info("Releasing active resources: " + activeServiceResource.resourceSetId);
-
-                resourceManager.releaseResourceSet(activeServiceResource.resourceSetId);
-                serviceResourceDao.deleteServiceResource(serviceInstanceId, ServiceStatus.Active);
-            }
-        }
-
         return QueryStatus.SUCCESS;
     }
 
-    private QueryStatus allocateResourcesL3SDN(SvcLogicContext ctx, boolean checkOnly, String prefix)
-            throws SvcLogicException {
-        prefix = prefix == null ? "" : prefix + '.';
+    public AllocationStatus release(ResourceEntity sd) throws Exception {
 
-        String aicSiteId = getAicSiteId(ctx);
-        Map<String, Object> service = getServiceData(ctx);
+        if (sd.resourceEntityVersion != null) {
+            String resourceSet = sd.resourceEntityType + "::" + sd.resourceEntityId + "::" + sd.resourceEntityVersion;
+            log.info("Starting release for: " + resourceSet);
 
-        String requestTypeStr = ctx.getAttribute("tmp.resource-allocator.request-type");
-        if (requestTypeStr == null)
-            requestTypeStr = "New";
+            resourceManager.releaseResourceSet(resourceSet);
+        } else {
+            String resourceUnion = sd.resourceEntityType + "::" + sd.resourceEntityId;
+            log.info("Starting release for: " + resourceUnion);
 
-        ReserveRequestType requestType = null;
-        try {
-            requestType = ReserveRequestType.convert(requestTypeStr);
-        } catch (IllegalArgumentException e) {
-            throw new SvcLogicException("Invalid tmp.resource-allocator.request-type: " + requestTypeStr +
-                    ". Supported values are New, Change.");
+            resourceManager.releaseResourceUnion(resourceUnion);
         }
 
-        String serviceInstanceId = String.valueOf(service.get("service-instance-id"));
+        return AllocationStatus.Success;
 
-        ServiceResource activeServiceResource =
-                serviceResourceDao.getServiceResource(serviceInstanceId, ServiceStatus.Active);
-        ServiceResource pendingServiceResource =
-                serviceResourceDao.getServiceResource(serviceInstanceId, ServiceStatus.Pending);
+    }
 
-        log.info("Active ServiceResource: ");
-        StrUtil.info(log, activeServiceResource);
-        log.info("Pending ServiceResource: ");
-        StrUtil.info(log, pendingServiceResource);
+    private QueryStatus allocateResources(SvcLogicContext ctx, boolean checkOnly, String prefix)
+            throws SvcLogicException {
+        String serviceModel = getParam(ctx, "service-model", true, null);
+        String requestType = getParam(ctx, "request-type", false, "New");
 
-        ServiceResource sr = new ServiceResource();
-        sr.serviceInstanceId = serviceInstanceId;
-        sr.serviceStatus = ServiceStatus.Pending;
-        sr.serviceChangeNumber = 1;
-        if (pendingServiceResource != null)
-            sr.serviceChangeNumber = pendingServiceResource.serviceChangeNumber + 1;
-        else if (activeServiceResource != null)
-            sr.serviceChangeNumber = activeServiceResource.serviceChangeNumber + 1;
-        sr.resourceSetId = serviceInstanceId + "/" + sr.serviceChangeNumber;
-        sr.resourceUnionId = serviceInstanceId;
+        ResourceEntity sd = getResourceEntityData(ctx);
+        ResourceTarget rt = getResourceTargetData(ctx);
+        ResourceRequest rr = getResourceRequest(ctx);
 
-        log.info("New ServiceResource: ");
-        StrUtil.info(log, sr);
+        log.info("Starting reserve: " + requestType + ", service-model: " + serviceModel);
+        StrUtil.info(log, sd);
+        StrUtil.info(log, rt);
+        StrUtil.info(log, rr);
 
-        List<Map<String, Object>> vpePortData = vpePortDao.getVpePortData(aicSiteId);
-        List<Map<String, Object>> vplspePortData = vplspePortDao.getVplspePortData(aicSiteId);
-        List<Map<String, Object>> serverData = serverDao.getServerData(aicSiteId);
+        boolean change = requestType.equalsIgnoreCase("change");
 
-        vpePortData = orderVpe(vpePortData);
+        List<ResourceData> rlist = endPointAllocator.allocateResources(serviceModel, sd, rt, rr, checkOnly, change);
 
-        long maxAvailableSpeedVpePort = 0;
-        boolean vpePortFound = false;
+        if (rlist != null && !rlist.isEmpty()) {
+            setResourceDataInContext(ctx, prefix, rlist);
 
-        for (Map<String, Object> vpe : vpePortData) {
-            String vpeId = String.valueOf(vpe.get("vpe-id"));
-            String interfaceName = String.valueOf(vpe.get("physical-interface-name"));
-            String portId = vpeId + "/" + interfaceName;
-
-            log.info("Checking VPE port: " + portId);
-
-            String provStatus = String.valueOf(vpe.get("provisioning-status"));
-            if (!"PROV".equals(provStatus)) {
-                log.info("Skipping port " + portId + ": Provisioning status is not PROV.");
-                continue;
+            for (ResourceData rd : rlist) {
+                if (!rd.status.equals("Success")) {
+                    log.info("Capacity not found for: " + sd.resourceEntityType + "::" + sd.resourceEntityId);
+                    return QueryStatus.NOT_FOUND;
+                }
             }
+        }
+        return QueryStatus.SUCCESS;
+    }
 
-            String imageFile = String.valueOf(vpe.get("image-file-name"));
-            String endPointPosition = "VPE-Cust";
-            long maxPortSpeed = maxPortSpeedDao.getMaxPortSpeed(imageFile, endPointPosition, interfaceName);
-            vpe.put("max-port-speed", maxPortSpeed);
+    private AllocationStatus allocateResources(ResourceEntity sd, ResourceTarget rt, ResourceRequest rr,
+            List<ResourceResponse> rsList) throws Exception {
 
-            EquipmentData ed = new EquipmentData();
-            ed.data = vpe;
-            ed.equipmentId = portId;
-            ed.equipmentLevel = EquipmentLevel.Port;
+        String serviceModel = rr.serviceModel;
+        String requestType = rr.requestType == null ? "New" : rr.requestType;
 
-            ServiceData sd = new ServiceData();
-            sd.data = service;
-            sd.serviceModel = "L3SDN";
-            sd.endPointPosition = endPointPosition;
-            sd.resourceUnionId = sr.resourceUnionId;
-            sd.resourceSetId = sr.resourceSetId;
+        log.info("Starting reserve: " + requestType + ", service-model: " + serviceModel);
+        StrUtil.info(log, sd);
+        StrUtil.info(log, rt);
+        StrUtil.info(log, rr);
 
-            StrUtil.info(log, ed);
-            StrUtil.info(log, sd);
+        boolean change = requestType.equalsIgnoreCase("change");
 
-            AllocationRequest ar = allocationRequestBuilder.buildAllocationRequest(sd, ed, checkOnly,
-                    requestType == ReserveRequestType.Change);
-            AllocationOutcome ao = resourceManager.allocateResources(ar);
+        List<ResourceData> rlist = endPointAllocator.allocateResources(serviceModel, sd, rt, rr, rr.checkOnly, change);
 
-            if (ao.status == AllocationStatus.Success) {
+        if (rlist != null && !rlist.isEmpty()) {
+            setResourceDataInResponse(rlist, rsList);
 
-                // Assign affinity link
-                if (!checkOnly) {
-                    List<String> affinityLinkIdList = new ArrayList<>();
-                    affinityLinkIdList.add("0");
-                    affinityLinkIdList.add("1");
-                    affinityLinkIdList.add("2");
-                    affinityLinkIdList.add("3");
+            for (ResourceData rd : rlist) {
+                if (!rd.status.equals("Success")) {
+                    log.info("Capacity not found for: " + sd.resourceEntityType + "::" + sd.resourceEntityId);
+                    return AllocationStatus.ResourceNotFound;
+                }
+            }
+        }
 
-                    String preferedAffinityLinkId = "0";
-                    long lowestAssignedBw = Long.MAX_VALUE;
-                    for (String affinityLinkId : affinityLinkIdList) {
-                        long used = 0;
-                        String assetId = ed.equipmentId + "-" + affinityLinkId;
-                        Resource r = resourceManager.getResource("Bandwidth", assetId);
-                        if (r != null) {
-                            LimitResource ll = (LimitResource) r;
-                            used = ll.used;
-                        }
-                        if (used < lowestAssignedBw) {
-                            lowestAssignedBw = used;
-                            preferedAffinityLinkId = affinityLinkId;
-                        }
-                        log.info("Assigned bandwidth on affinity link: " + assetId + ": " + used);
+        return AllocationStatus.Success;
+    }
+
+    private void setResourceDataInResponse(List<ResourceData> rlist, List<ResourceResponse> rsList) {
+        for (ResourceData rd : emptyIfNull(rlist)) {
+            ResourceResponse res = new ResourceResponse();
+            res.resourceName = rd.resourceName;
+            res.endPointPosition = rd.endPointPosition;
+            res.resourceTargetId = rd.resourceTargetId;
+            res.resourceTargetType = rd.resourceTargetType;
+            res.status = rd.status;
+            if (rd.data != null && !rd.data.isEmpty()) {
+                for (String kk : rd.data.keySet()) {
+                    if (kk.equalsIgnoreCase("allocated")) {
+                        res.resourceAllocated = String.valueOf(rd.data.get(kk));
                     }
 
-                    log.info("Prefered affinity link for " + ed.equipmentId + ": " + preferedAffinityLinkId);
+                    if (kk.equalsIgnoreCase("used")) {
+                        res.resourceUsed = String.valueOf(rd.data.get(kk));
+                    }
 
-                    ctx.setAttribute(prefix + "affinity-link", preferedAffinityLinkId);
+                    if (kk.equalsIgnoreCase("available")) {
+                        res.resourceAvailable = String.valueOf(rd.data.get(kk));
+                    }
 
-                    LimitAllocationRequest ar1 = new LimitAllocationRequest();
-                    ar1.resourceSetId = sd.resourceSetId;
-                    ar1.resourceUnionId = sd.resourceUnionId;
-                    ar1.resourceShareGroupList = null;
-                    ar1.resourceName = "Bandwidth";
-                    ar1.assetId = ed.equipmentId + "-" + preferedAffinityLinkId;
-                    ar1.missingResourceAction = AllocationAction.Succeed_Allocate;
-                    ar1.expiredResourceAction = AllocationAction.Succeed_Allocate;
-                    ar1.replace = true;
-                    ar1.strict = false;
-                    ar1.checkLimit = Long.MAX_VALUE;
-                    ar1.checkCount = 0;
-                    ar1.allocateCount = (Long) sd.data.get("service-speed-kbps");
+                    if (kk.equalsIgnoreCase("limit")) {
+                        res.resourceLimit = String.valueOf(rd.data.get(kk));
+                    }
 
-                    resourceManager.allocateResources(ar1);
                 }
-
-                ctx.setAttribute(prefix + "vpe-name", vpeId);
-
-                vpePortFound = true;
-                break;
             }
-
-            if (ao instanceof LimitAllocationOutcome) {
-                LimitAllocationOutcome lao = (LimitAllocationOutcome) ao;
-                long available = lao.limit - lao.used;
-                if (available > maxAvailableSpeedVpePort)
-                    maxAvailableSpeedVpePort = available;
-            }
+            rsList.add(res);
         }
 
-        long maxAvailableSpeedVplspePort = 0;
-        boolean vplspePortFound = false;
+    }
 
-        for (Map<String, Object> vplspe : vplspePortData) {
-            String vplspeId = String.valueOf(vplspe.get("vplspe-id"));
-            String interfaceName = String.valueOf(vplspe.get("physical-interface-name"));
-            String portId = vplspeId + "/" + interfaceName;
+    public static <T> Iterable<T> emptyIfNull(Iterable<T> iterable) {
+        return iterable == null ? Collections.<T>emptyList() : iterable;
+    }
 
-            log.info("Checking VPLSPE port: " + portId);
+    private void setAttr(SvcLogicContext ctx, String name, String value) {
+        ctx.setAttribute(name, value);
+        log.info("Added context attr: " + name + ": " + value);
+    }
 
-            String provStatus = String.valueOf(vplspe.get("provisioning-status"));
-            if (!"PROV".equals(provStatus)) {
-                log.info("Skipping port " + portId + ": Provisioning status is not PROV.");
-                continue;
-            }
+    private ResourceEntity getResourceEntityData(SvcLogicContext ctx) throws SvcLogicException {
+        ResourceEntity sd = new ResourceEntity();
+        sd.resourceEntityId = getParam(ctx,
+                new String[] {"service-instance-id", "reservation-entity-id", "resource-entity-id"}, true, null);
+        sd.resourceEntityType =
+                getParam(ctx, new String[] {"reservation-entity-type", "resource-entity-type"}, true, null);
+        sd.resourceEntityVersion =
+                getParam(ctx, new String[] {"reservation-entity-version", "resource-entity-version"}, false, "1");
+        sd.data = getDataParam(ctx, "reservation-entity-data", "resource-entity-data", "service-data");
+        return sd;
+    }
 
-            long physicalSpeed = (Long) vplspe.get("physical-interface-speed");
-            String physicalSpeedUnit = String.valueOf(vplspe.get("physical-interface-speed-unit"));
-            long maxPortSpeed = speedUtil.convertToKbps(physicalSpeed, physicalSpeedUnit);
-            vplspe.put("max-port-speed", maxPortSpeed);
+    private ResourceTarget getResourceTargetData(SvcLogicContext ctx) throws SvcLogicException {
+        ResourceTarget sd = new ResourceTarget();
+        sd.resourceTargetId = getParam(ctx, new String[] {"reservation-target-id", "resource-target-id"}, true, null);
+        sd.resourceTargetType =
+                getParam(ctx, new String[] {"reservation-target-type", "resource-target-type"}, true, null);
+        sd.data = getDataParam(ctx, "reservation-target-data", "resource-target-data", "equipment-data");
+        return sd;
+    }
 
-            EquipmentData ed = new EquipmentData();
-            ed.data = vplspe;
-            ed.equipmentId = portId;
-            ed.equipmentLevel = EquipmentLevel.Port;
+    private ResourceRequest getResourceRequest(SvcLogicContext ctx) throws SvcLogicException {
+        ResourceRequest rr = new ResourceRequest();
+        rr.resourceName = getParam(ctx, "resource-name", false, null);
+        rr.resourceShareGroup = getParam(ctx, "resource-share-group", false, null);
+        rr.rangeRequestedNumbers = getParam(ctx, "range-requested-numbers", false, null);
+        rr.rangeExcludeNumbers = getParam(ctx, "range-exclude-numbers", false, null);
+        String rangeReverseOrderStr = getParam(ctx, "range-reverse-order", false, "false");
+        rr.rangeReverseOrder = Boolean.parseBoolean(rangeReverseOrderStr);
+        String rangeMinOverrideStr = getParam(ctx, "range-min-override", false, "-1");
+        rr.rangeMinOverride = Integer.parseInt(rangeMinOverrideStr);
+        String rangeMaxOverrideStr = getParam(ctx, "range-max-override", false, "-1");
+        rr.rangeMaxOverride = Integer.parseInt(rangeMaxOverrideStr);
+        String replaceStr = getParam(ctx, "replace", false, "true");
+        rr.replace = Boolean.parseBoolean(replaceStr);
+        rr.applicationId = getParam(ctx, "application-id", false, "SDNC");
+        rr.endPointPosition = getParam(ctx, "endpoint-position", false, null);
+        return rr;
+    }
 
-            ServiceData sd = new ServiceData();
-            sd.data = service;
-            sd.serviceModel = "L3SDN";
-            sd.endPointPosition = "IPAG-TOA";
-            sd.resourceUnionId = sr.resourceUnionId;
-            sd.resourceSetId = sr.resourceSetId;
-
-            StrUtil.info(log, ed);
-            StrUtil.info(log, sd);
-
-            AllocationRequest ar = allocationRequestBuilder.buildAllocationRequest(sd, ed, checkOnly,
-                    requestType == ReserveRequestType.Change);
-            AllocationOutcome ao = resourceManager.allocateResources(ar);
-
-            if (ao.status == AllocationStatus.Success) {
-                vplspePortFound = true;
-                break;
-            }
-
-            if (ao instanceof LimitAllocationOutcome) {
-                LimitAllocationOutcome lao = (LimitAllocationOutcome) ao;
-                long available = lao.limit - lao.used;
-                if (available > maxAvailableSpeedVplspePort)
-                    maxAvailableSpeedVplspePort = available;
+    private String getParam(SvcLogicContext ctx, String name, boolean required, String def) throws SvcLogicException {
+        String v = null;
+        for (String p : INPUT_PREFIX) {
+            v = ctx.getAttribute(p + name);
+            if (v != null && v.trim().length() > 0) {
+                log.info("Param: " + name + ": " + v.trim());
+                return v.trim();
             }
         }
+        if (required) {
+            throw new SvcLogicException("The following variable is required in DG context: " + name);
+        }
 
-        long maxAvailableSpeedServer = 0;
-        boolean serverFound = false;
+        log.info("Param: " + name + " not supplied. Using default: " + def);
+        return def;
+    }
 
-        for (Map<String, Object> server : serverData) {
-            String serverId = String.valueOf(server.get("server-id"));
-            String serverModel = String.valueOf(server.get("server-model"));
+    private String getParam(SvcLogicContext ctx, String[] names, boolean required, String def)
+            throws SvcLogicException {
+        String v = null;
+        for (String name : names) {
+            v = getParam(ctx, name, false, def);
+            if (v != null) {
+                return v;
+            }
+        }
+        if (required) {
+            throw new SvcLogicException(
+                    "One of the following variable is required in DG context: " + Arrays.deepToString(names));
+        }
 
-            log.info("Checking Server: " + serverId);
+        log.info("Param: " + names + " not supplied. Using default: " + def);
+        return def;
+    }
 
-            String endPointPosition = "VCE-Cust";
+    private Map<String, String> getDataParam(SvcLogicContext ctx, String... names) {
+        Map<String, String> data = new HashMap<>();
+        Set<String> ctxNames = ctx.getAttributeKeySet();
+        for (String n : ctxNames) {
+            for (String p : INPUT_PREFIX) {
+                for (String name : names) {
+                    String pp = p + name + '.';
+                    if (n.startsWith(pp)) {
+                        String nn = n.substring(pp.length());
+                        String vv = ctx.getAttribute(n);
+                        data.put(nn, vv);
 
-            int serverCount = (Integer) server.get("server-count");
-            if (serverCount == 0)
-                serverCount = 1;
-            String ratioString = parameterDao.getParameter("homing.pserver.sparing.ratio");
-            if (ratioString == null || ratioString.length() == 0)
-                ratioString = "1:1";
-            int primaryServerCount = calculatePrimaryServerCount(serverCount, ratioString);
-            server.put("number-primary-servers", primaryServerCount);
+                        log.info("Data param: " + nn + ": " + vv);
 
-            int evcCount = getEvcCountOnServer(serverId);
-            int evcCountPerServer = (evcCount + primaryServerCount - 1) / primaryServerCount;
-            long maxServerSpeed = maxServerSpeedDao.getMaxServerSpeed(serverModel, evcCountPerServer);
-            server.put("max-server-speed", maxServerSpeed);
-            server.put("evc-count", evcCount);
-            server.put("evc-count-per-server", evcCountPerServer);
+                        if (ctxNames.contains(n + "-unit")) {
+                            try {
+                                long v = Long.parseLong(vv);
+                                String unit = ctx.getAttribute(n + "-unit");
+                                long kbps = speedUtil.convertToKbps(v, unit);
+                                long mbps = speedUtil.convertToMbps(v, unit);
+                                data.put(nn + "-kbps", String.valueOf(kbps));
+                                data.put(nn + "-mbps", String.valueOf(mbps));
 
-            EquipmentData ed = new EquipmentData();
-            ed.data = server;
-            ed.equipmentId = serverId;
-            ed.equipmentLevel = EquipmentLevel.Server;
+                                log.info("Data param: " + nn + "-kbps: " + kbps);
+                                log.info("Data param: " + nn + "-mbps: " + mbps);
 
-            ServiceData sd = new ServiceData();
-            sd.data = service;
-            sd.serviceModel = "L3SDN";
-            sd.endPointPosition = endPointPosition;
-            sd.resourceUnionId = sr.resourceUnionId;
-            sd.resourceSetId = sr.resourceSetId;
-
-            StrUtil.info(log, ed);
-            StrUtil.info(log, sd);
-
-            AllocationRequest ar = allocationRequestBuilder.buildAllocationRequest(sd, ed, checkOnly,
-                    requestType == ReserveRequestType.Change);
-            AllocationOutcome ao = resourceManager.allocateResources(ar);
-
-            if (ao.status == AllocationStatus.Success) {
-                serverFound = true;
-
-                if (ao instanceof MultiResourceAllocationOutcome) {
-                    MultiResourceAllocationOutcome mrao = (MultiResourceAllocationOutcome) ao;
-                    for (AllocationOutcome ao1 : mrao.allocationOutcomeList) {
-                        if (ao1 instanceof LimitAllocationOutcome) {
-                            LimitAllocationOutcome lao = (LimitAllocationOutcome) ao1;
-                            if ("Bandwidth".equals(lao.request.resourceName)) {
-                                ThresholdStatus th = allocationRequestBuilder.getThresholdStatus(sd, ed, lao);
-                                setThresholdData(ctx, th, sd, ed);
+                            } catch (Exception e) {
+                                log.warn("Invalid number for " + n + ": " + vv);
                             }
                         }
                     }
                 }
-
-                break;
-            }
-
-            if (ao instanceof MultiResourceAllocationOutcome) {
-                MultiResourceAllocationOutcome mrao = (MultiResourceAllocationOutcome) ao;
-                for (AllocationOutcome ao1 : mrao.allocationOutcomeList) {
-                    if (ao1 instanceof LimitAllocationOutcome) {
-                        LimitAllocationOutcome lao = (LimitAllocationOutcome) ao1;
-                        if (lao.status == AllocationStatus.Failure && "Bandwidth".equals(lao.request.resourceName)) {
-                            long available = lao.limit - lao.used;
-                            if (available > maxAvailableSpeedServer)
-                                maxAvailableSpeedServer = available;
-                        }
-                        if (lao.status == AllocationStatus.Failure && "Connection".equals(lao.request.resourceName)) {
-                            maxAvailableSpeedServer = 0;
-                            break;
-                        }
-
-                        ThresholdStatus th = allocationRequestBuilder.getThresholdStatus(sd, ed, lao);
-                        setThresholdData(ctx, th, sd, ed);
-                    }
-                }
             }
         }
-
-        if (vpePortFound && vplspePortFound && serverFound) {
-            if (!checkOnly) {
-                if (pendingServiceResource == null) {
-                    log.info("Adding the pending service resource record to DB.");
-                    serviceResourceDao.addServiceResource(sr);
-                } else {
-                    log.info("Releasing previously allocated resources for resource set id: " +
-                            pendingServiceResource.resourceSetId);
-                    resourceManager.releaseResourceSet(pendingServiceResource.resourceSetId);
-
-                    log.info("Updating the pending service resource record in DB with service change number: " +
-                            sr.serviceChangeNumber);
-                    serviceResourceDao.updateServiceResource(sr);
-                }
-            }
-
-            return QueryStatus.SUCCESS;
-        }
-
-        log.info("Releasing allocated resources (if any) for resource set id: " + sr.resourceSetId);
-        resourceManager.releaseResourceSet(sr.resourceSetId);
-
-        long maxAvailableSpeed = Long.MAX_VALUE;
-        if (!vpePortFound && maxAvailableSpeedVpePort < maxAvailableSpeed)
-            maxAvailableSpeed = maxAvailableSpeedVpePort;
-        if (!vplspePortFound && maxAvailableSpeedVplspePort < maxAvailableSpeed)
-            maxAvailableSpeed = maxAvailableSpeedVplspePort;
-        if (!serverFound && maxAvailableSpeedServer < maxAvailableSpeed)
-            maxAvailableSpeed = maxAvailableSpeedServer;
-
-        setOutputContext(ctx, maxAvailableSpeed, "kbps");
-        return QueryStatus.NOT_FOUND;
-    }
-
-    private List<Map<String, Object>> orderVpe(List<Map<String, Object>> vpePortData) {
-        for (Map<String, Object> vpe : vpePortData) {
-            String vpeId = String.valueOf(vpe.get("vpe-id"));
-            String interfaceName = String.valueOf(vpe.get("physical-interface-name"));
-            String portId = vpeId + "/" + interfaceName;
-            Resource r = resourceManager.getResource("Bandwidth", portId);
-            long used = 0;
-            if (r != null) {
-                LimitResource ll = (LimitResource) r;
-                used = ll.used;
-            }
-            vpe.put("used-bandwidth", used);
-
-            log.info("Used bandwidth on VPE: " + vpeId + ": " + used);
-        }
-
-        Collections.sort(vpePortData, new Comparator<Map<String, Object>>() {
-
-            @Override
-            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
-                long used1 = (Long) o1.get("used-bandwidth");
-                long used2 = (Long) o2.get("used-bandwidth");
-                if (used1 < used2)
-                    return -1;
-                if (used1 > used2)
-                    return 1;
-                return 0;
-            }
-        });
-
-        return vpePortData;
-    }
-
-    private void setThresholdData(SvcLogicContext ctx, ThresholdStatus th, ServiceData sd, EquipmentData ed) {
-        if (th == null)
-            return;
-
-        String pp = "tmp.resource-allocator-output.threshold-notification-list.threshold-hotification[0].";
-        ctx.setAttribute("tmp.resource-allocator-output.threshold-notification-list.threshold-hotification_length",
-                "1");
-        ctx.setAttribute(pp + "message", th.resourceThreshold.message);
-        ctx.setAttribute(pp + "resource-rule.service-model", th.resourceRule.serviceModel);
-        ctx.setAttribute(pp + "resource-rule.endpoint-position", th.resourceRule.endPointPosition);
-        ctx.setAttribute(pp + "resource-rule.resource-name", th.resourceRule.resourceName);
-        ctx.setAttribute(pp + "resource-rule.equipment-level", th.resourceRule.equipmentLevel);
-        ctx.setAttribute(pp + "resource-rule.soft-limit-expression", th.resourceRule.softLimitExpression);
-        ctx.setAttribute(pp + "resource-rule.hard-limit-expression", th.resourceRule.hardLimitExpression);
-        ctx.setAttribute(pp + "resource-state.used", String.valueOf(th.used));
-        ctx.setAttribute(pp + "resource-state.limit-value", String.valueOf(th.limitValue));
-        ctx.setAttribute(pp + "resource-state.threshold-value", String.valueOf(th.thresholdValue));
-        ctx.setAttribute(pp + "resource-state.last-added", String.valueOf(th.lastAdded));
-        ctx.setAttribute(pp + "equipment-data.equipment-id", ed.equipmentId);
-        for (String edKey : ed.data.keySet())
-            ctx.setAttribute(pp + "equipment-data." + edKey, String.valueOf(ed.data.get(edKey)));
-    }
-
-    private QueryStatus allocateResources(String serviceModel, SvcLogicContext ctx, boolean checkOnly, String prefix)
-            throws SvcLogicException {
-        prefix = prefix == null ? "" : prefix + '.';
-
-        Map<String, Object> service = getServiceData(ctx);
-        Map<String, Object> ec = getEquipConstraints(ctx);
-
-        String requestTypeStr = ctx.getAttribute("tmp.resource-allocator.request-type");
-        if (requestTypeStr == null)
-            requestTypeStr = "New";
-
-        ReserveRequestType requestType = null;
-        try {
-            requestType = ReserveRequestType.convert(requestTypeStr);
-        } catch (IllegalArgumentException e) {
-            throw new SvcLogicException("Invalid tmp.resource-allocator.request-type: " + requestTypeStr +
-                    ". Supported values are New, Change.");
-        }
-
-        String serviceInstanceId = String.valueOf(service.get("service-instance-id"));
-
-        log.info("Starting reserve: " + requestType + ", service-instance-id: " + serviceInstanceId);
-
-        ServiceResource activeServiceResource =
-                serviceResourceDao.getServiceResource(serviceInstanceId, ServiceStatus.Active);
-        ServiceResource pendingServiceResource =
-                serviceResourceDao.getServiceResource(serviceInstanceId, ServiceStatus.Pending);
-
-        log.info("Active ServiceResource: ");
-        StrUtil.info(log, activeServiceResource);
-        log.info("Pending ServiceResource: ");
-        StrUtil.info(log, pendingServiceResource);
-
-        int changeNumber = 1;
-        if (pendingServiceResource != null)
-            changeNumber = pendingServiceResource.serviceChangeNumber + 1;
-        else if (activeServiceResource != null)
-            changeNumber = activeServiceResource.serviceChangeNumber + 1;
-
-        ServiceData sd = new ServiceData();
-        sd.data = service;
-        sd.serviceModel = serviceModel;
-        sd.endPointPosition = (String) service.get("end-point-position");
-        sd.resourceShareGroup = (String) service.get("resource-share-group");
-        sd.resourceName = (String) service.get("resource-name");
-        sd.serviceInstanceId = serviceInstanceId;
-
-        StrUtil.info(log, sd);
-
-        List<EndPointData> epList = endPointAllocator.allocateEndPoints(sd, ec, checkOnly,
-                requestType == ReserveRequestType.Change, changeNumber);
-
-        if (epList != null && !epList.isEmpty()) {
-            if (!checkOnly) {
-                EndPointData ep = epList.get(0);
-
-                if (sd.resourceName == null) {
-                ServiceResource sr = new ServiceResource();
-                sr.serviceInstanceId = serviceInstanceId;
-                sr.serviceStatus = ServiceStatus.Pending;
-                sr.serviceChangeNumber = changeNumber;
-                sr.resourceSetId = ep.resourceSetId;
-                sr.resourceUnionId = ep.resourceUnionId;
-
-                log.info("New ServiceResource: ");
-                StrUtil.info(log, sr);
-
-                if (pendingServiceResource == null) {
-                    log.info("Adding the pending service resource record to DB.");
-                    serviceResourceDao.addServiceResource(sr);
-                } else {
-                    log.info("Releasing previously allocated resources for resource set id: " +
-                            pendingServiceResource.resourceSetId);
-                    resourceManager.releaseResourceSet(pendingServiceResource.resourceSetId);
-
-                    log.info("Updating the pending service resource record in DB with service change number: " +
-                            sr.serviceChangeNumber);
-                    serviceResourceDao.updateServiceResource(sr);
-                }
-            }
-
-                for (EndPointData ep1 : epList)
-                    if (ep1.data != null && !ep1.data.isEmpty())
-                        for (String key : ep1.data.keySet()) {
-                            String value = String.valueOf(ep1.data.get(key));
-                            ctx.setAttribute(prefix + key, value);
-
-                            log.info("Added context attr: " + prefix + key + ": " + value);
-                        }
-            }
-
-            return QueryStatus.SUCCESS;
-        }
-
-        log.info("Capacity not found for EVC: " + serviceInstanceId);
-
-        return QueryStatus.NOT_FOUND;
-    }
-
-    private int getEvcCountOnServer(String serverId) {
-        LimitResource l = (LimitResource) resourceManager.getResource("Connection", serverId);
-        if (l != null)
-            return (int) l.used;
-        return 0;
-    }
-
-    private String getAicSiteId(SvcLogicContext ctx) throws SvcLogicException {
-        String aicSiteId = ctx.getAttribute("tmp.resource-allocator.aic-site-id");
-        if (aicSiteId == null)
-            throw new SvcLogicException("tmp.resource-allocator.aic-site-id is required in ResourceAllocator");
-        return aicSiteId;
-    }
-
-    private Map<String, Object> getServiceData(SvcLogicContext ctx) throws SvcLogicException {
-        Map<String, Object> sd = new HashMap<String, Object>();
-
-        String endPointPosition = ctx.getAttribute("tmp.resource-allocator.end-point-position");
-        if (endPointPosition != null && endPointPosition.trim().length() > 0)
-            sd.put("end-point-position", endPointPosition.trim());
-
-        String resourceName = ctx.getAttribute("tmp.resource-allocator.resource-name");
-        if (resourceName != null && resourceName.trim().length() > 0)
-            sd.put("resource-name", resourceName.trim());
-
-        String resourceShareGroup = ctx.getAttribute("tmp.resource-allocator.resource-share-group");
-        if (resourceShareGroup != null && resourceShareGroup.trim().length() > 0)
-            sd.put("resource-share-group", resourceShareGroup.trim());
-
-        String serviceInstanceId = ctx.getAttribute("tmp.resource-allocator.service-instance-id");
-        if (serviceInstanceId == null)
-            serviceInstanceId = "checkServiceInstance";
-        sd.put("service-instance-id", serviceInstanceId);
-
-        String speedStr = ctx.getAttribute("tmp.resource-allocator.speed");
-        if (speedStr != null && speedStr.trim().length() > 0) {
-        long speed = 0;
-        try {
-            speed = Long.parseLong(speedStr);
-        } catch (NumberFormatException e) {
-            throw new SvcLogicException("Invalid tmp.resource-allocator.speed. Must be a number.");
-        }
-        String unit = ctx.getAttribute("tmp.resource-allocator.speed-unit");
-        if (unit == null || unit.trim().length() == 0)
-            throw new SvcLogicException("tmp.resource-allocator.speed-unit is required in ResourceAllocator");
-        long serviceSpeedKbps = speedUtil.convertToKbps(speed, unit);
-
-        sd.put("service-speed-kbps", serviceSpeedKbps);
-        }
-
-        String vpnId = ctx.getAttribute("tmp.resource-allocator.vpn-id");
-        if (vpnId != null && vpnId.trim().length() > 0)
-            sd.put("vpn-id", vpnId.trim());
-
-        String vpnIdList = ctx.getAttribute("tmp.resource-allocator.vpn-id-list");
-        if (vpnIdList != null && vpnIdList.trim().length() > 0)
-            sd.put("vpn-id-list", vpnIdList.trim());
-
-        String vrfName = ctx.getAttribute("tmp.resource-allocator.vrf-name");
-        if (vrfName != null && vrfName.trim().length() > 0)
-            sd.put("vrf-name", vrfName.trim());
-
-        String vrfNameList = ctx.getAttribute("tmp.resource-allocator.vrf-name-list");
-        if (vrfNameList != null && vrfNameList.trim().length() > 0)
-            sd.put("vrf-name-list", vrfNameList.trim());
-
-        String v4multicast = ctx.getAttribute("tmp.resource-allocator.v4-multicast");
-        if (v4multicast != null && v4multicast.trim().length() > 0)
-            sd.put("v4-multicast", v4multicast.trim());
-
-        String v6multicast = ctx.getAttribute("tmp.resource-allocator.v6-multicast");
-        if (v6multicast != null && v6multicast.trim().length() > 0)
-            sd.put("v6-multicast", v6multicast.trim());
-
-        String v4ServingSite = ctx.getAttribute("tmp.resource-allocator.v4-serving-site");
-        if (v4ServingSite != null && v4ServingSite.trim().length() > 0)
-            sd.put("v4-serving-site", v4ServingSite.trim());
-
-        String v6ServingSite = ctx.getAttribute("tmp.resource-allocator.v6-serving-site");
-        if (v6ServingSite != null && v6ServingSite.trim().length() > 0)
-            sd.put("v6-serving-site", v6ServingSite.trim());
-
-        return sd;
-    }
-
-    private Map<String, Object> getEquipConstraints(SvcLogicContext ctx) throws SvcLogicException {
-        Map<String, Object> mm = new HashMap<String, Object>();
-
-        String vrfRequired = ctx.getAttribute("tmp.resource-allocator.vrf-required");
-        if (vrfRequired != null && vrfRequired.trim().length() > 0)
-            mm.put("vrf-required", vrfRequired.trim());
-
-        String clli = ctx.getAttribute("tmp.resource-allocator.clli");
-        if (clli == null || clli.trim().length() == 0)
-            clli = ctx.getAttribute("tmp.resource-allocator.aic-site-id");
-        if (clli != null) {
-        mm.put("clli", clli.trim());
-            mm.put("aic-site-id", clli.trim());
-        }
-
-        String vpeName = ctx.getAttribute("tmp.resource-allocator.vpe-name");
-        if (vpeName != null && vpeName.trim().length() > 0)
-            mm.put("vpe-name", vpeName.trim());
-
-        String vnfName = ctx.getAttribute("tmp.resource-allocator.device-name");
-        if (vnfName != null && vnfName.trim().length() > 0)
-            mm.put("vnf-name", vnfName.trim());
-
-        String excludeVpeList = ctx.getAttribute("tmp.resource-allocator.exclude-vpe-list");
-        if (excludeVpeList != null && excludeVpeList.trim().length() > 0)
-            mm.put("exclude-vpe-list", excludeVpeList.trim());
-
-        String uplinkCircuitCountStr =
-                ctx.getAttribute("tmp.resource-allocator.uplink-circuit-list.uplink-circuit_length");
-        if (uplinkCircuitCountStr != null) {
-            long uplinkCircuitCount = 0;
-            try {
-                uplinkCircuitCount = Long.parseLong(uplinkCircuitCountStr);
-            } catch (NumberFormatException e) {
-                throw new SvcLogicException(
-                        "Invalid tmp.resource-allocator.uplink-circuit-list.uplink-circuit_length. Must be a number.");
-            }
-            List<Map<String, Object>> uplinkCircuitList = new ArrayList<>();
-            for (int i = 0; i < uplinkCircuitCount; i++) {
-                String uplinkCircuitId = ctx.getAttribute(
-                        "tmp.resource-allocator.uplink-circuit-list.uplink-circuit[" + i + "].uplink-circuit-id");
-                String uplinkCircuitBandwidthStr =
-                        ctx.getAttribute("tmp.resource-allocator.uplink-circuit-list.uplink-circuit[" + i +
-                                "].uplink-circuit-bandwidth");
-                String uplinkCircuitBandwidthUnit =
-                        ctx.getAttribute("tmp.resource-allocator.uplink-circuit-list.uplink-circuit[" + i +
-                                "].uplink-circuit-bandwidth-unit");
-
-                long uplinkCircuitBandwidth = 0;
-                try {
-                    uplinkCircuitBandwidth = Long.parseLong(uplinkCircuitBandwidthStr);
-                } catch (NumberFormatException e) {
-                    throw new SvcLogicException("Invalid tmp.resource-allocator.uplink-circuit-list.uplink-circuit[" +
-                            i + "].uplink-circuit-id. Must be a number.");
-                }
-
-                long uplinkCircuitBandwidthKbps =
-                        speedUtil.convertToKbps(uplinkCircuitBandwidth, uplinkCircuitBandwidthUnit);
-
-                Map<String, Object> uplinkCircuit = new HashMap<String, Object>();
-                uplinkCircuit.put("uplink-circuit-id", uplinkCircuitId);
-                uplinkCircuit.put("uplink-circuit-bandwidth", uplinkCircuitBandwidthKbps);
-                uplinkCircuitList.add(uplinkCircuit);
-            }
-            mm.put("uplink-circuit-list", uplinkCircuitList);
-        }
-
-        return mm;
-    }
-
-    private void setOutputContext(SvcLogicContext ctx, long maxAvailableSpeed, String unit) {
-        ctx.setAttribute("tmp.resource-allocator-output.max-available-speed", String.valueOf(maxAvailableSpeed));
-        ctx.setAttribute("tmp.resource-allocator-output.speed-unit", unit);
-    }
-
-    private int calculatePrimaryServerCount(int serverCount, String ratioString) throws SvcLogicException {
-        String[] ss = ratioString.split(":");
-        if (ss.length != 2)
-            throw new SvcLogicException("Invalid value for homing.pserver.sparing.ratio: " + ratioString);
-
-        int n = 1, m = 1;
-        try {
-            n = Integer.parseInt(ss[0]);
-            m = Integer.parseInt(ss[1]);
-        } catch (Exception e) {
-            throw new SvcLogicException("Invalid value for homing.pserver.sparing.ratio: " + ratioString);
-        }
-
-        return (serverCount - 1) * n / (n + m) + 1;
-    }
-
-    public void setServerDao(ServerDao serverDao) {
-        this.serverDao = serverDao;
-    }
-
-    public void setVpePortDao(VpePortDao vpePortDao) {
-        this.vpePortDao = vpePortDao;
-    }
-
-    public void setVplspePortDao(VplspePortDao vplspePortDao) {
-        this.vplspePortDao = vplspePortDao;
-    }
-
-    public void setMaxPortSpeedDao(MaxPortSpeedDao maxPortSpeedDao) {
-        this.maxPortSpeedDao = maxPortSpeedDao;
-    }
-
-    public void setMaxServerSpeedDao(MaxServerSpeedDao maxServerSpeedDao) {
-        this.maxServerSpeedDao = maxServerSpeedDao;
-    }
-
-    public void setAllocationRequestBuilder(AllocationRequestBuilder allocationRequestBuilder) {
-        this.allocationRequestBuilder = allocationRequestBuilder;
+        return data;
     }
 
     public void setResourceManager(ResourceManager resourceManager) {
         this.resourceManager = resourceManager;
     }
 
-    public void setSpeedUtil(SpeedUtil speedUtil) {
-        this.speedUtil = speedUtil;
-    }
-
-    public void setServiceResourceDao(ServiceResourceDao serviceResourceDao) {
-        this.serviceResourceDao = serviceResourceDao;
-    }
-
     public void setEndPointAllocator(EndPointAllocator endPointAllocator) {
         this.endPointAllocator = endPointAllocator;
     }
 
-    public void setParameterDao(ParameterDao parameterDao) {
-        this.parameterDao = parameterDao;
+    public void setSpeedUtil(SpeedUtil speedUtil) {
+        this.speedUtil = speedUtil;
     }
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/AffinityAllocationRule.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/AffinityAllocationRule.java
deleted file mode 100644
index 0da7acb..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/AffinityAllocationRule.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.alloc;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.AllocationRule;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationAction;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationRequest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AffinityAllocationRule implements AllocationRule {
-
-    @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(AffinityAllocationRule.class);
-
-    @Override
-    public AllocationRequest buildAllocationRequest(
-            String resourceUnionId,
-            String resourceSetId,
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        String affinityLink = (String) equipmentData.data.get("affinity-link");
-        if (affinityLink == null)
-            affinityLink = "1";
-
-        long serviceSpeed = (Long) serviceData.data.get("service-speed-kbps");
-
-        LimitAllocationRequest ar = new LimitAllocationRequest();
-        ar.resourceSetId = resourceSetId;
-        ar.resourceUnionId = resourceUnionId;
-        ar.resourceShareGroupList = null;
-        ar.resourceName = "Bandwidth";
-        ar.assetId = equipmentData.equipmentId + "-" + affinityLink;
-        ar.missingResourceAction = AllocationAction.Succeed_Allocate;
-        ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
-        ar.replace = true;
-        ar.strict = false;
-        ar.checkLimit = Long.MAX_VALUE;
-        ar.checkCount = 0;
-        ar.allocateCount = serviceSpeed;
-        return ar;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/DbAllocationRule.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/DbAllocationRule.java
index a0b698d..e9f6e0d 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/DbAllocationRule.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/DbAllocationRule.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * 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.
@@ -24,10 +24,10 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
 import org.onap.ccsdk.sli.adaptors.ra.comp.AllocationRule;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceEntity;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceRequest;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceTarget;
 import org.onap.ccsdk.sli.adaptors.ra.rule.dao.RangeRuleDao;
 import org.onap.ccsdk.sli.adaptors.ra.rule.dao.ResourceRuleDao;
 import org.onap.ccsdk.sli.adaptors.ra.rule.data.RangeRule;
@@ -44,112 +44,127 @@
 
 public class DbAllocationRule implements AllocationRule {
 
-    private static final Logger log = LoggerFactory.getLogger(DbAllocationRule.class);
+	private static final Logger log = LoggerFactory.getLogger(DbAllocationRule.class);
 
-    private ResourceRuleDao resourceRuleDao;
-    private RangeRuleDao rangeRuleDao;
+	private ResourceRuleDao resourceRuleDao;
+	private RangeRuleDao rangeRuleDao;
 
-    @Override
-    public AllocationRequest buildAllocationRequest(
-            String resourceUnionId,
-            String resourceSetId,
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        List<ResourceRule> resourceRuleList = resourceRuleDao.getResourceRules(serviceData.serviceModel,
-                endPointPosition, equipmentData.equipmentLevel);
-        List<RangeRule> rangeRuleList =
-                rangeRuleDao.getRangeRules(serviceData.serviceModel, endPointPosition, equipmentData.equipmentLevel);
+	@Override
+	public AllocationRequest buildAllocationRequest(String serviceModel, ResourceEntity resourceEntity,
+			ResourceTarget resourceTarget, ResourceRequest resourceRequest, boolean checkOnly, boolean change) {
+		List<ResourceRule> resourceRuleList = resourceRuleDao.getResourceRules(serviceModel,
+				resourceTarget.resourceTargetType);
+		List<RangeRule> rangeRuleList = rangeRuleDao.getRangeRules(serviceModel, resourceTarget.resourceTargetType);
 
-        List<AllocationRequest> arlist = new ArrayList<AllocationRequest>();
+		List<AllocationRequest> arlist = new ArrayList<>();
 
-        for (ResourceRule rr : resourceRuleList) {
-            if (serviceData.resourceName != null && !serviceData.resourceName.equals(rr.resourceName))
-                continue;
-            AllocationRequest ar1 = buildAllocationRequest(rr, resourceUnionId, resourceSetId, serviceData,
-                    equipmentData, checkOnly, change);
-            arlist.add(ar1);
-        }
-        for (RangeRule rr : rangeRuleList) {
-            if (serviceData.resourceName != null && !serviceData.resourceName.equals(rr.rangeName))
-                continue;
-            AllocationRequest ar1 = buildAllocationRequest(rr, resourceUnionId, resourceSetId, serviceData,
-                    equipmentData, checkOnly, change);
-            arlist.add(ar1);
-        }
+		for (ResourceRule rr : resourceRuleList) {
+			if (resourceRequest.resourceName != null && !resourceRequest.resourceName.equals(rr.resourceName)) {
+				continue;
+			}
 
-        if (arlist.isEmpty())
-            return null;
+			boolean matches = ExpressionEvaluator.evalBoolean(rr.serviceExpression, resourceEntity.data);
+			matches = matches && ExpressionEvaluator.evalBoolean(rr.equipmentExpression, resourceTarget.data);
 
-        if (arlist.size() == 1)
-            return arlist.get(0);
+			if (matches) {
+				AllocationRequest ar1 = buildAllocationRequest(rr, resourceEntity, resourceTarget, resourceRequest,
+						checkOnly, change);
+				arlist.add(ar1);
+			}
+		}
 
-        MultiResourceAllocationRequest ar = new MultiResourceAllocationRequest();
-        ar.stopOnFirstFailure = false;
-        ar.allocationRequestList = arlist;
-        return ar;
-    }
+		for (RangeRule rr : rangeRuleList) {
+			if (resourceRequest.resourceName != null && !resourceRequest.resourceName.equals(rr.rangeName)) {
+				continue;
+			}
+			if (resourceRequest.endPointPosition != null
+					&& !resourceRequest.endPointPosition.equals(rr.endPointPosition)) {
+				continue;
+			}
 
-    private AllocationRequest buildAllocationRequest(
-            ResourceRule resourceRule,
-            String resourceUnionId,
-            String resourceSetId,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        StrUtil.info(log, resourceRule);
+			AllocationRequest ar1 = buildAllocationRequest(rr, resourceEntity, resourceTarget, resourceRequest,
+					checkOnly, change);
+			arlist.add(ar1);
+		}
 
-        LimitAllocationRequest ar = new LimitAllocationRequest();
-        ar.resourceSetId = resourceSetId;
-        ar.resourceUnionId = resourceUnionId;
-        ar.resourceName = resourceRule.resourceName;
-        if (serviceData.resourceShareGroup != null)
-            ar.resourceShareGroupList = Collections.singleton(serviceData.resourceShareGroup);
-        ar.assetId = equipmentData.equipmentId;
-        ar.missingResourceAction = AllocationAction.Succeed_Allocate;
-        ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
-        ar.replace = true;
-        ar.strict = false;
-        ar.checkLimit = ExpressionEvaluator.evalLong(
-                change ? resourceRule.hardLimitExpression : resourceRule.softLimitExpression, equipmentData.data);;
-        ar.checkCount = ExpressionEvaluator.evalLong(resourceRule.allocationExpression, serviceData.data);
-        ar.allocateCount = checkOnly ? 0 : ar.checkCount;
-        return ar;
-    }
+		if (arlist.isEmpty()) {
+			return null;
+		}
 
-    private AllocationRequest buildAllocationRequest(
-            RangeRule rangeRule,
-            String resourceUnionId,
-            String resourceSetId,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        StrUtil.info(log, rangeRule);
+		if (arlist.size() == 1) {
+			return arlist.get(0);
+		}
 
-        RangeAllocationRequest ar = new RangeAllocationRequest();
-        ar.resourceSetId = resourceSetId;
-        ar.resourceUnionId = resourceUnionId;
-        ar.resourceName = rangeRule.rangeName;
-        ar.assetId = equipmentData.equipmentId;
-        ar.missingResourceAction = AllocationAction.Succeed_Allocate;
-        ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
-        ar.replace = true;
-        ar.check = true;
-        ar.allocate = !checkOnly;
-        ar.checkMin = rangeRule.minValue;
-        ar.checkMax = rangeRule.maxValue;
-        return ar;
-    }
+		MultiResourceAllocationRequest ar = new MultiResourceAllocationRequest();
+		ar.stopOnFirstFailure = false;
+		ar.allocationRequestList = arlist;
+		return ar;
+	}
 
-    public void setResourceRuleDao(ResourceRuleDao resourceRuleDao) {
-        this.resourceRuleDao = resourceRuleDao;
-    }
+	private AllocationRequest buildAllocationRequest(ResourceRule resourceRule, ResourceEntity resourceEntity,
+			ResourceTarget resourceTarget, ResourceRequest resourceRequest, boolean checkOnly, boolean change) {
+		StrUtil.info(log, resourceRule);
 
-    public void setRangeRuleDao(RangeRuleDao rangeRuleDao) {
-        this.rangeRuleDao = rangeRuleDao;
-    }
+		LimitAllocationRequest ar = new LimitAllocationRequest();
+		ar.applicationId = resourceRequest.applicationId;
+		ar.resourceUnionId = resourceEntity.resourceEntityType + "::" + resourceEntity.resourceEntityId;
+		ar.resourceSetId = ar.resourceUnionId + "::" + resourceEntity.resourceEntityVersion;
+		ar.resourceName = resourceRule.resourceName;
+		if (resourceRequest.resourceShareGroup != null) {
+			ar.resourceShareGroupList = Collections.singleton(resourceRequest.resourceShareGroup);
+		}
+		ar.assetId = resourceTarget.resourceTargetType + "::" + resourceTarget.resourceTargetId;
+		ar.missingResourceAction = AllocationAction.Succeed_Allocate;
+		ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
+		ar.replace = resourceRequest.replace;
+		ar.strict = false;
+		ar.checkLimit = ExpressionEvaluator.evalLong(
+				change ? resourceRule.hardLimitExpression : resourceRule.softLimitExpression, resourceTarget.data);
+		ar.checkCount = ExpressionEvaluator.evalLong(resourceRule.allocationExpression, resourceEntity.data);
+		ar.allocateCount = checkOnly ? 0 : ar.checkCount;
+		return ar;
+	}
+
+	private AllocationRequest buildAllocationRequest(RangeRule rangeRule, ResourceEntity resourceEntity,
+			ResourceTarget resourceTarget, ResourceRequest resourceRequest, boolean checkOnly, boolean change) {
+		StrUtil.info(log, rangeRule);
+
+		RangeAllocationRequest ar = new RangeAllocationRequest();
+		ar.applicationId = resourceRequest.applicationId;
+		if (resourceRequest.endPointPosition != null) {
+			ar.resourceUnionId = resourceEntity.resourceEntityType + "::" + resourceEntity.resourceEntityId + "::"
+					+ resourceRequest.endPointPosition;
+			ar.endPointPosition = resourceRequest.endPointPosition;
+		}else
+			ar.resourceUnionId = resourceEntity.resourceEntityType + "::" + resourceEntity.resourceEntityId;
+		ar.resourceSetId = ar.resourceUnionId + "::" + resourceEntity.resourceEntityVersion;
+		ar.resourceName = rangeRule.rangeName;
+		if (resourceRequest.resourceShareGroup != null) {
+			ar.resourceShareGroupList = Collections.singleton(resourceRequest.resourceShareGroup);
+		}
+		ar.assetId = resourceTarget.resourceTargetType + "::" + resourceTarget.resourceTargetId;
+		ar.requestedNumbers = StrUtil.listInt(resourceRequest.rangeRequestedNumbers,
+				"Invalid value for requested-numbers");
+		if (ar.requestedNumbers != null) {
+			ar.requestedCount = ar.requestedNumbers.size();
+		}
+		ar.excludeNumbers = StrUtil.listInt(resourceRequest.rangeExcludeNumbers, "Invalid value for exclude-numbers");
+		ar.reverseOrder = resourceRequest.rangeReverseOrder;
+		ar.missingResourceAction = AllocationAction.Succeed_Allocate;
+		ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
+		ar.replace = resourceRequest.replace;
+		ar.check = true;
+		ar.allocate = !checkOnly;
+		ar.checkMin = resourceRequest.rangeMinOverride >= 0 ? resourceRequest.rangeMinOverride : rangeRule.minValue;
+		ar.checkMax = resourceRequest.rangeMaxOverride >= 0 ? resourceRequest.rangeMaxOverride : rangeRule.maxValue;
+		return ar;
+	}
+
+	public void setResourceRuleDao(ResourceRuleDao resourceRuleDao) {
+		this.resourceRuleDao = resourceRuleDao;
+	}
+
+	public void setRangeRuleDao(RangeRuleDao rangeRuleDao) {
+		this.rangeRuleDao = rangeRuleDao;
+	}
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/ServingSiteAllocationRule.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/ServingSiteAllocationRule.java
deleted file mode 100644
index b1c4ac4..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/ServingSiteAllocationRule.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.alloc;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.AllocationRule;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationAction;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationRequest;
-import org.onap.ccsdk.sli.adaptors.util.vrf.VpnParam;
-import org.onap.ccsdk.sli.adaptors.util.vrf.VrfUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ServingSiteAllocationRule implements AllocationRule {
-
-    private static final Logger log = LoggerFactory.getLogger(ServingSiteAllocationRule.class);
-
-    @Override
-    public AllocationRequest buildAllocationRequest(
-            String resourceUnionId,
-            String resourceSetId,
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        String vrfName = (String) serviceData.data.get("vrf-name");
-        if (vrfName == null)
-            return null;
-
-        log.info("vrfName: " + vrfName);
-
-        String v4ServingSiteStr = (String) serviceData.data.get("v4-serving-site");
-        String v6ServingSiteStr = (String) serviceData.data.get("v6-serving-site");
-        boolean v4ServingSite = v4ServingSiteStr != null &&
-                (v4ServingSiteStr.equalsIgnoreCase("Y") || v4ServingSiteStr.equalsIgnoreCase("true"));
-        boolean v6ServingSite = v6ServingSiteStr != null &&
-                (v6ServingSiteStr.equalsIgnoreCase("Y") || v6ServingSiteStr.equalsIgnoreCase("true"));
-        if (!v4ServingSite && !v6ServingSite)
-            return null;
-
-        VpnParam vpnp = VrfUtil.parseVrfInstanceName(vrfName);
-
-        LimitAllocationRequest ar = new LimitAllocationRequest();
-        ar.resourceSetId = resourceSetId;
-        ar.resourceUnionId = resourceUnionId;
-        ar.resourceName = "ServingSite";
-        ar.assetId = equipmentData.equipmentId + "-" + vpnp.vpnId;
-        ar.missingResourceAction = AllocationAction.Succeed_Allocate;
-        ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
-        ar.replace = true;
-        ar.strict = false;
-        ar.checkLimit = 1;
-        ar.checkCount = 1;
-        ar.allocateCount = 1;
-
-        return ar;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/VrfAllocationRule.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/VrfAllocationRule.java
deleted file mode 100644
index 74bfe66..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/VrfAllocationRule.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.alloc;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.AllocationRule;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationAction;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.MultiResourceAllocationRequest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class VrfAllocationRule implements AllocationRule {
-
-    private static final Logger log = LoggerFactory.getLogger(VrfAllocationRule.class);
-
-    @Override
-    public AllocationRequest buildAllocationRequest(
-            String resourceUnionId,
-            String resourceSetId,
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        String vrfName = (String) serviceData.data.get("vrf-name");
-        if (vrfName == null)
-            return null;
-
-        log.info("vrfName: " + vrfName);
-
-        Set<String> resourceShareGroupList = new HashSet<>();
-        resourceShareGroupList.add(vrfName);
-
-        LimitAllocationRequest ar = new LimitAllocationRequest();
-        ar.resourceSetId = resourceSetId;
-        ar.resourceUnionId = resourceUnionId;
-        ar.resourceShareGroupList = resourceShareGroupList;
-        ar.resourceName = "VRF";
-        ar.assetId = equipmentData.equipmentId;
-        ar.missingResourceAction = AllocationAction.Succeed_Allocate;
-        ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
-        ar.replace = true;
-        ar.strict = false;
-        ar.checkLimit = 999999999;
-        ar.checkCount = 1;
-        ar.allocateCount = 1;
-
-        String v4MulticastStr = (String) serviceData.data.get("v4-multicast");
-        String v6MulticastStr = (String) serviceData.data.get("v6-multicast");
-        boolean v4Multicast = v4MulticastStr != null &&
-                (v4MulticastStr.equalsIgnoreCase("Y") || v4MulticastStr.equalsIgnoreCase("true"));
-        boolean v6Multicast = v6MulticastStr != null &&
-                (v6MulticastStr.equalsIgnoreCase("Y") || v6MulticastStr.equalsIgnoreCase("true"));
-        if (v4Multicast || v6Multicast) {
-            LimitAllocationRequest ar2 = new LimitAllocationRequest();
-            ar2.resourceSetId = resourceSetId;
-            ar2.resourceUnionId = resourceUnionId;
-            ar2.resourceShareGroupList = resourceShareGroupList;
-            ar2.resourceName = "MVRF";
-            ar2.assetId = equipmentData.equipmentId;
-            ar2.missingResourceAction = AllocationAction.Succeed_Allocate;
-            ar2.expiredResourceAction = AllocationAction.Succeed_Allocate;
-            ar2.replace = true;
-            ar2.strict = false;
-            ar2.checkLimit = 999999999;
-            ar2.checkCount = 1;
-            ar2.allocateCount = 1;
-
-            MultiResourceAllocationRequest mar = new MultiResourceAllocationRequest();
-            mar.resourceSetId = resourceSetId;
-            mar.resourceUnionId = resourceUnionId;
-            mar.resourceShareGroupList = resourceShareGroupList;
-            mar.assetId = equipmentData.equipmentId;
-            mar.missingResourceAction = AllocationAction.Succeed_Allocate;
-            mar.expiredResourceAction = AllocationAction.Succeed_Allocate;
-            mar.allocationRequestList = new ArrayList<>();
-            mar.allocationRequestList.add(ar);
-            mar.allocationRequestList.add(ar2);
-
-            return mar;
-        }
-
-        return ar;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/AnyVrfPresentCheck.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/AnyVrfPresentCheck.java
deleted file mode 100644
index 6f4de26..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/AnyVrfPresentCheck.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.check;
-
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.EquipmentCheck;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
-import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AnyVrfPresentCheck implements EquipmentCheck {
-
-    private static final Logger log = LoggerFactory.getLogger(AnyVrfPresentCheck.class);
-
-    private ResourceManager resourceManager;
-
-    @Override
-    public boolean checkEquipment(
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipData,
-            Map<String, Object> equipmentConstraints) {
-        String vrfNameListStr = (String) serviceData.data.get("vrf-name-list");
-        if (vrfNameListStr == null)
-            vrfNameListStr = (String) serviceData.data.get("vrf-name");
-        if (vrfNameListStr == null)
-            return true;
-
-        String vrfRequiredStr = (String) equipmentConstraints.get("vrf-required");
-        if (vrfRequiredStr == null || !vrfRequiredStr.equalsIgnoreCase("true"))
-            return true;
-
-        String[] vrfNameList = vrfNameListStr.split(",");
-
-        Resource r = resourceManager.getResource("VRF", equipData.equipmentId);
-        if (r != null && r.allocationItems != null)
-            for (AllocationItem ai : r.allocationItems)
-                for (String vrfName : vrfNameList)
-                    if (ai.resourceShareGroupList.contains(vrfName))
-                        return true;
-
-        log.info("Skipping VPE " + equipData.equipmentId +
-                ": Existing VRF is required, but there is no existing VRF on the VPE for any of the requested VPNs.");
-        return false;
-    }
-
-    public void setResourceManager(ResourceManager resourceManager) {
-        this.resourceManager = resourceManager;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/ExcludeVpeCheck.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/ExcludeVpeCheck.java
deleted file mode 100644
index 020c165..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/ExcludeVpeCheck.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.check;
-
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.EquipmentCheck;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ExcludeVpeCheck implements EquipmentCheck {
-
-    private static final Logger log = LoggerFactory.getLogger(ExcludeVpeCheck.class);
-
-    @Override
-    public boolean checkEquipment(
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipData,
-            Map<String, Object> equipmentConstraints) {
-        String excludeVpeListStr = (String) equipmentConstraints.get("exclude-vpe-list");
-        if (excludeVpeListStr == null)
-            return true;
-
-        String vpeName = (String) equipData.data.get("vpe-id");
-
-        String[] excludeVpeList = excludeVpeListStr.split(",");
-        for (String excludeVpe : excludeVpeList)
-            if (excludeVpe.equals(vpeName)) {
-                log.info("Skipping VPE " + equipData.equipmentId + ": Present in the exclude VPE list.");
-                return false;
-            }
-
-        return true;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/HubWithRgCheck.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/HubWithRgCheck.java
deleted file mode 100644
index 22fdeca..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/HubWithRgCheck.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.check;
-
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.EquipmentCheck;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
-import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
-import org.onap.ccsdk.sli.adaptors.util.vrf.VpnParam;
-import org.onap.ccsdk.sli.adaptors.util.vrf.VrfUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class HubWithRgCheck implements EquipmentCheck {
-
-    private static final Logger log = LoggerFactory.getLogger(HubWithRgCheck.class);
-
-    private ResourceManager resourceManager;
-
-    @Override
-    public boolean checkEquipment(
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipData,
-            Map<String, Object> equipmentConstraints) {
-        String vrfName = (String) serviceData.data.get("vrf-name");
-        if (vrfName == null)
-            return true;
-
-        // Check if this is HUB. If not, this check is not applicable
-        VpnParam vpnp = VrfUtil.parseVrfInstanceName(vrfName);
-        if (vpnp.siteType == null || !vpnp.siteType.equals("HUB"))
-            return true;
-
-        boolean rgPresent = vpnp.routeGroupName != null;
-
-        // First check if a new VRF would be required. If not, we are good
-        Resource r = resourceManager.getResource("VRF", equipData.equipmentId);
-        if (r != null && r.allocationItems != null) {
-            for (AllocationItem ai : r.allocationItems)
-                if (ai.resourceShareGroupList.contains(vrfName))
-                    return true;
-
-            String resourceUnionId = serviceData.serviceInstanceId + '/' + serviceData.endPointPosition;
-
-            // Check if there is already another HUB VRF with RG presence that does not match the requested
-            for (AllocationItem ai : r.allocationItems) {
-
-                // Skip the allocation item for the current service instance, if there, in case it is a change order
-                if (ai.resourceUnionId.equals(resourceUnionId))
-                    continue;
-
-                if (ai.resourceShareGroupList != null && ai.resourceShareGroupList.size() > 0) {
-                    String vrfName2 = ai.resourceShareGroupList.iterator().next();
-                    VpnParam vpnp2 = VrfUtil.parseVrfInstanceName(vrfName2);
-
-                    if (vpnp2.siteType == null || !vpnp2.siteType.equals("HUB"))
-                        continue;
-
-                    boolean rgPresent2 = vpnp2.routeGroupName != null;
-
-                    if (rgPresent && !rgPresent2) {
-                        log.info("Skipping VPE " + equipData.equipmentId +
-                                ": This request requires new HUB with RG VRF, " +
-                                "but there is already another HUB VRF with no RG: " + vrfName2 + ".");
-                        return false;
-                    }
-                    if (!rgPresent && rgPresent2) {
-                        log.info("Skipping VPE " + equipData.equipmentId +
-                                ": This request requires new HUB VRF with no RG, " +
-                                "but there is already another HUB with RG VRF: " + vrfName2 + ".");
-                        return false;
-                    }
-                }
-            }
-        }
-
-        return true;
-    }
-
-    public void setResourceManager(ResourceManager resourceManager) {
-        this.resourceManager = resourceManager;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/OneMVrfCheck.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/OneMVrfCheck.java
deleted file mode 100644
index e54d89c..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/OneMVrfCheck.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.check;
-
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.EquipmentCheck;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
-import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
-import org.onap.ccsdk.sli.adaptors.util.vrf.VpnParam;
-import org.onap.ccsdk.sli.adaptors.util.vrf.VrfUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OneMVrfCheck implements EquipmentCheck {
-
-    private static final Logger log = LoggerFactory.getLogger(OneMVrfCheck.class);
-
-    private ResourceManager resourceManager;
-
-    @Override
-    public boolean checkEquipment(
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipData,
-            Map<String, Object> equipmentConstraints) {
-        String vrfName = (String) serviceData.data.get("vrf-name");
-        if (vrfName == null)
-            return true;
-
-        String v4MulticastStr = (String) serviceData.data.get("v4-multicast");
-        String v6MulticastStr = (String) serviceData.data.get("v6-multicast");
-        boolean v4Multicast = v4MulticastStr != null &&
-                (v4MulticastStr.equalsIgnoreCase("Y") || v4MulticastStr.equalsIgnoreCase("true"));
-        boolean v6Multicast = v6MulticastStr != null &&
-                (v6MulticastStr.equalsIgnoreCase("Y") || v6MulticastStr.equalsIgnoreCase("true"));
-        if (!v4Multicast && !v6Multicast)
-            return true;
-
-        // First check if a new VRF would be required. If not, we are good
-        Resource r = resourceManager.getResource("VRF", equipData.equipmentId);
-        if (r != null && r.allocationItems != null)
-            for (AllocationItem ai : r.allocationItems)
-                if (ai.resourceShareGroupList.contains(vrfName))
-                    return true;
-
-        String resourceUnionId = serviceData.serviceInstanceId + '/' + serviceData.endPointPosition;
-
-        // Check if there is already another multicast VRF for the same VPN
-        VpnParam vpnp = VrfUtil.parseVrfInstanceName(vrfName);
-        r = resourceManager.getResource("MVRF", equipData.equipmentId);
-        if (r != null && r.allocationItems != null) {
-            for (AllocationItem ai : r.allocationItems) {
-
-                // Skip the allocation item for the current service instance, if there, in case it is a change order
-                if (ai.resourceUnionId.equals(resourceUnionId))
-                    continue;
-
-                if (ai.resourceShareGroupList != null && ai.resourceShareGroupList.size() > 0) {
-                    String vrfName2 = ai.resourceShareGroupList.iterator().next();
-                    VpnParam vpnp2 = VrfUtil.parseVrfInstanceName(vrfName2);
-                    if (vpnp.vpnId.equals(vpnp2.vpnId)) {
-                        log.info("Skipping VPE " + equipData.equipmentId +
-                                ": This request requires new multicast VRF, " +
-                                "but there is already another multicast VRF for the same VPN: " + vrfName2 + ".");
-                        return false;
-                    }
-                }
-            }
-        }
-
-        return true;
-    }
-
-    public void setResourceManager(ResourceManager resourceManager) {
-        this.resourceManager = resourceManager;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/ProvStatusCheck.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/ProvStatusCheck.java
deleted file mode 100644
index f851b53..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/ProvStatusCheck.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.check;
-
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.EquipmentCheck;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ProvStatusCheck implements EquipmentCheck {
-
-    private static final Logger log = LoggerFactory.getLogger(ProvStatusCheck.class);
-
-    @Override
-    public boolean checkEquipment(
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipData,
-            Map<String, Object> equipmentConstraints) {
-        String provStatus = (String) equipData.data.get("provisioning-status");
-        if (provStatus == null || !provStatus.equals("PROV")) {
-            log.info("Skipping VPE " + equipData.equipmentId + ": Not in PROV status.");
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/VlanSpeedCheck.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/VlanSpeedCheck.java
deleted file mode 100644
index 28e6278..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/VlanSpeedCheck.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.check;
-
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.EquipmentCheck;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class VlanSpeedCheck implements EquipmentCheck {
-
-    private static final Logger log = LoggerFactory.getLogger(VlanSpeedCheck.class);
-
-    @Override
-    public boolean checkEquipment(
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipData,
-            Map<String, Object> equipmentConstraints) {
-        String vpeName = (String) equipData.data.get("vpe-id");
-        Long serviceSpeed = (Long) serviceData.data.get("service-speed-kbps");
-        if (serviceSpeed != null && serviceSpeed > 0 && serviceSpeed < 1000) {
-            log.info("Skipping VPE " + vpeName + ": Service speed < 1Mbps is not supported.");
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/VpeLockCheck.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/VpeLockCheck.java
deleted file mode 100644
index 503e1ff..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/check/VpeLockCheck.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.check;
-
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.EquipmentCheck;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.ra.rule.dao.VpeLockDao;
-import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
-import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class VpeLockCheck implements EquipmentCheck {
-
-    private static final Logger log = LoggerFactory.getLogger(VpeLockCheck.class);
-
-    private VpeLockDao vpeLockDao;
-    private ResourceManager resourceManager;
-
-    @Override
-    public boolean checkEquipment(
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipData,
-            Map<String, Object> equipmentConstraints) {
-        String vrfName = (String) serviceData.data.get("vrf-name");
-        if (vrfName == null)
-            return true;
-
-        String vpeName = (String) equipData.data.get("vpe-id");
-        String vpeLock = vpeLockDao.getVpeLock(vpeName);
-        if (vpeLock == null)
-            return true;
-
-        if (vpeLock.equals("vpe-total-lock")) {
-            log.info("Skipping VPE " + vpeName + ": There is a " + vpeLock + " on it.");
-            return false;
-        }
-
-        if (vpeLock.equals("vpe-vrf-lock") && requiresNewVrf(equipData.equipmentId, vrfName)) {
-            log.info("Skipping VPE " + vpeName + ": There is a " + vpeLock +
-                    " on it and it requires a new VRF for VPN: " + vrfName + ".");
-            return false;
-        }
-
-        if (vpeLock.equals("vpe-mvrf-lock") && requiresNewMVrf(equipData.equipmentId, vrfName)) {
-            log.info("Skipping VPE " + vpeName + ": There is a " + vpeLock +
-                    " on it and it requires a new multicast VRF for VPN: " + vrfName + ".");
-            return false;
-        }
-
-        return true;
-    }
-
-    boolean requiresNewVrf(String equipmentId, String vrfName) {
-        Resource r = resourceManager.getResource("VRF", equipmentId);
-        if (r == null || r.allocationItems == null)
-            return true;
-
-        for (AllocationItem ai : r.allocationItems) {
-            if (ai.resourceShareGroupList.contains(vrfName))
-                return false;
-        }
-
-        return true;
-    }
-
-    boolean requiresNewMVrf(String equipmentId, String vrfName) {
-        Resource r = resourceManager.getResource("MVRF", equipmentId);
-        if (r == null || r.allocationItems == null)
-            return true;
-
-        for (AllocationItem ai : r.allocationItems) {
-            if (ai.resourceShareGroupList.contains(vrfName))
-                return false;
-        }
-
-        return true;
-    }
-
-    public void setVpeLockDao(VpeLockDao vpeLockDao) {
-        this.vpeLockDao = vpeLockDao;
-    }
-
-    public void setResourceManager(ResourceManager resourceManager) {
-        this.resourceManager = resourceManager;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/AllocationRule.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/AllocationRule.java
index 831cac0..0e97374 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/AllocationRule.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/AllocationRule.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * 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.
@@ -21,17 +21,10 @@
 
 package org.onap.ccsdk.sli.adaptors.ra.comp;
 
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationRequest;
 
 public interface AllocationRule {
 
-    AllocationRequest buildAllocationRequest(
-            String resourceUnionId,
-            String resourceSetId,
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change);
+    AllocationRequest buildAllocationRequest(String serviceModel, ResourceEntity resourceEntity,
+            ResourceTarget resourceTarget, ResourceRequest resourceRequest, boolean checkOnly, boolean change);
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocationDefinition.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocationDefinition.java
deleted file mode 100644
index 589fafc..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.comp;
-
-import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.comp.EquipmentReader;
-
-public class EndPointAllocationDefinition {
-
-    public String serviceModel;
-    public String endPointPosition;
-    public EquipmentReader equipmentReader;
-    public List<EquipmentCheck> equipmentCheckList;
-    public List<PreferenceRule> preferenceRuleList;
-    public List<AllocationRule> allocationRuleList;
-
-    public void setServiceModel(String serviceModel) {
-        this.serviceModel = serviceModel;
-    }
-
-    public void setEndPointPosition(String endPointPosition) {
-        this.endPointPosition = endPointPosition;
-    }
-
-    public void setEquipmentReader(EquipmentReader equipmentReader) {
-        this.equipmentReader = equipmentReader;
-    }
-
-    public void setEquipmentCheckList(List<EquipmentCheck> equipmentCheckList) {
-        this.equipmentCheckList = equipmentCheckList;
-    }
-
-    public void setPreferenceRuleList(List<PreferenceRule> preferenceRuleList) {
-        this.preferenceRuleList = preferenceRuleList;
-    }
-
-    public void setAllocationRuleList(List<AllocationRule> allocationRuleList) {
-        this.allocationRuleList = allocationRuleList;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocator.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocator.java
index 08713cd..c6461d4 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocator.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocator.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * 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.
@@ -22,14 +22,14 @@
 package org.onap.ccsdk.sli.adaptors.ra.comp;
 
 import java.util.List;
-import java.util.Map;
 
 public interface EndPointAllocator {
 
-    List<EndPointData> allocateEndPoints(
-            ServiceData serviceData,
-            Map<String, Object> equipmentConstraints,
-            boolean checkOnly,
-            boolean change,
-            int changeNumber);
+    List<ResourceData> allocateResources(String serviceModel, ResourceEntity resourceEntity,
+            ResourceTarget resourceTarget, ResourceRequest resourceRequest, boolean checkOnly, boolean change);
+
+    List<ResourceData> getResourcesForEntity(String resourceEntityType, String resourceEntityId,
+            String resourceEntityVersion);
+
+    ResourceData getResource(String resourceTargetType, String resourceTargetId, String resourceName);
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java
index db30bf6..e904035 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java
@@ -3,7 +3,7 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,226 +22,237 @@
 package org.onap.ccsdk.sli.adaptors.ra.comp;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
-import org.apache.commons.lang.NotImplementedException;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
 import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationOutcome;
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationRequest;
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationStatus;
 import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationItem;
+import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationOutcome;
 import org.onap.ccsdk.sli.adaptors.rm.data.LimitResource;
+import org.onap.ccsdk.sli.adaptors.rm.data.MultiResourceAllocationOutcome;
 import org.onap.ccsdk.sli.adaptors.rm.data.RangeAllocationItem;
+import org.onap.ccsdk.sli.adaptors.rm.data.RangeAllocationOutcome;
 import org.onap.ccsdk.sli.adaptors.rm.data.RangeResource;
 import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
+import org.onap.ccsdk.sli.adaptors.util.str.StrUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class EndPointAllocatorImpl implements EndPointAllocator {
 
+    @SuppressWarnings("unused")
     private static final Logger log = LoggerFactory.getLogger(EndPointAllocatorImpl.class);
 
-    private Map<String, List<EndPointAllocationDefinition>> endPointAllocationDefinitionMap;
-
     private ResourceManager resourceManager;
 
+    private Map<String, List<AllocationRule>> allocationRuleMap;
+
     @Override
-    public List<EndPointData> allocateEndPoints(
-            ServiceData serviceData,
-            Map<String, Object> equipmentConstraints,
-            boolean checkOnly,
-            boolean change,
-            int changeNumber) {
-        List<EndPointAllocationDefinition> defList = endPointAllocationDefinitionMap.get(serviceData.serviceModel);
-        if (defList == null)
-            throw new NotImplementedException("Service model: " + serviceData.serviceModel + " not supported");
+    public List<ResourceData> allocateResources(String serviceModel, ResourceEntity resourceEntity,
+            ResourceTarget resourceTarget, ResourceRequest resourceRequest, boolean checkOnly, boolean change) {
 
-        List<EndPointData> epList = new ArrayList<>();
-        for (EndPointAllocationDefinition def : defList) {
-            if (serviceData.endPointPosition != null && !serviceData.endPointPosition.equals(def.endPointPosition))
-                continue;
+        List<ResourceData> resourceList = new ArrayList<>();
 
-            log.info(
-                    "Starting allocation of end point: " + def.endPointPosition + ": " + serviceData.serviceInstanceId);
-
-            String resourceUnionId = serviceData.serviceInstanceId + '/' + def.endPointPosition;
-            String resourceSetId = resourceUnionId + '/' + changeNumber;
-
-            String equipmentId = (String) equipmentConstraints.get("equipment-id");
-            if (equipmentId == null) {
-                EndPointData epExisting = readEndPoint(resourceUnionId, resourceSetId);
-                if (epExisting != null && epExisting.equipmentId != null) {
-                    equipmentConstraints.put("equipment-id", epExisting.equipmentId);
-
-                    log.info("Trying assignment on the current equipment: " + epExisting.equipmentId);
-                }
+        if (allocationRuleMap != null) {
+            List<AllocationRule> allocationRuleList = allocationRuleMap.get(serviceModel);
+            if (allocationRuleList == null) {
+                allocationRuleList = allocationRuleMap.get("DEFAULT");
             }
 
-            List<EquipmentData> equipList = def.equipmentReader.readEquipment(equipmentConstraints);
-            if (equipList == null || equipList.isEmpty()) {
-                log.info("Equipment not found for " + def.endPointPosition);
-                break;
-            }
-
-            if (def.equipmentCheckList != null) {
-                for (EquipmentCheck filter : def.equipmentCheckList) {
-                    List<EquipmentData> newEquipList = new ArrayList<>();
-                    for (EquipmentData equipData : equipList)
-                        if (filter.checkEquipment(def.endPointPosition, serviceData, equipData, equipmentConstraints))
-                            newEquipList.add(equipData);
-                    equipList = newEquipList;
-                }
-                if (equipList.isEmpty()) {
-                    log.info("No equipment meets the requiremets for the service for: " + def.endPointPosition);
-                    break;
-                }
-            }
-
-            if (equipList.size() > 1 && def.preferenceRuleList != null && !def.preferenceRuleList.isEmpty()) {
-
-                List<PrefEquipment> prefEquipList = new ArrayList<>();
-                for (EquipmentData equipData : equipList) {
-                    PrefEquipment prefEquip = new PrefEquipment();
-                    prefEquip.equipData = equipData;
-                    prefEquip.prefNumbers = new long[def.preferenceRuleList.size()];
-                    prefEquipList.add(prefEquip);
-
-                    int i = 0;
-                    for (PreferenceRule prefRule : def.preferenceRuleList)
-                        prefEquip.prefNumbers[i++] =
-                                prefRule.assignOrderNumber(def.endPointPosition, serviceData, equipData);
-                }
-
-                Collections.sort(prefEquipList);
-
-                equipList = new ArrayList<>();
-                for (PrefEquipment prefEquip : prefEquipList)
-                    equipList.add(prefEquip.equipData);
-            }
-
-            for (EquipmentData equipData : equipList) {
+            if (allocationRuleList != null) {
                 boolean allgood = true;
-                if (def.allocationRuleList != null)
-                    for (AllocationRule allocationRule : def.allocationRuleList) {
-                        AllocationRequest ar = allocationRule.buildAllocationRequest(resourceUnionId, resourceSetId,
-                                def.endPointPosition, serviceData, equipData, checkOnly, change);
-                        if (ar != null) {
-                            AllocationOutcome ao = resourceManager.allocateResources(ar);
-                            if (ao.status != AllocationStatus.Success) {
-                                allgood = false;
-                                break;
-                            }
+                for (AllocationRule allocationRule : allocationRuleList) {
+                    AllocationRequest ar = allocationRule.buildAllocationRequest(serviceModel, resourceEntity,
+                            resourceTarget, resourceRequest, checkOnly, change);
+                    if (ar != null) {
+                        AllocationOutcome ao = resourceManager.allocateResources(ar);
+                        List<ResourceData> rr = getResourceData(ao);
+                        resourceList.addAll(rr);
+
+                        if (ao.status != AllocationStatus.Success) {
+                            allgood = false;
                         }
                     }
-                if (allgood) {
-                    EndPointData ep = readEndPoint(resourceUnionId, resourceSetId);
-                    epList.add(ep);
-                    break;
+                }
+
+                if (!allgood) {
+                    String resourceSetId = resourceEntity.resourceEntityType + "::" + resourceEntity.resourceEntityId
+                            + "::" + resourceEntity.resourceEntityVersion;
+                    resourceManager.releaseResourceSet(resourceSetId);
                 }
             }
         }
 
-        return epList;
+        return resourceList;
     }
 
-    private EndPointData readEndPoint(String resourceUnionId, String resourceSetId) {
-        EndPointData ep = new EndPointData();
-        ep.resourceUnionId = resourceUnionId;
-        ep.resourceSetId = resourceSetId;
+    private List<ResourceData> getResourceData(AllocationOutcome ao) {
+        if (ao instanceof MultiResourceAllocationOutcome) {
+            List<ResourceData> rr = new ArrayList<>();
+            for (AllocationOutcome ao1 : ((MultiResourceAllocationOutcome) ao).allocationOutcomeList) {
+                rr.addAll(getResourceData(ao1));
+            }
+            return rr;
+        }
 
-        int i1 = resourceUnionId.indexOf('/');
-        if (i1 > 0)
-            ep.endPointPosition = resourceUnionId.substring(i1 + 1);
+        ResourceData rd = new ResourceData();
+        rd.data = new HashMap<>();
 
-        ep.data = new HashMap<>();
+        AllocationRequest ar = ao.request;
+        rd.resourceName = ar.resourceName;
+        rd.endPointPosition = ar.endPointPosition;
+        int i1 = ar.assetId.indexOf("::");
+        if (i1 > 0) {
+            rd.resourceTargetType = ar.assetId.substring(0, i1);
+            rd.resourceTargetId = ar.assetId.substring(i1 + 2);
+        } else {
+            rd.resourceTargetType = "";
+            rd.resourceTargetId = ar.assetId;
+        }
+        rd.status = ao.status.toString();
 
+        if (ao instanceof LimitAllocationOutcome) {
+            LimitAllocationOutcome lao = (LimitAllocationOutcome) ao;
+            rd.data.put("allocated", String.valueOf(lao.allocatedCount));
+            rd.data.put("used", String.valueOf(lao.used));
+            rd.data.put("limit", String.valueOf(lao.limit));
+            rd.data.put("available", String.valueOf(lao.limit - lao.used));
+        } else if (ao instanceof RangeAllocationOutcome) {
+            RangeAllocationOutcome rao = (RangeAllocationOutcome) ao;
+            rd.data.put("allocated", String.valueOf(StrUtil.listInt(rao.allocated)));
+            rd.data.put("used", String.valueOf(StrUtil.listInt(rao.used)));
+        }
+
+        return Collections.singletonList(rd);
+    }
+
+    @Override
+    public List<ResourceData> getResourcesForEntity(String resourceEntityType, String resourceEntityId,
+            String resourceEntityVersion) {
+        List<ResourceData> rdlist = new ArrayList<>();
+
+        String resourceUnionId = resourceEntityType + "::" + resourceEntityId;
         List<Resource> rlist = resourceManager.getResourceUnion(resourceUnionId);
+
         for (Resource r : rlist) {
+
+            // Find the needed allocation item: if resourceEntityVersion is specified, use that,
+            // otherwise, find the latest allocation item
+            AllocationItem ai = null;
+            if (resourceEntityVersion != null) {
+                String resourceSetId = resourceUnionId + "::" + resourceEntityVersion;
+                for (AllocationItem ai1 : r.allocationItems) {
+                    if (ai1.resourceSetId.equals(resourceSetId)) {
+                        ai = ai1;
+                        break;
+                    }
+                }
+            } else {
+                Date aitime = null;
+                for (AllocationItem ai1 : r.allocationItems) {
+                    if (ai1.resourceUnionId.equals(resourceUnionId)) {
+                        if (aitime == null || ai1.allocationTime.after(aitime)) {
+                            ai = ai1;
+                            aitime = ai1.allocationTime;
+                        }
+                    }
+                }
+            }
+
+            if (ai != null) {
+                ResourceData rd = new ResourceData();
+                rdlist.add(rd);
+
+                rd.resourceName = r.resourceKey.resourceName;
+                int i1 = r.resourceKey.assetId.indexOf("::");
+                if (i1 > 0) {
+                    rd.resourceTargetType = r.resourceKey.assetId.substring(0, i1);
+                    rd.resourceTargetId = r.resourceKey.assetId.substring(i1 + 2);
+
+                    int i2 = r.resourceKey.assetId.lastIndexOf("::");
+                    if (i2 > i1) {
+                        rd.resourceTargetValue = r.resourceKey.assetId.substring(i2 + 2);
+                    }
+                } else {
+                    rd.resourceTargetType = "";
+                    rd.resourceTargetId = r.resourceKey.assetId;
+                }
+
+                rd.data = new HashMap<>();
+
+                if (ai instanceof RangeAllocationItem) {
+                    RangeAllocationItem rai = (RangeAllocationItem) ai;
+
+                    String ss = String.valueOf(rai.used);
+                    ss = ss.substring(1, ss.length() - 1);
+                    rd.data.put("allocated", ss);
+
+                } else if (ai instanceof LimitAllocationItem) {
+                    LimitAllocationItem lai = (LimitAllocationItem) ai;
+
+                    rd.data.put("allocated", String.valueOf(lai.used));
+                }
+            }
+        }
+
+        return rdlist;
+    }
+
+    @Override
+    public ResourceData getResource(String resourceTargetType, String resourceTargetId, String resourceName) {
+        ResourceData rd = new ResourceData();;
+        String assetId = resourceTargetType + "::" + resourceTargetId;
+        Resource r = resourceManager.getResource(resourceName, assetId);
+        if (r != null) {
+            log.info("ResourceName:" + r.resourceKey.resourceName + " assetId:" + r.resourceKey.assetId);
+
+            rd.resourceName = r.resourceKey.resourceName;
+            int i1 = r.resourceKey.assetId.indexOf("::");
+            if (i1 > 0) {
+                rd.resourceTargetType = r.resourceKey.assetId.substring(0, i1);
+                rd.resourceTargetId = r.resourceKey.assetId.substring(i1 + 2);
+
+                int i2 = r.resourceKey.assetId.lastIndexOf("::");
+                if (i2 > i1) {
+                    rd.resourceTargetValue = r.resourceKey.assetId.substring(i2 + 2);
+                }
+            } else {
+                rd.resourceTargetType = "";
+                rd.resourceTargetId = r.resourceKey.assetId;
+            }
+
+            rd.data = new HashMap<>();
+
             if (r instanceof RangeResource) {
                 RangeResource rr = (RangeResource) r;
-                for (AllocationItem ai : r.allocationItems)
-                    if (ai.resourceUnionId.equals(resourceUnionId)) {
-                        RangeAllocationItem rai = (RangeAllocationItem) ai;
-                        ep.data.put(ep.endPointPosition + '.' + rr.resourceKey.resourceName, rai.used.first());
-                    }
-            }
-            if (r instanceof LimitResource) {
-                LimitResource rr = (LimitResource) r;
-                for (AllocationItem ai : r.allocationItems)
-                    if (ai.resourceUnionId.equals(resourceUnionId)) {
-                        LimitAllocationItem rai = (LimitAllocationItem) ai;
-                        ep.data.put(ep.endPointPosition + '.' + rr.resourceKey.resourceName + ".allocated", rai.used);
-                        ep.data.put(ep.endPointPosition + '.' + rr.resourceKey.resourceName + ".used", rr.used);
-                        ep.data.put(ep.endPointPosition + '.' + rr.resourceKey.resourceName + ".assetId",
-                                r.resourceKey.assetId);
-                    }
+
+                log.info("rr.used: " + rr.used);
+                String ss = String.valueOf(rr.used);
+                ss = ss.substring(1, ss.length() - 1);
+                rd.data.put("allocated", ss);
+
+            } else if (r instanceof LimitResource) {
+                LimitResource lr = (LimitResource) r;
+
+                log.info("lr.used: " + lr.used);
+                rd.data.put("allocated", String.valueOf(lr.used));
             }
         }
 
-        return ep;
-    }
-
-    private static class PrefEquipment implements Comparable<PrefEquipment> {
-
-        public long[] prefNumbers;
-        public EquipmentData equipData;
-
-        @Override
-        public int compareTo(PrefEquipment o) {
-            for (int i = 0; i < prefNumbers.length; i++) {
-                if (prefNumbers[i] < o.prefNumbers[i])
-                    return -1;
-                if (prefNumbers[i] > o.prefNumbers[i])
-                    return 1;
-            }
-            return 0;
-        }
-
-        @Override
-        public boolean equals(Object object) {
-            if (this == object) {
-                return true;
-            }
-            if (!(object instanceof PrefEquipment)) {
-                return false;
-            }
-            if (!super.equals(object)) {
-                return false;
-            }
-
-            PrefEquipment that = (PrefEquipment) object;
-            if (equipData != null ? !equipData.equals(that.equipData) : that.equipData != null) {
-                return false;
-            }
-
-            if (!Arrays.equals(prefNumbers, that.prefNumbers)) {
-                return false;
-            }
-
-            return true;
-        }
-
-        @Override
-        public int hashCode() {
-            int result = super.hashCode();
-            result = 31 * result + (equipData != null ? equipData.hashCode() : 0);
-            result = 31 * result + Arrays.hashCode(prefNumbers);
-            return result;
-        }
-    }
-
-    public void setEndPointAllocationDefinitionMap(
-            Map<String, List<EndPointAllocationDefinition>> endPointAllocationDefinitionMap) {
-        this.endPointAllocationDefinitionMap = endPointAllocationDefinitionMap;
+        return rd;
     }
 
     public void setResourceManager(ResourceManager resourceManager) {
         this.resourceManager = resourceManager;
     }
+
+    public void setAllocationRuleMap(Map<String, List<AllocationRule>> allocationRuleMap) {
+        this.allocationRuleMap = allocationRuleMap;
+    }
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EquipmentCheck.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EquipmentCheck.java
deleted file mode 100644
index 70f2abd..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EquipmentCheck.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.comp;
-
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-
-public interface EquipmentCheck {
-
-    boolean checkEquipment(
-            String endPointPosition,
-            ServiceData serviceData,
-            EquipmentData equipData,
-            Map<String, Object> equipmentConstraints);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/PreferenceRule.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/PreferenceRule.java
deleted file mode 100644
index ca8a371..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/PreferenceRule.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.comp;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-
-public interface PreferenceRule {
-
-    // Smaller order number is preferred
-    int assignOrderNumber(String endPointPosition, ServiceData serviceData, EquipmentData equipData);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointData.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceData.java
similarity index 80%
copy from resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointData.java
copy to resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceData.java
index dc1cb0a..a5881b9 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointData.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceData.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * 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.
@@ -23,11 +23,13 @@
 
 import java.util.Map;
 
-public class EndPointData {
+public class ResourceData {
 
-    public String resourceSetId;
-    public String resourceUnionId;
+    public String resourceName;
+    public String resourceTargetId;
+    public String resourceTargetValue;
+    public String resourceTargetType;
+    public String status;
+    public Map<String, String> data;
     public String endPointPosition;
-    public String equipmentId;
-    public Map<String, Object> data;
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointData.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceEntity.java
similarity index 80%
rename from resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointData.java
rename to resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceEntity.java
index dc1cb0a..12fb695 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointData.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceEntity.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * 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.
@@ -23,11 +23,10 @@
 
 import java.util.Map;
 
-public class EndPointData {
+public class ResourceEntity {
 
-    public String resourceSetId;
-    public String resourceUnionId;
-    public String endPointPosition;
-    public String equipmentId;
-    public Map<String, Object> data;
+    public String resourceEntityId;
+    public String resourceEntityVersion;
+    public String resourceEntityType;
+    public Map<String, String> data;
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ServiceData.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceRequest.java
similarity index 76%
rename from resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ServiceData.java
rename to resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceRequest.java
index 238ea1d..b5c24fa 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ServiceData.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceRequest.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * 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.
@@ -21,16 +21,19 @@
 
 package org.onap.ccsdk.sli.adaptors.ra.comp;
 
-import java.util.Map;
+public class ResourceRequest {
 
-public class ServiceData {
-
-    public String serviceModel;
-    public String serviceInstanceId;
-    public String resourceSetId;
-    public String resourceUnionId;
-    public String resourceShareGroup;
-    public String endPointPosition;
     public String resourceName;
-    public Map<String, Object> data;
+    public String resourceShareGroup;
+    public String rangeRequestedNumbers;
+    public String rangeExcludeNumbers;
+    public boolean rangeReverseOrder;
+    public int rangeMinOverride;
+    public int rangeMaxOverride;
+    public boolean replace;
+    public String requestType;
+    public String serviceModel;
+    public boolean checkOnly;
+    public String applicationId;
+    public String endPointPosition;
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceResponse.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceResponse.java
new file mode 100644
index 0000000..989333c
--- /dev/null
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceResponse.java
@@ -0,0 +1,13 @@
+package org.onap.ccsdk.sli.adaptors.ra.comp;
+
+public class ResourceResponse {
+	public String resourceName;
+	public String endPointPosition;
+	public String resourceTargetType;
+	public String resourceTargetId;
+	public String resourceLimit;
+	public String resourceAvailable;
+	public String resourceUsed;
+	public String resourceAllocated;
+	public String status;
+}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/ServerDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceTarget.java
similarity index 82%
rename from resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/ServerDao.java
rename to resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceTarget.java
index f9f7ee3..95cec33 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/ServerDao.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceTarget.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * 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.
@@ -19,12 +19,13 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.ccsdk.sli.adaptors.ra.equip.dao;
+package org.onap.ccsdk.sli.adaptors.ra.comp;
 
-import java.util.List;
 import java.util.Map;
 
-public interface ServerDao {
+public class ResourceTarget {
 
-    List<Map<String, Object>> getServerData(String aicSiteId);
+    public String resourceTargetId;
+    public String resourceTargetType;
+    public Map<String, String> data;
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/comp/EquipmentReader.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/comp/EquipmentReader.java
deleted file mode 100644
index 03f96e2..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/comp/EquipmentReader.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.equip.comp;
-
-import java.util.List;
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-
-public interface EquipmentReader {
-
-    List<EquipmentData> readEquipment(Map<String, Object> equipmentConstraints);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/ServerDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/ServerDaoImpl.java
deleted file mode 100644
index f51dc14..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/ServerDaoImpl.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.equip.dao;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-public class ServerDaoImpl implements ServerDao {
-
-    private static final Logger log = LoggerFactory.getLogger(ServerDaoImpl.class);
-
-    private static final String GET_SERVER_COUNT_SQL = "SELECT count(*) FROM PSERVER WHERE aic_site_id = ?";
-
-    private JdbcTemplate jdbcTemplate;
-
-    @Override
-    public List<Map<String, Object>> getServerData(String aicSiteId) {
-        List<Map<String, Object>> ll = new ArrayList<Map<String, Object>>();
-        Map<String, Object> sd = new HashMap<String, Object>();
-        sd.put("aic-site-id", aicSiteId);
-        sd.put("server-id", aicSiteId + "/Server1");
-        sd.put("server-model", "Unknown");
-        sd.put("server-count", getServerCount(aicSiteId));
-        ll.add(sd);
-        return ll;
-    }
-
-    private int getServerCount(String aicSiteId) {
-        int n = jdbcTemplate.queryForInt(GET_SERVER_COUNT_SQL, aicSiteId);
-
-        log.info("Number of servers in " + aicSiteId + ": " + n);
-
-        return n;
-    }
-
-    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VpePortDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VpePortDao.java
deleted file mode 100644
index 1a86c6f..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VpePortDao.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.equip.dao;
-
-import java.util.List;
-import java.util.Map;
-
-public interface VpePortDao {
-
-    List<Map<String, Object>> getVpePortData(String aicSiteId);
-
-    List<Map<String, Object>> getVpePortData(String aicSiteId, String vpeName);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VpePortDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VpePortDaoImpl.java
deleted file mode 100644
index 05d2e76..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VpePortDaoImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.equip.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-
-public class VpePortDaoImpl implements VpePortDao {
-
-    @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(VpePortDaoImpl.class);
-
-    private static final String GET_SQL = "SELECT * FROM VPE_POOL WHERE aic_site_id = ?";
-    private static final String GET2_SQL = "SELECT * FROM VPE_POOL WHERE vpe_name = ?";
-    private static final String GET3_SQL =
-            "SELECT * FROM VPE_POOL WHERE substring(aic_site_id, 1, 8) = substring(?, 1, 8)";
-
-    private JdbcTemplate jdbcTemplate;
-
-    @Override
-    public List<Map<String, Object>> getVpePortData(String aicSiteId) {
-        return jdbcTemplate.query(GET_SQL, new Object[] { aicSiteId }, new VpePortRowMapper());
-    }
-
-    @Override
-    public List<Map<String, Object>> getVpePortData(String aicSiteId, String vpeName) {
-        String sql = vpeName != null ? GET2_SQL : GET3_SQL;
-        Object[] param = new Object[] { vpeName != null ? vpeName : aicSiteId };
-
-        return jdbcTemplate.query(sql, param, new VpePortRowMapper());
-    }
-
-    private static class VpePortRowMapper implements RowMapper<Map<String, Object>> {
-
-        @Override
-        public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
-            Map<String, Object> mm = new HashMap<String, Object>();
-            mm.put("vpe-id", rs.getString("vpe_name"));
-            mm.put("aic-site-id", rs.getString("aic_site_id"));
-            mm.put("availability-zone", rs.getString("availability_zone"));
-            mm.put("image-file-name", rs.getString("image_filename"));
-            mm.put("vendor", rs.getString("vendor"));
-            mm.put("provisioning-status", rs.getString("provisioning_status"));
-            mm.put("physical-interface-name", rs.getString("physical_intf_name"));
-            mm.put("physical-interface-speed", rs.getLong("physical_intf_speed"));
-            mm.put("physical-interface-speed-unit", rs.getString("physical_intf_units"));
-            return mm;
-        }
-    }
-
-    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VplspePortDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VplspePortDao.java
deleted file mode 100644
index 20cb83f..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VplspePortDao.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.equip.dao;
-
-import java.util.List;
-import java.util.Map;
-
-public interface VplspePortDao {
-
-    List<Map<String, Object>> getVplspePortData(String aicSiteId);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VplspePortDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VplspePortDaoImpl.java
deleted file mode 100644
index 6c3d368..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/dao/VplspePortDaoImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.equip.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-
-public class VplspePortDaoImpl implements VplspePortDao {
-
-    @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(VplspePortDaoImpl.class);
-
-    private static final String GET_SQL = "SELECT * FROM VPLSPE_POOL WHERE aic_site_id = ?";
-
-    private JdbcTemplate jdbcTemplate;
-
-    @Override
-    public List<Map<String, Object>> getVplspePortData(String aicSiteId) {
-        List<Map<String, Object>> ll =
-                jdbcTemplate.query(GET_SQL, new Object[] { aicSiteId }, new RowMapper<Map<String, Object>>() {
-
-                    @Override
-                    public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
-                        Map<String, Object> mm = new HashMap<String, Object>();
-                        mm.put("vplspe-id", rs.getString("vplspe_name"));
-                        mm.put("aic-site-id", rs.getString("aic_site_id"));
-                        mm.put("availability-zone", rs.getString("availability_zone"));
-                        mm.put("image-file-name", rs.getString("image_filename"));
-                        mm.put("vendor", rs.getString("vendor"));
-                        mm.put("provisioning-status", rs.getString("provisioning_status"));
-                        mm.put("physical-interface-name", rs.getString("physical_intf_name"));
-                        mm.put("physical-interface-speed", rs.getLong("physical_intf_speed"));
-                        mm.put("physical-interface-speed-unit", rs.getString("physical_intf_units"));
-                        return mm;
-                    }
-                });
-        return ll;
-    }
-
-    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/data/EquipmentData.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/data/EquipmentData.java
deleted file mode 100644
index 15342a6..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/data/EquipmentData.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.equip.data;
-
-import java.util.Map;
-
-public class EquipmentData {
-
-    public String equipmentId;
-    public EquipmentLevel equipmentLevel;
-    public Map<String, Object> data;
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/data/EquipmentLevel.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/data/EquipmentLevel.java
deleted file mode 100644
index c77e368..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/equip/data/EquipmentLevel.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.equip.data;
-
-public enum EquipmentLevel {
-    Port, Device, Server, Site
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/pref/AffinityLinkPref.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/pref/AffinityLinkPref.java
deleted file mode 100644
index 0e510ac..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/pref/AffinityLinkPref.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.pref;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.PreferenceRule;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitResource;
-import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AffinityLinkPref implements PreferenceRule {
-
-    private static final Logger log = LoggerFactory.getLogger(AffinityLinkPref.class);
-
-    private ResourceManager resourceManager;
-    private List<String> affinityLinkIdList;
-
-    public AffinityLinkPref() {
-        // Set default values for affinity link ids (can be overridden by the spring config)
-        affinityLinkIdList = new ArrayList<>();
-        affinityLinkIdList.add("1");
-        affinityLinkIdList.add("2");
-    }
-
-    @Override
-    public int assignOrderNumber(String endPointPosition, ServiceData serviceData, EquipmentData equipData) {
-
-        // This class does not really assign order number, but instead sets the affinity link with the lowest
-        // assigned bandwidth in the equipment data
-
-        String preferedAffinityLinkId = "1";
-        long lowestAssignedBw = Long.MAX_VALUE;
-        for (String affinityLinkId : affinityLinkIdList) {
-            String assetId = equipData.equipmentId + "-" + affinityLinkId;
-            Resource r = resourceManager.getResource("Bandwidth", assetId);
-            if (r != null) {
-                LimitResource ll = (LimitResource) r;
-                if (ll.used < lowestAssignedBw) {
-                    lowestAssignedBw = ll.used;
-                    preferedAffinityLinkId = affinityLinkId;
-                }
-                log.info("Assigned bandwidth on affinity link: " + assetId + ": " + ll.used);
-            }
-        }
-
-        equipData.data.put("affinity-link", preferedAffinityLinkId);
-
-        log.info("Prefered affinity link for " + equipData.equipmentId + ": " + preferedAffinityLinkId);
-
-        return 0;
-    }
-
-    public void setResourceManager(ResourceManager resourceManager) {
-        this.resourceManager = resourceManager;
-    }
-
-    public void setAffinityLinkIdList(List<String> affinityLinkIdList) {
-        this.affinityLinkIdList = affinityLinkIdList;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/pref/EvcExistingVrfPref.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/pref/EvcExistingVrfPref.java
deleted file mode 100644
index 559f796..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/pref/EvcExistingVrfPref.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.pref;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.PreferenceRule;
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManager;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
-import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class EvcExistingVrfPref implements PreferenceRule {
-
-    private static final Logger log = LoggerFactory.getLogger(EvcExistingVrfPref.class);
-
-    private ResourceManager resourceManager;
-
-    @Override
-    public int assignOrderNumber(String endPointPosition, ServiceData serviceData, EquipmentData equipData) {
-        String vrfName = (String) serviceData.data.get("vrf-name");
-        if (vrfName == null)
-            return 0;
-
-        Resource r = resourceManager.getResource("VRF", equipData.equipmentId);
-        if (r != null && r.allocationItems != null)
-            for (AllocationItem ai : r.allocationItems)
-                if (ai.resourceShareGroupList.contains(vrfName)) {
-                    log.info("VRF for VPN: " + vrfName + " found on VPE: " + equipData.equipmentId);
-                    return 1;
-                }
-
-        log.info("VRF for VPN: " + vrfName + " NOT found on VPE: " + equipData.equipmentId);
-        return 2;
-    }
-
-    public void setResourceManager(ResourceManager resourceManager) {
-        this.resourceManager = resourceManager;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/AicSiteReader.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/AicSiteReader.java
deleted file mode 100644
index 1faf254..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/AicSiteReader.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.reader;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.comp.EquipmentReader;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
-
-public class AicSiteReader implements EquipmentReader {
-
-    @Override
-    public List<EquipmentData> readEquipment(Map<String, Object> equipmentConstraints) {
-        String aicSiteId = (String) equipmentConstraints.get("aic-site-id");
-
-        EquipmentData equipData = new EquipmentData();
-        equipData.equipmentLevel = EquipmentLevel.Site;
-        equipData.equipmentId = aicSiteId;
-        equipData.data = new HashMap<String, Object>();
-
-        List<EquipmentData> equipList = new ArrayList<>();
-        equipList.add(equipData);
-
-        return equipList;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/UplinkCircuitReader.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/UplinkCircuitReader.java
deleted file mode 100644
index 4943c50..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/UplinkCircuitReader.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.reader;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.comp.EquipmentReader;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
-
-public class UplinkCircuitReader implements EquipmentReader {
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public List<EquipmentData> readEquipment(Map<String, Object> equipmentConstraints) {
-        List<EquipmentData> equipList = new ArrayList<>();
-
-        List<Map<String, Object>> uplinkCircuitList =
-                (List<Map<String, Object>>) equipmentConstraints.get("uplink-circuit-list");
-        if (uplinkCircuitList == null || uplinkCircuitList.isEmpty())
-            return equipList;
-
-        for (Map<String, Object> uplinkCircuit : uplinkCircuitList) {
-            EquipmentData equipData = new EquipmentData();
-            equipData.equipmentLevel = EquipmentLevel.Device;
-            equipData.equipmentId = (String) uplinkCircuit.get("uplink-circuit-id");
-            equipData.data = uplinkCircuit;
-            equipList.add(equipData);
-        }
-
-        return equipList;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/VnfReader.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/VnfReader.java
deleted file mode 100644
index d5d3d00..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/VnfReader.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.reader;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.comp.EquipmentReader;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
-
-public class VnfReader implements EquipmentReader {
-
-    @Override
-    public List<EquipmentData> readEquipment(Map<String, Object> equipmentConstraints) {
-        String vnfName = (String) equipmentConstraints.get("vnf-name");
-
-        EquipmentData equipData = new EquipmentData();
-        equipData.equipmentLevel = EquipmentLevel.Device;
-        equipData.equipmentId = vnfName;
-        equipData.data = new HashMap<String, Object>();
-
-        List<EquipmentData> equipList = new ArrayList<>();
-        equipList.add(equipData);
-
-        return equipList;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/VpePortReader.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/VpePortReader.java
deleted file mode 100644
index 59328f9..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/reader/VpePortReader.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.reader;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.comp.EquipmentReader;
-import org.onap.ccsdk.sli.adaptors.ra.equip.dao.VpePortDao;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
-
-public class VpePortReader implements EquipmentReader {
-
-    private VpePortDao vpePortDao;
-
-    @Override
-    public List<EquipmentData> readEquipment(Map<String, Object> equipmentConstraints) {
-        String clli = (String) equipmentConstraints.get("clli");
-        String vpeName = (String) equipmentConstraints.get("vpe-name");
-        if (vpeName == null) {
-            String equipmentId = (String) equipmentConstraints.get("equipment-id");
-            if (equipmentId != null) {
-                int i1 = equipmentId.indexOf('/');
-                if (i1 > 0)
-                    equipmentId = equipmentId.substring(0, i1);
-                vpeName = equipmentId;
-            }
-        }
-
-        List<Map<String, Object>> vpeDataList = vpePortDao.getVpePortData(clli, vpeName);
-
-        List<EquipmentData> equipList = new ArrayList<>();
-        for (Map<String, Object> vpeData : vpeDataList) {
-            EquipmentData equipData = new EquipmentData();
-            equipData.equipmentLevel = EquipmentLevel.Port;
-            equipData.equipmentId =
-                    (String) vpeData.get("vpe-id") + '/' + (String) vpeData.get("physical-interface-name");
-            equipData.data = vpeData;
-
-            equipList.add(equipData);
-        }
-
-        return equipList;
-    }
-
-    public void setVpePortDao(VpePortDao vpePortDao) {
-        this.vpePortDao = vpePortDao;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/comp/AllocationRequestBuilder.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/comp/AllocationRequestBuilder.java
deleted file mode 100644
index e4361f1..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/comp/AllocationRequestBuilder.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.comp;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.ra.rule.data.ThresholdStatus;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationOutcome;
-
-public interface AllocationRequestBuilder {
-
-    AllocationRequest buildAllocationRequest(
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change);
-
-    ThresholdStatus getThresholdStatus(
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            LimitAllocationOutcome limitAllocationOutcome);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/comp/AllocationRequestBuilderImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/comp/AllocationRequestBuilderImpl.java
deleted file mode 100644
index ab0ef3b..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/comp/AllocationRequestBuilderImpl.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.comp;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.ra.comp.ServiceData;
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentData;
-import org.onap.ccsdk.sli.adaptors.ra.rule.dao.RangeRuleDao;
-import org.onap.ccsdk.sli.adaptors.ra.rule.dao.ResourceRuleDao;
-import org.onap.ccsdk.sli.adaptors.ra.rule.data.RangeRule;
-import org.onap.ccsdk.sli.adaptors.ra.rule.data.ResourceRule;
-import org.onap.ccsdk.sli.adaptors.ra.rule.data.ResourceThreshold;
-import org.onap.ccsdk.sli.adaptors.ra.rule.data.ThresholdStatus;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationAction;
-import org.onap.ccsdk.sli.adaptors.rm.data.AllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationOutcome;
-import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.MultiResourceAllocationRequest;
-import org.onap.ccsdk.sli.adaptors.rm.data.RangeAllocationRequest;
-import org.onap.ccsdk.sli.adaptors.util.expr.ExpressionEvaluator;
-import org.onap.ccsdk.sli.adaptors.util.str.StrUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AllocationRequestBuilderImpl implements AllocationRequestBuilder {
-
-    private static final Logger log = LoggerFactory.getLogger(AllocationRequestBuilderImpl.class);
-
-    private ResourceRuleDao resourceRuleDao;
-    private RangeRuleDao rangeRuleDao;
-
-    @Override
-    public AllocationRequest buildAllocationRequest(
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        List<ResourceRule> resourceRuleList = resourceRuleDao.getResourceRules(serviceData.serviceModel,
-                serviceData.endPointPosition, equipmentData.equipmentLevel);
-        List<RangeRule> rangeRuleList = rangeRuleDao.getRangeRules(serviceData.serviceModel,
-                serviceData.endPointPosition, equipmentData.equipmentLevel);
-        if (resourceRuleList.isEmpty() && rangeRuleList.isEmpty())
-            return null;
-        if (resourceRuleList.size() == 1 && rangeRuleList.isEmpty())
-            return buildAllocationRequest(resourceRuleList.get(0), serviceData, equipmentData, checkOnly, change);
-
-        if (resourceRuleList.isEmpty() && rangeRuleList.size() == 1)
-            return buildAllocationRequest(rangeRuleList.get(0), serviceData, equipmentData, checkOnly, change);
-
-        MultiResourceAllocationRequest ar = new MultiResourceAllocationRequest();
-        ar.stopOnFirstFailure = false;
-        ar.allocationRequestList = new ArrayList<AllocationRequest>();
-        for (ResourceRule rr : resourceRuleList) {
-            AllocationRequest ar1 = buildAllocationRequest(rr, serviceData, equipmentData, checkOnly, change);
-            ar.allocationRequestList.add(ar1);
-        }
-        for (RangeRule rr : rangeRuleList) {
-            AllocationRequest ar1 = buildAllocationRequest(rr, serviceData, equipmentData, checkOnly, change);
-            ar.allocationRequestList.add(ar1);
-        }
-        return ar;
-    }
-
-    private AllocationRequest buildAllocationRequest(
-            ResourceRule resourceRule,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        StrUtil.info(log, resourceRule);
-
-        LimitAllocationRequest ar = new LimitAllocationRequest();
-        ar.resourceSetId = serviceData.resourceSetId;
-        ar.resourceUnionId = serviceData.resourceUnionId;
-        ar.resourceName = resourceRule.resourceName;
-        ar.assetId = equipmentData.equipmentId;
-        ar.missingResourceAction = AllocationAction.Succeed_Allocate;
-        ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
-        ar.replace = true;
-        ar.strict = false;
-        ar.checkLimit = ExpressionEvaluator.evalLong(
-                change ? resourceRule.hardLimitExpression : resourceRule.softLimitExpression, equipmentData.data);
-        ar.checkCount = ExpressionEvaluator.evalLong(resourceRule.allocationExpression, serviceData.data);
-        ar.allocateCount = checkOnly ? 0 : ar.checkCount;
-        return ar;
-    }
-
-    private AllocationRequest buildAllocationRequest(
-            RangeRule rangeRule,
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            boolean checkOnly,
-            boolean change) {
-        StrUtil.info(log, rangeRule);
-
-        RangeAllocationRequest ar = new RangeAllocationRequest();
-        ar.resourceSetId = serviceData.resourceSetId;
-        ar.resourceUnionId = serviceData.resourceUnionId;
-        ar.resourceName = rangeRule.rangeName;
-        ar.assetId = equipmentData.equipmentId;
-        ar.missingResourceAction = AllocationAction.Succeed_Allocate;
-        ar.expiredResourceAction = AllocationAction.Succeed_Allocate;
-        ar.replace = true;
-        ar.check = true;
-        ar.allocate = !checkOnly;
-        ar.checkMin = rangeRule.minValue;
-        ar.checkMax = rangeRule.maxValue;
-        return ar;
-    }
-
-    @Override
-    public ThresholdStatus getThresholdStatus(
-            ServiceData serviceData,
-            EquipmentData equipmentData,
-            LimitAllocationOutcome limitAllocationOutcome) {
-        ResourceRule rr = resourceRuleDao.getResourceRule(serviceData.serviceModel, serviceData.endPointPosition,
-                equipmentData.equipmentLevel, limitAllocationOutcome.request.resourceName);
-        if (rr == null || rr.thresholdList == null || rr.thresholdList.isEmpty())
-            return null;
-
-        ThresholdStatus thresholdStatus = null;
-        long maxThresholdValue = 0;
-        for (ResourceThreshold th : rr.thresholdList) {
-            long thresholdValue = ExpressionEvaluator.evalLong(th.expression, equipmentData.data);
-
-            if (thresholdValue > maxThresholdValue) {
-                maxThresholdValue = thresholdValue;
-
-                if (limitAllocationOutcome.used >= thresholdValue) {
-                    thresholdStatus = new ThresholdStatus();
-                    thresholdStatus.resourceRule = rr;
-                    thresholdStatus.resourceThreshold = th;
-                    thresholdStatus.limitValue = limitAllocationOutcome.limit;
-                    thresholdStatus.thresholdValue = thresholdValue;
-                    thresholdStatus.used = limitAllocationOutcome.used;
-                    thresholdStatus.lastAdded = limitAllocationOutcome.allocatedCount;
-                }
-            }
-        }
-
-        return thresholdStatus;
-    }
-
-    public void setResourceRuleDao(ResourceRuleDao resourceRuleDao) {
-        this.resourceRuleDao = resourceRuleDao;
-    }
-
-    public void setRangeRuleDao(RangeRuleDao rangeRuleDao) {
-        this.rangeRuleDao = rangeRuleDao;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxPortSpeedDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxPortSpeedDao.java
deleted file mode 100644
index 8adf251..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxPortSpeedDao.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.dao;
-
-public interface MaxPortSpeedDao {
-
-    // Returns max speed in kbps
-    long getMaxPortSpeed(String imageFile, String endPointPosition, String interfaceName);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxPortSpeedDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxPortSpeedDaoImpl.java
deleted file mode 100644
index 481c6f4..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxPortSpeedDaoImpl.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.util.speed.SpeedUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-
-public class MaxPortSpeedDaoImpl implements MaxPortSpeedDao {
-
-    @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(MaxPortSpeedDaoImpl.class);
-
-    private final static String GET_SQL =
-            "SELECT * FROM MAX_PORT_SPEED WHERE image_file_name = ? AND end_point_position = ? AND interface_name = ?";
-
-    private JdbcTemplate jdbcTemplate;
-    private long defaultMaxPortSpeed = 5000000;
-    private SpeedUtil speedUtil;
-
-    @Override
-    public long getMaxPortSpeed(String imageFile, String endPointPosition, String interfaceName) {
-        List<MaxPortSpeed> maxPortSpeedList =
-                jdbcTemplate.query(GET_SQL, new Object[] { imageFile, endPointPosition, interfaceName },
-                        new RowMapper<MaxPortSpeed>() {
-
-                            @Override
-                            public MaxPortSpeed mapRow(ResultSet rs, int rowNum) throws SQLException {
-                                MaxPortSpeed mps = new MaxPortSpeed();
-                                mps.maxSpeed = rs.getLong("max_speed");
-                                mps.unit = rs.getString("unit");
-                                return mps;
-                            }
-                        });
-
-        if (maxPortSpeedList.isEmpty())
-            return defaultMaxPortSpeed;
-
-        MaxPortSpeed mps = maxPortSpeedList.get(0);
-        return speedUtil.convertToKbps(mps.maxSpeed, mps.unit);
-    }
-
-    private static class MaxPortSpeed {
-
-        public long maxSpeed;
-        public String unit;
-    }
-
-    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-
-    public void setDefaultMaxPortSpeed(long defaultMaxPortSpeed) {
-        this.defaultMaxPortSpeed = defaultMaxPortSpeed;
-    }
-
-    public void setSpeedUtil(SpeedUtil speedUtil) {
-        this.speedUtil = speedUtil;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxServerSpeedDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxServerSpeedDao.java
deleted file mode 100644
index 607cc0a..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxServerSpeedDao.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.dao;
-
-public interface MaxServerSpeedDao {
-
-    // Returns max speed in kbps
-    long getMaxServerSpeed(String serverModel, int evcCount);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxServerSpeedDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxServerSpeedDaoImpl.java
deleted file mode 100644
index 445166b..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/MaxServerSpeedDaoImpl.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.util.speed.SpeedUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-
-public class MaxServerSpeedDaoImpl implements MaxServerSpeedDao {
-
-    @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(MaxServerSpeedDaoImpl.class);
-
-    private final static String GET_SQL =
-            "SELECT * FROM MAX_SERVER_SPEED\n" +
-            "WHERE (server_model = ? OR server_model = 'ALL') AND evc_count >= ?\n" +
-            "ORDER BY evc_count";
-
-    private JdbcTemplate jdbcTemplate;
-    private long defaultMaxServerSpeed = 1600000;
-    private SpeedUtil speedUtil;
-
-    @Override
-    public long getMaxServerSpeed(String serverModel, int evcCount) {
-        List<MaxServerSpeed> maxServerSpeedList =
-                jdbcTemplate.query(GET_SQL, new Object[] { serverModel, evcCount }, new RowMapper<MaxServerSpeed>() {
-
-                    @Override
-                    public MaxServerSpeed mapRow(ResultSet rs, int rowNum) throws SQLException {
-                        MaxServerSpeed mps = new MaxServerSpeed();
-                        mps.maxSpeed = rs.getLong("max_speed");
-                        mps.unit = rs.getString("unit");
-                        return mps;
-                    }
-                });
-
-        if (maxServerSpeedList.isEmpty())
-            return defaultMaxServerSpeed;
-
-        MaxServerSpeed mps = maxServerSpeedList.get(0);
-        return speedUtil.convertToKbps(mps.maxSpeed, mps.unit);
-    }
-
-    private static class MaxServerSpeed {
-
-        public long maxSpeed;
-        public String unit;
-    }
-
-    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-
-    public void setDefaultMaxServerSpeed(long defaultMaxServerSpeed) {
-        this.defaultMaxServerSpeed = defaultMaxServerSpeed;
-    }
-
-    public void setSpeedUtil(SpeedUtil speedUtil) {
-        this.speedUtil = speedUtil;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ParameterDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ParameterDao.java
deleted file mode 100644
index 724ee19..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ParameterDao.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.dao;
-
-public interface ParameterDao {
-
-    String getParameter(String name);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ParameterDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ParameterDaoImpl.java
deleted file mode 100644
index eb061f9..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ParameterDaoImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-public class ParameterDaoImpl implements ParameterDao {
-
-    private static final Logger log = LoggerFactory.getLogger(ParameterDaoImpl.class);
-
-    private final static String GET_SQL = "SELECT * FROM PARAMETERS WHERE name = ?";
-
-    private JdbcTemplate jdbcTemplate;
-
-    @Override
-    public String getParameter(String name) {
-        List<Map<String, Object>> ll = jdbcTemplate.queryForList(GET_SQL, name);
-
-        if (ll == null || ll.isEmpty()) {
-            log.info("Parameter: " + name + " not found in DB");
-            return null;
-        }
-
-        String v = (String) ll.get(0).get("value");
-        log.info("Parameter from DB: " + name + "='" + v + "'");
-
-        return v;
-    }
-
-    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/RangeRuleDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/RangeRuleDao.java
index ad1498d..a7fcb61 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/RangeRuleDao.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/RangeRuleDao.java
@@ -8,9 +8,9 @@
  * 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.
@@ -22,11 +22,9 @@
 package org.onap.ccsdk.sli.adaptors.ra.rule.dao;
 
 import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
 import org.onap.ccsdk.sli.adaptors.ra.rule.data.RangeRule;
 
 public interface RangeRuleDao {
 
-    List<RangeRule> getRangeRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel);
+    List<RangeRule> getRangeRules(String serviceModel, String equipLevel);
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/RangeRuleDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/RangeRuleDaoImpl.java
index 29a4aea..825261e 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/RangeRuleDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/RangeRuleDaoImpl.java
@@ -8,9 +8,9 @@
  * 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.
@@ -24,8 +24,6 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
 import org.onap.ccsdk.sli.adaptors.ra.rule.data.RangeRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,30 +35,28 @@
     @SuppressWarnings("unused")
     private static final Logger log = LoggerFactory.getLogger(RangeRuleDaoImpl.class);
 
-    private static final String GET_SQL =
-            "SELECT * FROM RANGE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ?";
+    private static final String GET_SQL = "SELECT * FROM RANGE_RULE WHERE service_model = ? AND equipment_level = ?";
 
     private JdbcTemplate jdbcTemplate;
 
     @Override
-    public List<RangeRule> getRangeRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel) {
+    public List<RangeRule> getRangeRules(String serviceModel, String equipLevel) {
         List<RangeRule> rangeRuleList =
-                jdbcTemplate.query(GET_SQL, new Object[] { serviceModel, endPointPosition, equipLevel.toString() },
-                        new RowMapper<RangeRule>() {
+                jdbcTemplate.query(GET_SQL, new Object[] {serviceModel, equipLevel}, new RowMapper<RangeRule>() {
 
-                            @Override
-                            public RangeRule mapRow(ResultSet rs, int rowNum) throws SQLException {
-                                RangeRule rl = new RangeRule();
-                                rl.id = rs.getLong("range_rule_id");
-                                rl.rangeName = rs.getString("range_name");
-                                rl.serviceModel = rs.getString("service_model");
-                                rl.endPointPosition = rs.getString("end_point_position");
-                                rl.equipmentLevel = rs.getString("equipment_level");
-                                rl.minValue = rs.getInt("min_value");
-                                rl.maxValue = rs.getInt("max_value");
-                                return rl;
-                            }
-                        });
+                    @Override
+                    public RangeRule mapRow(ResultSet rs, int rowNum) throws SQLException {
+                        RangeRule rl = new RangeRule();
+                        rl.id = rs.getLong("range_rule_id");
+                        rl.rangeName = rs.getString("range_name");
+                        rl.serviceModel = rs.getString("service_model");
+                        rl.endPointPosition = rs.getString("end_point_position");
+                        rl.equipmentLevel = rs.getString("equipment_level");
+                        rl.minValue = rs.getInt("min_value");
+                        rl.maxValue = rs.getInt("max_value");
+                        return rl;
+                    }
+                });
         return rangeRuleList;
     }
 
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ResourceRuleDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ResourceRuleDao.java
index 9d879fb..54fdcbc 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ResourceRuleDao.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ResourceRuleDao.java
@@ -8,9 +8,9 @@
  * 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.
@@ -22,17 +22,11 @@
 package org.onap.ccsdk.sli.adaptors.ra.rule.dao;
 
 import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
 import org.onap.ccsdk.sli.adaptors.ra.rule.data.ResourceRule;
 
 public interface ResourceRuleDao {
 
-    List<ResourceRule> getResourceRules(String serviceModel, String endPointPosition, EquipmentLevel equipLevel);
+    List<ResourceRule> getResourceRules(String serviceModel, String equipLevel);
 
-    ResourceRule getResourceRule(
-            String serviceModel,
-            String endPointPosition,
-            EquipmentLevel equipLevel,
-            String resourceName);
+    ResourceRule getResourceRule(String serviceModel, String endPointPosition, String equipLevel, String resourceName);
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ResourceRuleDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ResourceRuleDaoImpl.java
index 0e765f3..451dc57 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ResourceRuleDaoImpl.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/ResourceRuleDaoImpl.java
@@ -8,9 +8,9 @@
  * 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.
@@ -24,8 +24,6 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.ra.equip.data.EquipmentLevel;
 import org.onap.ccsdk.sli.adaptors.ra.rule.data.ResourceRule;
 import org.onap.ccsdk.sli.adaptors.ra.rule.data.ResourceThreshold;
 import org.slf4j.Logger;
@@ -39,7 +37,7 @@
     private static final Logger log = LoggerFactory.getLogger(ResourceRuleDaoImpl.class);
 
     private static final String GET1_SQL =
-            "SELECT * FROM RESOURCE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ?";
+            "SELECT * FROM RESOURCE_RULE WHERE service_model = ? AND equipment_level = ?";
     private static final String GET2_SQL =
             "SELECT * FROM RESOURCE_RULE WHERE service_model = ? AND end_point_position = ? AND equipment_level = ? AND resource_name = ?";
     private static final String THRESHOLD_SQL = "SELECT * FROM RESOURCE_THRESHOLD WHERE resource_rule_id = ?";
@@ -49,34 +47,29 @@
     ResourceThresholdRowMapper resourceThresholdRowMapper = new ResourceThresholdRowMapper();
 
     @Override
-    public List<ResourceRule> getResourceRules(
-            String serviceModel,
-            String endPointPosition,
-            EquipmentLevel equipLevel) {
-        List<ResourceRule> resourceRuleList = jdbcTemplate.query(GET1_SQL,
-                new Object[] { serviceModel, endPointPosition, equipLevel.toString() }, resourceRuleRowMapper);
+    public List<ResourceRule> getResourceRules(String serviceModel, String equipLevel) {
+        List<ResourceRule> resourceRuleList =
+                jdbcTemplate.query(GET1_SQL, new Object[] {serviceModel, equipLevel}, resourceRuleRowMapper);
 
-        for (ResourceRule rr : resourceRuleList)
-            rr.thresholdList = jdbcTemplate.query(THRESHOLD_SQL, new Object[] { rr.id }, resourceThresholdRowMapper);
+        for (ResourceRule rr : resourceRuleList) {
+            rr.thresholdList = jdbcTemplate.query(THRESHOLD_SQL, new Object[] {rr.id}, resourceThresholdRowMapper);
+        }
 
         return resourceRuleList;
     }
 
     @Override
-    public ResourceRule getResourceRule(
-            String serviceModel,
-            String endPointPosition,
-            EquipmentLevel equipLevel,
+    public ResourceRule getResourceRule(String serviceModel, String endPointPosition, String equipLevel,
             String resourceName) {
         List<ResourceRule> resourceRuleList = jdbcTemplate.query(GET2_SQL,
-                new Object[] { serviceModel, endPointPosition, equipLevel.toString(), resourceName },
-                resourceRuleRowMapper);
+                new Object[] {serviceModel, endPointPosition, equipLevel, resourceName}, resourceRuleRowMapper);
 
-        if (resourceRuleList == null || resourceRuleList.isEmpty())
+        if (resourceRuleList == null || resourceRuleList.isEmpty()) {
             return null;
+        }
 
         ResourceRule rr = resourceRuleList.get(0);
-        rr.thresholdList = jdbcTemplate.query(THRESHOLD_SQL, new Object[] { rr.id }, resourceThresholdRowMapper);
+        rr.thresholdList = jdbcTemplate.query(THRESHOLD_SQL, new Object[] {rr.id}, resourceThresholdRowMapper);
 
         return rr;
     }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/VpeLockDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/VpeLockDao.java
deleted file mode 100644
index b51cb2e..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/VpeLockDao.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.dao;
-
-public interface VpeLockDao {
-
-    String getVpeLock(String vpeName);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/VpeLockDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/VpeLockDaoImpl.java
deleted file mode 100644
index 443f506..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/rule/dao/VpeLockDaoImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.rule.dao;
-
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-public class VpeLockDaoImpl implements VpeLockDao {
-
-    @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(VpeLockDaoImpl.class);
-
-    private final static String GET_SQL = "SELECT vpn_lock FROM VPE_LOCK WHERE vpe_name = ?";
-
-    private JdbcTemplate jdbcTemplate;
-
-    @Override
-    public String getVpeLock(String vpeName) {
-        List<String> ll = jdbcTemplate.queryForList(GET_SQL, String.class, vpeName);
-        return ll != null && !ll.isEmpty() ? ll.get(0) : null;
-    }
-
-    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/dao/ServiceResourceDao.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/dao/ServiceResourceDao.java
deleted file mode 100644
index 9f923a5..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/dao/ServiceResourceDao.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.service.dao;
-
-import org.onap.ccsdk.sli.adaptors.ra.service.data.ServiceResource;
-import org.onap.ccsdk.sli.adaptors.ra.service.data.ServiceStatus;
-
-public interface ServiceResourceDao {
-
-    ServiceResource getServiceResource(String serviceInstanceId, ServiceStatus serviceStatus);
-
-    void addServiceResource(ServiceResource serviceResource);
-
-    void updateServiceResource(ServiceResource serviceResource);
-
-    void deleteServiceResource(String serviceInstanceId, ServiceStatus serviceStatus);
-
-    void updateServiceStatus(String serviceInstanceId, ServiceStatus serviceStatus, ServiceStatus newServiceStatus);
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/dao/ServiceResourceDaoImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/dao/ServiceResourceDaoImpl.java
deleted file mode 100644
index b0e2046..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/dao/ServiceResourceDaoImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.service.dao;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.onap.ccsdk.sli.adaptors.ra.service.data.ServiceResource;
-import org.onap.ccsdk.sli.adaptors.ra.service.data.ServiceStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-
-public class ServiceResourceDaoImpl implements ServiceResourceDao {
-
-    @SuppressWarnings("unused")
-    private static final Logger log = LoggerFactory.getLogger(ServiceResourceDaoImpl.class);
-
-    private static final String GET_SQL =
-            "SELECT * FROM SERVICE_RESOURCE WHERE service_instance_id = ? AND service_status = ?";
-
-    private static final String ADD_SQL = "INSERT INTO SERVICE_RESOURCE (\n"
-            + "  service_instance_id, service_status, service_change_number, resource_set_id, resource_union_id)\n"
-            + "VALUES (?, ?, ?, ?, ?)";
-
-    private static final String UPDATE_SQL =
-            "UPDATE SERVICE_RESOURCE SET service_change_number = ?, resource_set_id = ?\n"
-                    + "WHERE service_instance_id = ? AND service_status = ?";
-
-    private static final String DELETE_SQL =
-            "DELETE FROM SERVICE_RESOURCE WHERE service_instance_id = ? AND service_status = ?";
-
-    private static final String UPDATE_STATUS_SQL =
-            "UPDATE SERVICE_RESOURCE SET service_status = ? WHERE service_instance_id = ? AND service_status = ?";
-
-    private JdbcTemplate jdbcTemplate;
-
-    @Override
-    public ServiceResource getServiceResource(final String serviceInstanceId, final ServiceStatus serviceStatus) {
-        List<ServiceResource> serviceResourceList =
-                jdbcTemplate.query(GET_SQL, new Object[] { serviceInstanceId, serviceStatus.toString() },
-                        new RowMapper<ServiceResource>() {
-
-                            @Override
-                            public ServiceResource mapRow(ResultSet rs, int rowNum) throws SQLException {
-                                ServiceResource sr = new ServiceResource();
-                                sr.id = rs.getLong("service_resource_id");
-                                sr.serviceInstanceId = serviceInstanceId;
-                                sr.serviceStatus = serviceStatus;
-                                sr.serviceChangeNumber = rs.getInt("service_change_number");
-                                sr.resourceSetId = rs.getString("resource_set_id");
-                                sr.resourceUnionId = rs.getString("resource_union_id");
-                                return sr;
-                            }
-                        });
-        if (serviceResourceList.isEmpty())
-            return null;
-        return serviceResourceList.get(0);
-    }
-
-    @Override
-    public void addServiceResource(ServiceResource serviceResource) {
-        jdbcTemplate.update(ADD_SQL, serviceResource.serviceInstanceId, serviceResource.serviceStatus.toString(),
-                serviceResource.serviceChangeNumber, serviceResource.resourceSetId, serviceResource.resourceUnionId);
-    }
-
-    @Override
-    public void updateServiceResource(ServiceResource serviceResource) {
-        jdbcTemplate.update(UPDATE_SQL, serviceResource.serviceChangeNumber, serviceResource.resourceSetId,
-                serviceResource.serviceInstanceId, serviceResource.serviceStatus.toString());
-    }
-
-    @Override
-    public void deleteServiceResource(String serviceInstanceId, ServiceStatus serviceStatus) {
-        jdbcTemplate.update(DELETE_SQL, serviceInstanceId, serviceStatus.toString());
-    }
-
-    @Override
-    public void updateServiceStatus(
-            String serviceInstanceId,
-            ServiceStatus serviceStatus,
-            ServiceStatus newServiceStatus) {
-        jdbcTemplate.update(UPDATE_STATUS_SQL, newServiceStatus.toString(), serviceInstanceId, serviceStatus.toString());
-    }
-
-    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/data/ServiceResource.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/data/ServiceResource.java
deleted file mode 100644
index 519e791..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/data/ServiceResource.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.service.data;
-
-public class ServiceResource {
-
-    public long id;
-    public String serviceInstanceId;
-    public ServiceStatus serviceStatus;
-    public int serviceChangeNumber;
-    public String resourceSetId;
-    public String resourceUnionId;
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/data/ServiceStatus.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/data/ServiceStatus.java
deleted file mode 100644
index 9fd1b37..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/service/data/ServiceStatus.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.ra.service.data;
-
-public enum ServiceStatus {
-
-    Active, Pending
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
index bda496a..3544075 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
@@ -8,9 +8,9 @@
  * 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.
@@ -29,7 +29,6 @@
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
-
 import org.onap.ccsdk.sli.adaptors.lock.comp.LockHelper;
 import org.onap.ccsdk.sli.adaptors.lock.comp.ResourceLockedException;
 import org.onap.ccsdk.sli.adaptors.lock.comp.SynchronizedFunction;
@@ -66,22 +65,20 @@
 
     private ResourceDao resourceDao;
 
-    private String applicationId;
     private AllocationRequest request;
     private AllocationOutcome outcome;
 
-    private List<Resource> updateList = new ArrayList<Resource>();
+    private List<Resource> updateList = new ArrayList<>();
 
-    public AllocationFunction(LockHelper lockHelper, ResourceDao resourceDao, String applicationId,
-            AllocationRequest request, int lockTimeout) {
+    public AllocationFunction(LockHelper lockHelper, ResourceDao resourceDao, AllocationRequest request,
+            int lockTimeout) {
         super(lockHelper, getLockNames(request), lockTimeout);
-        this.applicationId = applicationId;
         this.resourceDao = resourceDao;
         this.request = request;
     }
 
     private static Collection<String> getLockNames(AllocationRequest request) {
-        Set<String> lockResourceNames = new HashSet<String>();
+        Set<String> lockResourceNames = new HashSet<>();
         addLockNames(lockResourceNames, request);
         return lockResourceNames;
     }
@@ -89,36 +86,47 @@
     private static void addLockNames(Set<String> lockResourceNames, AllocationRequest request) {
         if (request instanceof MultiAssetAllocationRequest) {
             MultiAssetAllocationRequest req = (MultiAssetAllocationRequest) request;
-            if (req.assetIdList != null)
+            if (req.assetIdList != null) {
                 lockResourceNames.addAll(req.assetIdList);
+            }
         } else if (request instanceof MultiResourceAllocationRequest) {
             MultiResourceAllocationRequest req = (MultiResourceAllocationRequest) request;
-            if (req.allocationRequestList != null)
-                for (AllocationRequest request1 : req.allocationRequestList)
+            if (req.allocationRequestList != null) {
+                for (AllocationRequest request1 : req.allocationRequestList) {
                     addLockNames(lockResourceNames, request1);
-        } else if (request.assetId != null)
+                }
+            }
+        } else if (request.assetId != null) {
             lockResourceNames.add(request.assetId);
+        }
     }
 
     @Override
     public void _exec() throws ResourceLockedException {
         outcome = allocate(request);
-        if (outcome.status == AllocationStatus.Success)
-            for (Resource r : updateList)
+        if (outcome.status == AllocationStatus.Success) {
+            for (Resource r : updateList) {
                 resourceDao.saveResource(r);
+            }
+        }
     }
 
     private AllocationOutcome allocate(AllocationRequest allocationRequest) throws ResourceLockedException {
-        if (allocationRequest instanceof MultiAssetAllocationRequest)
+        if (allocationRequest instanceof MultiAssetAllocationRequest) {
             return allocateMultiAsset((MultiAssetAllocationRequest) allocationRequest);
-        if (allocationRequest instanceof MultiResourceAllocationRequest)
+        }
+        if (allocationRequest instanceof MultiResourceAllocationRequest) {
             return allocateMultiResource((MultiResourceAllocationRequest) allocationRequest);
-        if (allocationRequest instanceof LimitAllocationRequest)
+        }
+        if (allocationRequest instanceof LimitAllocationRequest) {
             return allocateLimit((LimitAllocationRequest) allocationRequest);
-        if (allocationRequest instanceof LabelAllocationRequest)
+        }
+        if (allocationRequest instanceof LabelAllocationRequest) {
             return allocateLabel((LabelAllocationRequest) allocationRequest);
-        if (allocationRequest instanceof RangeAllocationRequest)
+        }
+        if (allocationRequest instanceof RangeAllocationRequest) {
             return allocateRange((RangeAllocationRequest) allocationRequest);
+        }
         return null;
     }
 
@@ -130,16 +138,18 @@
     private MultiResourceAllocationOutcome allocateMultiResource(MultiResourceAllocationRequest req) {
         MultiResourceAllocationOutcome out = new MultiResourceAllocationOutcome();
         out.request = req;
-        out.allocationOutcomeList = new ArrayList<AllocationOutcome>();
+        out.allocationOutcomeList = new ArrayList<>();
         out.status = AllocationStatus.Success;
 
-        if (req.allocationRequestList != null)
+        if (req.allocationRequestList != null) {
             for (AllocationRequest req1 : req.allocationRequestList) {
                 AllocationOutcome out1 = allocate(req1);
                 out.allocationOutcomeList.add(out1);
-                if (out1.status != AllocationStatus.Success)
+                if (out1.status != AllocationStatus.Success) {
                     out.status = AllocationStatus.Failure;
+                }
             }
+        }
 
         return out;
     }
@@ -167,11 +177,12 @@
         if (LimitUtil.checkLimit(l, req)) {
             out.status = AllocationStatus.Success;
             if (req.allocateCount > 0) {
-                out.allocatedCount = LimitUtil.allocateLimit(l, req, applicationId);
+                out.allocatedCount = LimitUtil.allocateLimit(l, req);
                 updateList.add(l);
             }
-        } else
+        } else {
             out.status = AllocationStatus.Failure;
+        }
 
         out.used = l.used;
         out.limit = req.checkLimit;
@@ -204,11 +215,12 @@
             out.status = AllocationStatus.Success;
             out.currentLabel = l.label;
             if (req.allocate) {
-                out.allocatedLabel = LabelUtil.allocateLabel(l, req, applicationId);
+                out.allocatedLabel = LabelUtil.allocateLabel(l, req);
                 updateList.add(l);
             }
-        } else
+        } else {
             out.status = AllocationStatus.Failure;
+        }
 
         return out;
     }
@@ -242,18 +254,19 @@
             if (req.requestedNumbers != null && req.requestedNumbers.size() > 0) {
                 foundNumbers = req.requestedNumbers;
                 out.status = AllocationStatus.Success;
-                for (int n : foundNumbers)
+                for (int n : foundNumbers) {
                     if (!RangeUtil.checkRange(rr, req, n)) {
                         out.status = AllocationStatus.Failure;
                         break;
                     }
+                }
             } else {
-                foundNumbers = new TreeSet<Integer>();
+                foundNumbers = new TreeSet<>();
                 int foundCount = 0;
 
                 // First try to reuse the numbers already taken by the same resource union
                 SortedSet<Integer> uu = RangeUtil.getUsed(rr, req.resourceUnionId);
-                if (uu != null && !uu.isEmpty()) {
+                if (uu != null && !uu.isEmpty() && req.replace) {
                     if (uu.size() >= req.requestedCount) {
                         // Just take the first req.requestedCount numbers from uu
                         Iterator<Integer> i = uu.iterator();
@@ -278,33 +291,48 @@
                             if (RangeUtil.checkRange(rr, req, n)) {
                                 foundNumbers.add(n);
                                 foundCount++;
-                            } else if (req.sequential)
+                            } else if (req.sequential) {
                                 break;
+                            }
                         }
                         for (int n = uumax; foundCount < req.requestedCount && n <= req.checkMax; n++) {
                             if (RangeUtil.checkRange(rr, req, n)) {
                                 foundNumbers.add(n);
                                 foundCount++;
-                            } else if (req.sequential)
+                            } else if (req.sequential) {
                                 break;
+                            }
                         }
 
                         // If we could not find enough numbers trying to reuse currently
                         // allocated, reset foundNumbers and foundCount, continue with
                         // the normal allocation of new numbers.
                         if (foundCount < req.requestedCount) {
-                            foundNumbers = new TreeSet<Integer>();
+                            foundNumbers = new TreeSet<>();
                             foundCount = 0;
                         }
                     }
                 }
 
-                for (int n = req.checkMin; foundCount < req.requestedCount && n <= req.checkMax; n++)
-                    if (RangeUtil.checkRange(rr, req, n)) {
-                        foundNumbers.add(n);
-                        foundCount++;
-                    } else if (req.sequential)
-                        foundCount = 0;
+                if (req.reverseOrder) {
+                    for (int n = req.checkMax; foundCount < req.requestedCount && n >= req.checkMin; n--) {
+                        if (RangeUtil.checkRange(rr, req, n)) {
+                            foundNumbers.add(n);
+                            foundCount++;
+                        } else if (req.sequential) {
+                            foundCount = 0;
+                        }
+                    }
+                } else {
+                    for (int n = req.checkMin; foundCount < req.requestedCount && n <= req.checkMax; n++) {
+                        if (RangeUtil.checkRange(rr, req, n)) {
+                            foundNumbers.add(n);
+                            foundCount++;
+                        } else if (req.sequential) {
+                            foundCount = 0;
+                        }
+                    }
+                }
 
                 out.status = foundCount == req.requestedCount ? AllocationStatus.Success : AllocationStatus.Failure;
             }
@@ -313,11 +341,12 @@
         if (out.status == AllocationStatus.Success) {
             out.allocated = foundNumbers;
             if (req.allocate) {
-                RangeUtil.allocateRange(rr, out.allocated, req, applicationId);
+                RangeUtil.allocateRange(rr, out.allocated, req);
                 updateList.add(rr);
             }
-        } else
-            out.allocated = new TreeSet<Integer>();
+        } else {
+            out.allocated = new TreeSet<>();
+        }
 
         out.used = rr.used;
 
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ResourceManagerImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ResourceManagerImpl.java
index 2884e98..77d8a68 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ResourceManagerImpl.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/ResourceManagerImpl.java
@@ -8,9 +8,9 @@
  * 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.
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-
 import org.onap.ccsdk.sli.adaptors.lock.comp.LockHelper;
 import org.onap.ccsdk.sli.adaptors.rm.dao.ResourceDao;
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationOutcome;
@@ -42,7 +41,6 @@
     private LockHelper lockHelper;
     private ResourceDao resourceDao;
 
-    private String applicationId;
     private int lockTimeout = 10 * 60; // Default 10 min
 
     public ResourceManagerImpl() {
@@ -59,18 +57,20 @@
     @Override
     public List<Resource> getResourceUnion(String resourceUnionId) {
         List<Resource> rlist = resourceDao.getResourceUnion(resourceUnionId);
-        for (Resource r : rlist)
+        for (Resource r : rlist) {
             ResourceUtil.recalculate(r);
+        }
         return rlist;
     }
 
     @Override
     public AllocationOutcome allocateResources(AllocationRequest allocationRequest) {
-        if (allocationRequest == null)
+        if (allocationRequest == null) {
             throw new IllegalArgumentException("allocateResources called with null argument");
+        }
 
         AllocationFunction allocationFunction =
-                new AllocationFunction(lockHelper, resourceDao, applicationId, allocationRequest, lockTimeout);
+                new AllocationFunction(lockHelper, resourceDao, allocationRequest, lockTimeout);
         allocationFunction.exec();
         AllocationOutcome allocationOutcome = allocationFunction.getAllocationOutcome();
 
@@ -82,8 +82,9 @@
     @Override
     public void releaseResourceSet(String resourceSetId) {
         List<Resource> resourceList = resourceDao.getResourceSet(resourceSetId);
-        if (resourceList == null || resourceList.isEmpty())
+        if (resourceList == null || resourceList.isEmpty()) {
             return;
+        }
 
         Set<String> lockNames = getLockNames(resourceList);
         ReleaseFunction releaseFunction =
@@ -94,8 +95,9 @@
     @Override
     public void releaseResourceUnion(String resourceUnionId) {
         List<Resource> resourceList = resourceDao.getResourceUnion(resourceUnionId);
-        if (resourceList == null || resourceList.isEmpty())
+        if (resourceList == null || resourceList.isEmpty()) {
             return;
+        }
 
         Set<String> lockNames = getLockNames(resourceList);
         ReleaseFunction releaseFunction =
@@ -104,9 +106,10 @@
     }
 
     private Set<String> getLockNames(List<Resource> resourceList) {
-        Set<String> lockNames = new HashSet<String>();
-        for (Resource r : resourceList)
+        Set<String> lockNames = new HashSet<>();
+        for (Resource r : resourceList) {
             lockNames.add(r.resourceKey.assetId);
+        }
         return lockNames;
     }
 
@@ -118,10 +121,6 @@
         this.lockTimeout = lockTimeout;
     }
 
-    public void setApplicationId(String applicationId) {
-        this.applicationId = applicationId;
-    }
-
     public void setLockHelper(LockHelper lockHelper) {
         this.lockHelper = lockHelper;
     }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/AllocationRequest.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/AllocationRequest.java
index 25a4fbb..29b4936 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/AllocationRequest.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/AllocationRequest.java
@@ -8,9 +8,9 @@
  * 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.
@@ -25,6 +25,7 @@
 
 public class AllocationRequest {
 
+    public String applicationId = null;
     public String resourceUnionId = null;
     public String resourceSetId = null;
     public Set<String> resourceShareGroupList = null;
@@ -32,4 +33,5 @@
     public String assetId = null;
     public AllocationAction missingResourceAction = AllocationAction.Succeed_Allocate;
     public AllocationAction expiredResourceAction = AllocationAction.Succeed_Allocate;
+    public String endPointPosition = null;
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/RangeAllocationRequest.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/RangeAllocationRequest.java
index b42960d..9581244 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/RangeAllocationRequest.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/RangeAllocationRequest.java
@@ -8,9 +8,9 @@
  * 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.
@@ -31,6 +31,8 @@
     public boolean allocate = false;
     public boolean replace = false;
     public SortedSet<Integer> requestedNumbers = null;
+    public SortedSet<Integer> excludeNumbers = null;
     public int requestedCount = 1;
     public boolean sequential = false;
+    public boolean reverseOrder = false;
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/LabelUtil.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/LabelUtil.java
index 7cc541d..a67a50b 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/LabelUtil.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/LabelUtil.java
@@ -8,9 +8,9 @@
  * 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.
@@ -23,7 +23,6 @@
 
 import java.util.ArrayList;
 import java.util.Date;
-
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
 import org.onap.ccsdk.sli.adaptors.rm.data.LabelAllocationItem;
 import org.onap.ccsdk.sli.adaptors.rm.data.LabelAllocationRequest;
@@ -37,16 +36,18 @@
         if (req.check && req.label != null && l.allocationItems != null && !l.allocationItems.isEmpty()) {
             for (AllocationItem ai : l.allocationItems) {
                 LabelAllocationItem lai = (LabelAllocationItem) ai;
-                if (!eq(req.resourceUnionId, lai.resourceUnionId) && !eq(req.label, lai.label))
+                if (!eq(req.resourceUnionId, lai.resourceUnionId) && !eq(req.label, lai.label)) {
                     return false;
+                }
             }
         }
         return true;
     }
 
-    public static String allocateLabel(LabelResource l, LabelAllocationRequest req, String applicationId) {
-        if (!req.allocate)
+    public static String allocateLabel(LabelResource l, LabelAllocationRequest req) {
+        if (!req.allocate) {
             return null;
+        }
 
         LabelAllocationItem lai = (LabelAllocationItem) ResourceUtil.getAllocationItem(l, req.resourceSetId);
         if (lai == null) {
@@ -55,13 +56,14 @@
             lai.resourceKey = new ResourceKey();
             lai.resourceKey.assetId = req.assetId;
             lai.resourceKey.resourceName = req.resourceName;
-            lai.applicationId = applicationId;
+            lai.applicationId = req.applicationId;
             lai.resourceSetId = req.resourceSetId;
             lai.resourceUnionId = req.resourceUnionId;
             lai.resourceShareGroupList = req.resourceShareGroupList;
 
-            if (l.allocationItems == null)
-                l.allocationItems = new ArrayList<AllocationItem>();
+            if (l.allocationItems == null) {
+                l.allocationItems = new ArrayList<>();
+            }
             l.allocationItems.add(lai);
         }
 
@@ -76,17 +78,19 @@
     public static void recalculate(LabelResource l) {
         l.label = null;
         l.referenceCount = 0;
-        if (l.allocationItems != null)
+        if (l.allocationItems != null) {
             for (AllocationItem ai : l.allocationItems) {
                 LabelAllocationItem lai = (LabelAllocationItem) ai;
                 if (lai.label != null) {
                     l.referenceCount++;
-                    if (l.label == null)
+                    if (l.label == null) {
                         l.label = lai.label;
-                    else if (!l.label.equals(lai.label))
+                    } else if (!l.label.equals(lai.label)) {
                         l.label = "__BLOCKED__";
+                    }
                 }
             }
+        }
     }
 
     private static boolean eq(Object o1, Object o2) {
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/LimitUtil.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/LimitUtil.java
index 8f284b5..2e36c96 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/LimitUtil.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/LimitUtil.java
@@ -8,9 +8,9 @@
  * 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.
@@ -27,7 +27,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
 import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationItem;
 import org.onap.ccsdk.sli.adaptors.rm.data.LimitAllocationRequest;
@@ -42,26 +41,30 @@
     private static final Logger log = LoggerFactory.getLogger(LimitUtil.class);
 
     public static boolean checkLimit(LimitResource l, LimitAllocationRequest req) {
-        if (req.checkCount <= 0)
+        if (req.checkCount <= 0) {
             return true;
+        }
 
         long checkCount = req.checkCount;
         long currentUsage = 0;
         if (req.resourceSetId != null) {
             LimitAllocationItem lai = (LimitAllocationItem) ResourceUtil.getAllocationItem(l, req.resourceSetId);
-            if (lai != null)
+            if (lai != null) {
                 currentUsage = lai.used;
+            }
         }
-        if (!req.replace)
+        if (!req.replace) {
             checkCount += currentUsage;
+        }
 
         long used = calculateLimitUsage(l, 0, null, null);
         long wouldUse = calculateLimitUsage(l, checkCount, req.resourceUnionId, req.resourceShareGroupList);
 
         // If usage is not increasing by this request, only check the limit if
         // strictCheck is true.
-        if (wouldUse <= used && !req.strict)
+        if (wouldUse <= used && !req.strict) {
             return true;
+        }
 
         return wouldUse <= req.checkLimit;
     }
@@ -72,8 +75,9 @@
             String resourceUnionId,
             Set<String> resourceShareGroupList) {
         if ((l.allocationItems == null || l.allocationItems.isEmpty()) &&
-                (resourceUnionId == null || resourceUnionId.length() == 0))
+                (resourceUnionId == null || resourceUnionId.length() == 0)) {
             return 0;
+        }
 
         long t1 = System.currentTimeMillis();
         boolean logit = false;
@@ -127,48 +131,54 @@
 
         // First, group the allocation items by the first resource union, using the LimitUsage structure
         int regularChangeCount = 0;
-        Map<String/* resourceUnionId */, List<LimitUsage>> limitUsageMap = new HashMap<String, List<LimitUsage>>();
-        if (l.allocationItems != null)
+        Map<String/* resourceUnionId */, List<LimitUsage>> limitUsageMap = new HashMap<>();
+        if (l.allocationItems != null) {
             for (AllocationItem ai : l.allocationItems) {
                 LimitAllocationItem lai = (LimitAllocationItem) ai;
                 boolean regularChange =
                         addLimitUsage(limitUsageMap, lai.resourceUnionId, lai.resourceShareGroupList, lai.used);
-                if (regularChange)
+                if (regularChange) {
                     regularChangeCount++;
+                }
             }
+        }
         if (checkCount > 0 && resourceUnionId != null) {
             boolean regularChange = addLimitUsage(limitUsageMap, resourceUnionId, resourceShareGroupList, checkCount);
-            if (regularChange)
+            if (regularChange) {
                 regularChangeCount++;
+            }
         }
 
         // Generate all the combinations, containing one LimitUsage object for each firstResourceUnion
         int significantChangeCount = 0;
-        List<List<LimitUsage>> allCombinations = new ArrayList<List<LimitUsage>>();
+        List<List<LimitUsage>> allCombinations = new ArrayList<>();
         for (String firstResourceUnion : limitUsageMap.keySet()) {
             List<LimitUsage> limitUsageList = limitUsageMap.get(firstResourceUnion);
-            if (limitUsageList.size() > 1)
+            if (limitUsageList.size() > 1) {
                 significantChangeCount++;
+            }
             if (allCombinations.isEmpty()) {
                 for (LimitUsage limitUsage : limitUsageList) {
-                    List<LimitUsage> newCombination = new ArrayList<LimitUsage>();
+                    List<LimitUsage> newCombination = new ArrayList<>();
                     newCombination.add(limitUsage);
                     allCombinations.add(newCombination);
                 }
             } else {
                 if (limitUsageList.size() == 1) {
                     // No new combinations are generated - just add this one to all combinations we have until now
-                    for (List<LimitUsage> combination : allCombinations)
+                    for (List<LimitUsage> combination : allCombinations) {
                         combination.add(limitUsageList.get(0));
+                    }
                 } else {
                     // We have to duplicate each of the current combinations for each element of limitUsageList
-                    List<List<LimitUsage>> newAllCombinations = new ArrayList<List<LimitUsage>>();
-                    for (List<LimitUsage> combination : allCombinations)
+                    List<List<LimitUsage>> newAllCombinations = new ArrayList<>();
+                    for (List<LimitUsage> combination : allCombinations) {
                         for (LimitUsage limitUsage : limitUsageList) {
-                            List<LimitUsage> newCombination = new ArrayList<LimitUsage>(combination);
+                            List<LimitUsage> newCombination = new ArrayList<>(combination);
                             newCombination.add(limitUsage);
                             newAllCombinations.add(newCombination);
                         }
+                    }
                     allCombinations = newAllCombinations;
                 }
             }
@@ -178,8 +188,9 @@
         long maxUsage = 0;
         for (List<LimitUsage> combination : allCombinations) {
             long usage = calculateUsage(combination);
-            if (usage > maxUsage)
+            if (usage > maxUsage) {
                 maxUsage = usage;
+            }
         }
 
         long t2 = System.currentTimeMillis();
@@ -202,7 +213,7 @@
             long used) {
         List<LimitUsage> limitUsageList = limitUsageMap.get(resourceUnionId);
         if (limitUsageList == null) {
-            limitUsageList = new ArrayList<LimitUsage>();
+            limitUsageList = new ArrayList<>();
             limitUsageMap.put(resourceUnionId, limitUsageList);
         }
         // See if we already have the same shareResourceUnionSet in the list. In such case just update the usage
@@ -221,8 +232,9 @@
             }
         }
         if (limitUsage != null) {
-            if (limitUsage.usage < used)
+            if (limitUsage.usage < used) {
                 limitUsage.usage = used;
+            }
             return true;
         }
 
@@ -243,14 +255,18 @@
     }
 
     private static boolean hasCommonSharedResource(LimitUsage limitUsage1, LimitUsage limitUsage2) {
-        if (limitUsage1.resourceShareGroupList == null || limitUsage1.resourceShareGroupList.isEmpty())
+        if (limitUsage1.resourceShareGroupList == null || limitUsage1.resourceShareGroupList.isEmpty()) {
             return false;
-        if (limitUsage2.resourceShareGroupList == null || limitUsage2.resourceShareGroupList.isEmpty())
+        }
+        if (limitUsage2.resourceShareGroupList == null || limitUsage2.resourceShareGroupList.isEmpty()) {
             return false;
+        }
 
-        for (String resourceUnion : limitUsage1.resourceShareGroupList)
-            if (limitUsage2.resourceShareGroupList.contains(resourceUnion))
+        for (String resourceUnion : limitUsage1.resourceShareGroupList) {
+            if (limitUsage2.resourceShareGroupList.contains(resourceUnion)) {
                 return true;
+            }
+        }
 
         return false;
     }
@@ -260,7 +276,7 @@
         // split the combination in sets that have common value. Then the usage of each set will be the maximum of
         // the usages of the LimitUsage objects in the set. The usage of the combination will be the sum of the usages
         // of all sets.
-        List<List<LimitUsage>> sharedSets = new ArrayList<List<LimitUsage>>();
+        List<List<LimitUsage>> sharedSets = new ArrayList<>();
         for (LimitUsage limitUsage : combination) {
             // See if we can put limitUsage in any of the existing sets - is it has a common resource union with
             // any of the LimitUsage objects in a set.
@@ -279,7 +295,7 @@
             }
             if (!found) {
                 // Start a new set
-                List<LimitUsage> newSharedSet = new ArrayList<LimitUsage>();
+                List<LimitUsage> newSharedSet = new ArrayList<>();
                 newSharedSet.add(limitUsage);
                 sharedSets.add(newSharedSet);
             }
@@ -288,18 +304,21 @@
         long sum = 0;
         for (List<LimitUsage> sharedSet : sharedSets) {
             float max = 0;
-            for (LimitUsage limitUsage : sharedSet)
-                if (max < limitUsage.usage)
+            for (LimitUsage limitUsage : sharedSet) {
+                if (max < limitUsage.usage) {
                     max = limitUsage.usage;
+                }
+            }
             sum += max;
         }
 
         return sum;
     }
 
-    public static long allocateLimit(LimitResource l, LimitAllocationRequest req, String applicationId) {
-        if (req.allocateCount <= 0)
+    public static long allocateLimit(LimitResource l, LimitAllocationRequest req) {
+        if (req.allocateCount <= 0) {
             return 0;
+        }
         long uu = l.used;
 
         LimitAllocationItem lai = (LimitAllocationItem) ResourceUtil.getAllocationItem(l, req.resourceSetId);
@@ -309,17 +328,19 @@
             lai.resourceKey = new ResourceKey();
             lai.resourceKey.assetId = req.assetId;
             lai.resourceKey.resourceName = req.resourceName;
-            lai.applicationId = applicationId;
+            lai.applicationId = req.applicationId;
             lai.resourceSetId = req.resourceSetId;
             lai.resourceUnionId = req.resourceUnionId;
             lai.resourceShareGroupList = req.resourceShareGroupList;
             lai.used = req.allocateCount;
 
-            if (l.allocationItems == null)
-                l.allocationItems = new ArrayList<AllocationItem>();
+            if (l.allocationItems == null) {
+                l.allocationItems = new ArrayList<>();
+            }
             l.allocationItems.add(lai);
-        } else
+        } else {
             lai.used = req.replace ? req.allocateCount : lai.used + req.allocateCount;
+        }
 
         lai.allocationTime = new Date();
 
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/RangeUtil.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/RangeUtil.java
index f01d357..04f6e8c 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/RangeUtil.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/RangeUtil.java
@@ -8,9 +8,9 @@
  * 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.
@@ -23,9 +23,9 @@
 
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
-
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
 import org.onap.ccsdk.sli.adaptors.rm.data.RangeAllocationItem;
 import org.onap.ccsdk.sli.adaptors.rm.data.RangeAllocationRequest;
@@ -36,51 +36,62 @@
 public class RangeUtil {
 
     public static void recalculate(RangeResource r) {
-        r.used = new TreeSet<Integer>();
-        if (r.allocationItems != null)
+        r.used = new TreeSet<>();
+        if (r.allocationItems != null) {
             for (AllocationItem ai : r.allocationItems) {
                 RangeAllocationItem rai = (RangeAllocationItem) ai;
-                if (rai.used != null)
+                if (rai.used != null) {
                     r.used.addAll(rai.used);
+                }
             }
+        }
     }
 
     public static boolean checkRange(RangeResource r, RangeAllocationRequest req, int num) {
-        if (num < req.checkMin || num > req.checkMax)
+        if (num < req.checkMin || num > req.checkMax) {
             return false;
+        }
 
-        if (r.allocationItems != null)
+        if (req.excludeNumbers != null && req.excludeNumbers.contains(num)) {
+            return false;
+        }
+
+        if (r.allocationItems != null) {
             for (AllocationItem ai : r.allocationItems) {
                 RangeAllocationItem rai = (RangeAllocationItem) ai;
-                if (!eq(req.resourceUnionId, rai.resourceUnionId) && rai.used != null && rai.used.contains(num))
+                if (!eq(req.resourceUnionId, rai.resourceUnionId) && rai.used != null && rai.used.contains(num)) {
+                    if (!overlap(rai.resourceShareGroupList, req.resourceShareGroupList)) {
+                        return false;
+                    }
+                }
+                if (!req.replace && eq(req.resourceSetId, rai.resourceSetId) && rai.used != null
+                        && rai.used.contains(num)) {
                     return false;
+                }
             }
+        }
 
         return true;
     }
 
-    private static boolean eq(Object o1, Object o2) {
-        return o1 == null ? o2 == null : o1.equals(o2);
-    }
-
     public static SortedSet<Integer> getUsed(RangeResource r, String resourceUnionId) {
-        SortedSet<Integer> used = new TreeSet<Integer>();
-        if (r.allocationItems != null)
+        SortedSet<Integer> used = new TreeSet<>();
+        if (r.allocationItems != null) {
             for (AllocationItem ai : r.allocationItems) {
                 RangeAllocationItem rai = (RangeAllocationItem) ai;
-                if (eq(resourceUnionId, rai.resourceUnionId) && rai.used != null)
+                if (eq(resourceUnionId, rai.resourceUnionId) && rai.used != null) {
                     used.addAll(rai.used);
+                }
             }
+        }
         return used;
     }
 
-    public static void allocateRange(
-            RangeResource rr,
-            SortedSet<Integer> requestedNumbers,
-            RangeAllocationRequest req,
-            String applicationId) {
-        if (!req.allocate)
+    public static void allocateRange(RangeResource rr, SortedSet<Integer> requestedNumbers,
+            RangeAllocationRequest req) {
+        if (!req.allocate) {
             return;
+        }
 
         RangeAllocationItem rai = (RangeAllocationItem) ResourceUtil.getAllocationItem(rr, req.resourceSetId);
         if (rai == null) {
@@ -89,22 +100,40 @@
             rai.resourceKey = new ResourceKey();
             rai.resourceKey.assetId = req.assetId;
             rai.resourceKey.resourceName = req.resourceName;
-            rai.applicationId = applicationId;
+            rai.applicationId = req.applicationId;
             rai.resourceSetId = req.resourceSetId;
             rai.resourceUnionId = req.resourceUnionId;
             rai.resourceShareGroupList = req.resourceShareGroupList;
             rai.used = requestedNumbers;
 
-            if (rr.allocationItems == null)
-                rr.allocationItems = new ArrayList<AllocationItem>();
+            if (rr.allocationItems == null) {
+                rr.allocationItems = new ArrayList<>();
+            }
             rr.allocationItems.add(rai);
-        } else if (req.replace)
+        } else if (req.replace) {
             rai.used = requestedNumbers;
-        else
+        } else {
             rai.used.addAll(requestedNumbers);
+        }
 
         rai.allocationTime = new Date();
 
         recalculate(rr);
     }
+
+    private static boolean eq(Object o1, Object o2) {
+        return o1 == null ? o2 == null : o1.equals(o2);
+    }
+
+    private static boolean overlap(Set<String> s1, Set<String> s2) {
+        if (s1 == null || s1.isEmpty() || s2 == null || s2.isEmpty()) {
+            return false;
+        }
+        for (String ss1 : s1) {
+            if (s2.contains(ss1)) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/ResourceUtil.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/ResourceUtil.java
index ae7c215..3db6380 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/ResourceUtil.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/util/ResourceUtil.java
@@ -8,9 +8,9 @@
  * 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.
@@ -24,26 +24,34 @@
 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationItem;
 import org.onap.ccsdk.sli.adaptors.rm.data.LabelResource;
 import org.onap.ccsdk.sli.adaptors.rm.data.LimitResource;
+import org.onap.ccsdk.sli.adaptors.rm.data.RangeResource;
 import org.onap.ccsdk.sli.adaptors.rm.data.Resource;
 import org.onap.ccsdk.sli.adaptors.rm.data.ResourceType;
 
 public class ResourceUtil {
 
     public static AllocationItem getAllocationItem(Resource r, String resourceSetId) {
-        if (r.allocationItems != null)
-            for (AllocationItem ai : r.allocationItems)
-                if (ai.resourceSetId != null && ai.resourceSetId.equals(resourceSetId))
+        if (r.allocationItems != null) {
+            for (AllocationItem ai : r.allocationItems) {
+                if (ai.resourceSetId != null && ai.resourceSetId.equals(resourceSetId)) {
                     return ai;
+                }
+            }
+        }
         return null;
     }
 
     public static void recalculate(Resource r) {
-        if (r == null)
+        if (r == null) {
             return;
+        }
 
-        if (r.resourceType == ResourceType.Limit)
+        if (r.resourceType == ResourceType.Limit) {
             LimitUtil.recalculate((LimitResource) r);
-        else if (r.resourceType == ResourceType.Label)
+        } else if (r.resourceType == ResourceType.Range) {
+            RangeUtil.recalculate((RangeResource) r);
+        } else if (r.resourceType == ResourceType.Label) {
             LabelUtil.recalculate((LabelResource) r);
+        }
     }
 }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/CachedDataSourceWrap.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/CachedDataSourceWrap.java
index 0e46868..3fa3952 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/CachedDataSourceWrap.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/db/CachedDataSourceWrap.java
@@ -8,9 +8,9 @@
  * 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.
@@ -25,9 +25,7 @@
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.SQLFeatureNotSupportedException;
-
 import javax.sql.DataSource;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -36,6 +34,7 @@
     private static final Logger log = LoggerFactory.getLogger(CachedDataSourceWrap.class);
 
     private ThreadLocal<ConnectionWrap> con = new ThreadLocal<>();
+    private ThreadLocal<Boolean> autoCommit = new ThreadLocal<>();
 
     private DataSource dataSource;
 
@@ -78,12 +77,17 @@
     public Connection getConnection() throws SQLException {
         if (con.get() == null) {
             Connection c = dataSource.getConnection();
+
             ConnectionWrap cc = new ConnectionWrap(c);
             con.set(cc);
 
+            autoCommit.set(c.getAutoCommit());
+            c.setAutoCommit(false);
+
             log.info("Got new DB connection: " + c);
-        } else
+        } else {
             log.info("Using thread DB connection: " + con.get().getCon());
+        }
 
         return con.get();
     }
@@ -92,12 +96,17 @@
     public Connection getConnection(String username, String password) throws SQLException {
         if (con.get() == null) {
             Connection c = dataSource.getConnection(username, password);
+
             ConnectionWrap cc = new ConnectionWrap(c);
             con.set(cc);
 
+            autoCommit.set(c.getAutoCommit());
+            c.setAutoCommit(false);
+
             log.info("Got new DB connection: " + c);
-        } else
+        } else {
             log.info("Using thread DB connection: " + con.get().getCon());
+        }
 
         return con.get();
     }
@@ -105,6 +114,7 @@
     public void releaseConnection() {
         if (con.get() != null) {
             try {
+                con.get().setAutoCommit(autoCommit.get());
                 con.get().realClose();
 
                 log.info("DB Connection released: " + con.get().getCon());
@@ -116,6 +126,30 @@
         }
     }
 
+    public void commit() {
+        if (con.get() != null) {
+            try {
+                con.get().commit();
+
+                log.info("DB Connection committed: " + con.get().getCon());
+            } catch (Exception e) {
+                log.warn("Failed to commit DB connection", e);
+            }
+        }
+    }
+
+    public void rollback() {
+        if (con.get() != null) {
+            try {
+                con.get().rollback();
+
+                log.info("DB Connection rolled back: " + con.get().getCon());
+            } catch (Exception e) {
+                log.warn("Failed to roll back DB connection", e);
+            }
+        }
+    }
+
     public void setDataSource(DataSource dataSource) {
         this.dataSource = dataSource;
     }
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java
index 037b78b..8ba454b 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/expr/ExpressionEvaluator.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ *                      reserved.
  * ================================================================================
  * 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.
@@ -25,36 +25,42 @@
 
 public class ExpressionEvaluator {
 
-    public static long evalLong(String expr, Map<String, Object> vars) {
+    public static long evalLong(String expr, Map<String, String> vars) {
         return (long) evalFloat(expr, vars);
     }
 
-    public static float evalFloat(String expr, Map<String, Object> vars) {
+    public static float evalFloat(String expr, Map<String, String> vars) {
         expr = expr.trim();
         int sl = expr.length();
-        if (sl == 0)
+        if (sl == 0) {
             throw new IllegalArgumentException("Cannot interpret empty string.");
+        }
 
         // Remove parentheses if any
-        if (expr.charAt(0) == '(' && expr.charAt(sl - 1) == ')')
+        if (expr.charAt(0) == '(' && expr.charAt(sl - 1) == ')') {
             return evalFloat(expr.substring(1, sl - 1), vars);
+        }
 
         // Look for operators in the order of least priority
         String[] sss = findOperator(expr, "-", true);
-        if (sss != null)
+        if (sss != null) {
             return evalFloat(sss[0], vars) - evalFloat(sss[1], vars);
+        }
 
         sss = findOperator(expr, "+", true);
-        if (sss != null)
+        if (sss != null) {
             return evalFloat(sss[0], vars) + evalFloat(sss[1], vars);
+        }
 
         sss = findOperator(expr, "/", true);
-        if (sss != null)
+        if (sss != null) {
             return evalFloat(sss[0], vars) / evalFloat(sss[1], vars);
+        }
 
         sss = findOperator(expr, "*", true);
-        if (sss != null)
+        if (sss != null) {
             return evalFloat(sss[0], vars) * evalFloat(sss[1], vars);
+        }
 
         // Check if expr is a number
         try {
@@ -63,74 +69,122 @@
         }
 
         // Must be a variable
-        Object v = vars.get(expr);
-        if (v != null) {
-            if (v instanceof Float)
-                return (Float) v;
-            if (v instanceof Long)
-                return (Long) v;
-            if (v instanceof Integer)
-                return (Integer) v;
+        String v = vars.get(expr);
+        try {
+            return Float.valueOf(v);
+        } catch (Exception e) {
         }
         return 0;
     }
 
-    public static boolean evalBoolean(String expr, Map<String, Object> vars) {
+    public static String evalString(String expr, Map<String, String> vars) {
         expr = expr.trim();
         int sl = expr.length();
-        if (sl == 0)
+        if (sl == 0) {
             throw new IllegalArgumentException("Cannot interpret empty string.");
-
-        if (expr.equalsIgnoreCase("true"))
-            return true;
-
-        if (expr.equalsIgnoreCase("false"))
-            return false;
+        }
 
         // Remove parentheses if any
-        if (expr.charAt(0) == '(' && expr.charAt(sl - 1) == ')')
+        if (expr.charAt(0) == '(' && expr.charAt(sl - 1) == ')') {
+            return evalString(expr.substring(1, sl - 1), vars);
+        }
+
+        // Look for operators in the order of least priority
+        String[] sss = findOperator(expr, "+", true);
+        if (sss != null) {
+            return evalString(sss[0], vars) + evalString(sss[1], vars);
+        }
+
+        // Check if expr is a number
+        try {
+            return Float.valueOf(expr).toString();
+        } catch (Exception e) {
+        }
+
+        // Check for quotes
+        if (expr.charAt(0) == '"' && expr.charAt(sl - 1) == '"') {
+            return expr.substring(1, sl - 1);
+        }
+        if (expr.charAt(0) == '\'' && expr.charAt(sl - 1) == '\'') {
+            return expr.substring(1, sl - 1);
+        }
+
+        // Must be a variable
+        String v = vars.get(expr);
+        return v != null ? v : "";
+    }
+
+    public static boolean evalBoolean(String expr, Map<String, String> vars) {
+        expr = expr.trim();
+        int sl = expr.length();
+        if (sl == 0) {
+            throw new IllegalArgumentException("Cannot interpret empty string.");
+        }
+
+        if (expr.equalsIgnoreCase("true")) {
+            return true;
+        }
+
+        if (expr.equalsIgnoreCase("false")) {
+            return false;
+        }
+
+        // Remove parentheses if any
+        if (expr.charAt(0) == '(' && expr.charAt(sl - 1) == ')') {
             return evalBoolean(expr.substring(1, sl - 1), vars);
+        }
 
         // Look for operators in the order of least priority
         String[] sss = findOperator(expr, "or", true);
-        if (sss != null)
+        if (sss != null) {
             return evalBoolean(sss[0], vars) || evalBoolean(sss[1], vars);
+        }
 
         sss = findOperator(expr, "and", true);
-        if (sss != null)
+        if (sss != null) {
             return evalBoolean(sss[0], vars) && evalBoolean(sss[1], vars);
+        }
 
         sss = findOperator(expr, "not", true);
-        if (sss != null)
+        if (sss != null) {
             return !evalBoolean(sss[1], vars);
+        }
 
         sss = findOperator(expr, "!=", false);
-        if (sss == null)
+        if (sss == null) {
             sss = findOperator(expr, "<>", false);
-        if (sss != null)
-            return evalLong(sss[0], vars) != evalLong(sss[1], vars);
+        }
+        if (sss != null) {
+            return !evalString(sss[0], vars).equals(evalString(sss[1], vars));
+        }
 
         sss = findOperator(expr, "==", false);
-        if (sss == null)
+        if (sss == null) {
             sss = findOperator(expr, "=", false);
-        if (sss != null)
-            return evalLong(sss[0], vars) == evalLong(sss[1], vars);
+        }
+        if (sss != null) {
+            return evalString(sss[0], vars).equals(evalString(sss[1], vars));
+        }
 
         sss = findOperator(expr, ">=", false);
-        if (sss != null)
+        if (sss != null) {
             return evalLong(sss[0], vars) >= evalLong(sss[1], vars);
+        }
 
         sss = findOperator(expr, ">", false);
-        if (sss != null)
+        if (sss != null) {
             return evalLong(sss[0], vars) > evalLong(sss[1], vars);
+        }
 
         sss = findOperator(expr, "<=", false);
-        if (sss != null)
+        if (sss != null) {
             return evalLong(sss[0], vars) <= evalLong(sss[1], vars);
+        }
 
         sss = findOperator(expr, "<", false);
-        if (sss != null)
+        if (sss != null) {
             return evalLong(sss[0], vars) < evalLong(sss[1], vars);
+        }
 
         throw new IllegalArgumentException("Cannot interpret '" + expr + "': Invalid expression.");
     }
@@ -142,26 +196,29 @@
         int pcount = 0, qcount = 0;
         for (int i = 0; i < sl; i++) {
             char c = s.charAt(i);
-            if (c == '(' && qcount == 0)
+            if (c == '(' && qcount == 0) {
                 pcount++;
-            else if (c == ')' && qcount == 0) {
+            } else if (c == ')' && qcount == 0) {
                 pcount--;
-                if (pcount < 0)
+                if (pcount < 0) {
                     throw new IllegalArgumentException("Cannot interpret '" + s + "': Parentheses do not match.");
-            } else if (c == '\'')
+                }
+            } else if (c == '\'') {
                 qcount = (qcount + 1) % 2;
-            else if (i <= sl - opl && pcount == 0 && qcount == 0) {
+            } else if (i <= sl - opl && pcount == 0 && qcount == 0) {
                 String ss = s.substring(i, i + opl);
                 if (ss.equalsIgnoreCase(op)) {
                     boolean found = true;
                     if (delimiterRequired) {
                         // Check for delimiter before and after to make sure it is not part of another word
                         char chbefore = '\0';
-                        if (i > 0)
+                        if (i > 0) {
                             chbefore = s.charAt(i - 1);
+                        }
                         char chafter = '\0';
-                        if (i < sl - opl)
+                        if (i < sl - opl) {
                             chafter = s.charAt(i + opl);
+                        }
                         found = delimiters.indexOf(chbefore) >= 0 && delimiters.indexOf(chafter) >= 0;
                     }
                     if (found) {
@@ -174,23 +231,29 @@
                 }
             }
         }
-        if (pcount > 0)
+        if (pcount > 0) {
             throw new IllegalArgumentException("Cannot interpret '" + s + "': Parentheses do not match.");
-        if (qcount > 0)
+        }
+        if (qcount > 0) {
             throw new IllegalArgumentException("Cannot interpret '" + s + "': No closing '.");
+        }
         return null;
     }
 
+    @SuppressWarnings("unused")
     private static Object parseObject(String s) {
         s = s.trim();
         int sl = s.length();
-        if (sl == 0)
+        if (sl == 0) {
             throw new IllegalArgumentException("Cannot interpret empty string.");
-        if (s.equalsIgnoreCase("null"))
+        }
+        if (s.equalsIgnoreCase("null")) {
             return null;
+        }
         if (s.charAt(0) == '\'') {
-            if (sl < 2 || s.charAt(sl - 1) != '\'')
+            if (sl < 2 || s.charAt(sl - 1) != '\'') {
                 throw new IllegalArgumentException("Cannot interpret '" + s + "': No closing '.");
+            }
             return s.substring(1, sl - 1);
         }
         // Not in quotes - must be a number
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/speed/SpeedUtil.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/speed/SpeedUtil.java
index 1aad8f5..0d1359c 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/speed/SpeedUtil.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/speed/SpeedUtil.java
@@ -8,9 +8,9 @@
  * 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.
@@ -26,12 +26,28 @@
     private long unitFactor = 1000;
 
     public long convertToKbps(long maxSpeed, String unit) {
-        if (unit.equalsIgnoreCase("kbps"))
+        if (unit.equalsIgnoreCase("kbps")) {
             return maxSpeed;
-        if (unit.equalsIgnoreCase("Mbps"))
+        }
+        if (unit.equalsIgnoreCase("Mbps")) {
             return maxSpeed * unitFactor;
-        if (unit.equalsIgnoreCase("Gbps"))
+        }
+        if (unit.equalsIgnoreCase("Gbps")) {
             return maxSpeed * unitFactor * unitFactor;
+        }
+        return 0;
+    }
+
+    public long convertToMbps(long maxSpeed, String unit) {
+        if (unit.equalsIgnoreCase("kbps")) {
+            return maxSpeed / unitFactor;
+        }
+        if (unit.equalsIgnoreCase("Mbps")) {
+            return maxSpeed;
+        }
+        if (unit.equalsIgnoreCase("Gbps")) {
+            return maxSpeed * unitFactor;
+        }
         return 0;
     }
 
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/vrf/VpnParam.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/vrf/VpnParam.java
deleted file mode 100644
index 11e64ae..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/vrf/VpnParam.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.util.vrf;
-
-public class VpnParam {
-
-    public String vpnId;
-    public String siteType;
-    public String spokeServiceInstanceId;
-    public String routeGroupName;
-}
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/vrf/VrfUtil.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/vrf/VrfUtil.java
deleted file mode 100644
index 74025f1..0000000
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/util/vrf/VrfUtil.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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.ccsdk.sli.adaptors.util.vrf;
-
-public class VrfUtil {
-
-    public static String createVrfInstanceName(
-            String serviceInstanceId,
-            String vpnId,
-            String siteType,
-            String routeGroup) {
-        if (vpnId == null || vpnId.trim().length() == 0)
-            return null;
-
-        String ss = "VPN-" + vpnId;
-        if (siteType != null && siteType.equalsIgnoreCase("hub"))
-            ss += "-HUB";
-        if (siteType != null && siteType.equalsIgnoreCase("spoke"))
-            ss += "-SP-" + serviceInstanceId;
-        if (routeGroup != null && routeGroup.trim().length() > 0)
-            ss += "-RG-" + routeGroup;
-
-        return ss;
-    }
-
-    public static VpnParam parseVrfInstanceName(String vrfInstanceName) {
-        VpnParam vpnParam = new VpnParam();
-
-        int i1 = vrfInstanceName.indexOf("-HUB");
-        if (i1 > 0)
-            vpnParam.siteType = "HUB";
-
-        int i2 = vrfInstanceName.indexOf("-SP-");
-        if (i2 > 0)
-            vpnParam.siteType = "SPOKE";
-
-        int i3 = vrfInstanceName.indexOf("-RG-");
-        if (i3 > 0)
-            vpnParam.routeGroupName = vrfInstanceName.substring(i3 + 4);
-
-        int i4 = vrfInstanceName.length();
-        if (i1 > 0)
-            i4 = i1;
-        else if (i2 > 0)
-            i4 = i2;
-        else if (i3 > 0)
-            i4 = i3;
-        vpnParam.vpnId = vrfInstanceName.substring(4, i4);
-
-        if (i2 > 0 && i3 < 0)
-            vpnParam.spokeServiceInstanceId = vrfInstanceName.substring(i2 + 4);
-        if (i2 > 0 && i3 > 0)
-            vpnParam.spokeServiceInstanceId = vrfInstanceName.substring(i2 + 4, i3);
-
-        return vpnParam;
-    }
-}
diff --git a/resource-assignment/provider/src/main/resources/org/opendaylight/blueprint/resource-assignment-blueprint.xml b/resource-assignment/provider/src/main/resources/org/opendaylight/blueprint/resource-assignment-blueprint.xml
index c2298af..11c284d 100755
--- a/resource-assignment/provider/src/main/resources/org/opendaylight/blueprint/resource-assignment-blueprint.xml
+++ b/resource-assignment/provider/src/main/resources/org/opendaylight/blueprint/resource-assignment-blueprint.xml
@@ -26,4 +26,6 @@
 
         <reference id="dblib.dataSource" interface="javax.sql.DataSource" filter="(objectClass=org.onap.ccsdk.sli.core.dblib.DbLibService)"/>
 
+        <service ref="resourceAllocator" interface="org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator"/>
+
 </blueprint>
diff --git a/resource-assignment/provider/src/main/resources/org/opendaylight/blueprint/resource-assignment.xml b/resource-assignment/provider/src/main/resources/org/opendaylight/blueprint/resource-assignment.xml
index 6e11c66..3fba3c7 100755
--- a/resource-assignment/provider/src/main/resources/org/opendaylight/blueprint/resource-assignment.xml
+++ b/resource-assignment/provider/src/main/resources/org/opendaylight/blueprint/resource-assignment.xml
@@ -77,7 +77,6 @@
 	<bean id="resourceManager" class="org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManagerImpl">
 		<property name="lockHelper" ref="lockHelper" />
 		<property name="resourceDao" ref="resourceDao" />
-		<property name="applicationId" value="SDNC" />
 		<property name="lockTimeout" value="600" /> <!-- Seconds -->
 	</bean>
 
@@ -105,29 +104,17 @@
 
 	<bean id="endPointAllocator" class="org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocatorImpl">
 		<property name="resourceManager" ref="resourceManager" />
-		<property name="endPointAllocationDefinitionMap">
+		<property name="allocationRuleMap">
 			<map>
 				<entry key="DEFAULT">
 					<list>
-                        <bean class="org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocationDefinition">
-                            <property name="serviceModel" value="DEFAULT" />
-                            <property name="endPointPosition" value="DEFAULT" />
-                            <property name="equipmentReader" ref="vnfReader" />
-                            <property name="allocationRuleList">
-                                <list>
-                                    <ref component-id="dbAllocationRule" />
-                                </list>
-                            </property>
-                        </bean>
+						<ref component-id="dbAllocationRule" />
 					</list>
 				</entry>
 			</map>
 		</property>
 	</bean>
 
-    <bean id="vnfReader" class="org.onap.ccsdk.sli.adaptors.ra.reader.VnfReader">
-    </bean>
-
 	<!-- Resource Allocation Rule Configuration -->
 
 	<bean id="dbAllocationRule" class="org.onap.ccsdk.sli.adaptors.ra.alloc.DbAllocationRule">
diff --git a/resource-assignment/provider/src/main/resources/resource-allocator.properties b/resource-assignment/provider/src/main/resources/resource-allocator.properties
deleted file mode 100644
index 72dbcf8..0000000
--- a/resource-assignment/provider/src/main/resources/resource-allocator.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# openECOMP : SDN-C
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights
-#                         reserved.
-# ================================================================================
-# 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=========================================================
-###
-
-org.onap.ccsdk.sli.adaptors.dbtype = jdbc
-org.onap.ccsdk.sli.adaptors.jdbc.url = jdbc:mysql://dbhost:3306/sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.database = sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.user = sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.password = gamma
diff --git a/resource-assignment/provider/src/main/resources/sql/001_resource_rule_ddl.sql b/resource-assignment/provider/src/main/resources/sql/001_resource_rule_ddl.sql
deleted file mode 100644
index f69b6bc..0000000
--- a/resource-assignment/provider/src/main/resources/sql/001_resource_rule_ddl.sql
+++ /dev/null
@@ -1,32 +0,0 @@
----
--- ============LICENSE_START=======================================================
--- openECOMP : SDN-C
--- ================================================================================
--- Copyright (C) 2017 AT&T Intellectual Property. All rights
---                         reserved.
--- ================================================================================
--- 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=========================================================
----
-
-CREATE TABLE resource_rule (
-  resource_rule_id SERIAL PRIMARY KEY,
-  resource_name VARCHAR(50) NOT NULL,
-  end_point_position VARCHAR(50) NOT NULL,
-  service_expression VARCHAR(2000) NOT NULL,
-  equipment_level VARCHAR(50) NOT NULL,
-  equipment_expression VARCHAR(2000) NOT NULL,
-  allocation_expression VARCHAR(2000) NOT NULL,
-  soft_limit_expression VARCHAR(2000) NOT NULL,
-  hard_limit_expression VARCHAR(2000) NOT NULL
-);
diff --git a/resource-assignment/provider/src/main/resources/sql/002_max_port_speed_ddl.sql b/resource-assignment/provider/src/main/resources/sql/002_max_port_speed_ddl.sql
deleted file mode 100644
index bc7baba..0000000
--- a/resource-assignment/provider/src/main/resources/sql/002_max_port_speed_ddl.sql
+++ /dev/null
@@ -1,29 +0,0 @@
----
--- ============LICENSE_START=======================================================
--- openECOMP : SDN-C
--- ================================================================================
--- Copyright (C) 2017 AT&T Intellectual Property. All rights
---                         reserved.
--- ================================================================================
--- 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=========================================================
----
-
-CREATE TABLE max_port_speed (
-  max_port_speed_id SERIAL PRIMARY KEY,
-  image_file_name VARCHAR(50) NOT NULL,
-  end_point_position VARCHAR(50) NOT NULL,
-  interface_name VARCHAR(100) NOT NULL,
-  max_speed BIGINT NOT NULL,
-  unit VARCHAR(10) NOT NULL
-);
diff --git a/resource-assignment/provider/src/main/resources/sql/003_max_server_speed_ddl.sql b/resource-assignment/provider/src/main/resources/sql/003_max_server_speed_ddl.sql
deleted file mode 100644
index e3f1839..0000000
--- a/resource-assignment/provider/src/main/resources/sql/003_max_server_speed_ddl.sql
+++ /dev/null
@@ -1,28 +0,0 @@
----
--- ============LICENSE_START=======================================================
--- openECOMP : SDN-C
--- ================================================================================
--- Copyright (C) 2017 AT&T Intellectual Property. All rights
---                         reserved.
--- ================================================================================
--- 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=========================================================
----
-
-CREATE TABLE max_server_speed (
-  max_server_speed_id SERIAL PRIMARY KEY,
-  server_model VARCHAR(50) NOT NULL,
-  evc_count SMALLINT NOT NULL,
-  max_speed BIGINT NOT NULL,
-  unit VARCHAR(10) NOT NULL
-);
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/DataSetup.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/DataSetup.java
index ba57f62..bba8e2b 100644
--- a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/DataSetup.java
+++ b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/DataSetup.java
@@ -3,14 +3,14 @@
  * openECOMP : SDN-C
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
+ * 						reserved.
  * ================================================================================
  * 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.
@@ -21,8 +21,6 @@
 
 package jtest.org.onap.ccsdk.sli.adaptors.ra;
 
-import java.util.Date;
-
 import jtest.util.org.onap.ccsdk.sli.adaptors.ra.TestDb;
 import jtest.util.org.onap.ccsdk.sli.adaptors.ra.TestTable;
 
@@ -30,231 +28,29 @@
 
     private TestDb testDb;
 
-    private TestTable vpePool = null;
-    private TestTable vplspePool = null;
-    private TestTable pserver = null;
-    private TestTable serviceResource = null;
     private TestTable resource = null;
     private TestTable allocationItem = null;
 
-    private static final String[] VPE_POOL_COLUMNS = {
-            "vpe_name", "ipv4_oam_address", "loopback0_ipv4_address", "provisioning_status", "aic_site_id",
-            "availability_zone", "vlan_id_outer", "vendor", "physical_intf_name", "physical_intf_speed",
-            "physical_intf_units", "vpe_uuid", "vpe_id", "image_filename" };
+    private static final String[] RESOURCE_COLUMNS = {"asset_id", "resource_name", "resource_type", "lt_used"};
 
-    private static final String[] VPLSPE_POOL_COLUMNS = {
-            "vplspe_name", "aic_site_id", "availability_zone", "physical_intf_name", "physical_intf_speed",
-            "physical_intf_units", "loopback0_ipv4_address", "vlan_id_outer", "vplspe_uuid", "image_filename",
-            "provisioning_status", "vendor" };
-
-    private static final String[] PSERVER_COLUMNS = {
-            "hostname", "ptnii_equip_name", "number_of_cpus", "disk_in_gigabytes", "ram_in_megabytes", "equip_type",
-            "equip_vendor", "equip_model", "fqdn", "pserver_selflink", "ipv4_oam_address", "serial_number",
-            "pserver_id", "internet_topology", "aic_site_id", "in_maint", "pserver_name2", "purpose" };
-
-    private static final String[] SERVICE_RESOURCE_COLUMNS = {
-            "service_instance_id", "service_status", "service_change_number", "resource_set_id", "resource_union_id" };
-
-    private static final String[] RESOURCE_COLUMNS = { "asset_id", "resource_name", "resource_type", "lt_used" };
-
-    private static final String[] ALLOCATION_ITEM_COLUMNS = {
-            "resource_id", "application_id", "resource_set_id", "resource_union_id", "resource_share_group_list",
-            "lt_used", "allocation_time" };
+    private static final String[] ALLOCATION_ITEM_COLUMNS = {"resource_id", "application_id", "resource_set_id",
+            "resource_union_id", "resource_share_group_list", "lt_used", "allocation_time"};
 
     private void initTables() {
-        if (vpePool == null)
-            vpePool = testDb.table("VPE_POOL", "vpe_name", VPE_POOL_COLUMNS);
-        if (vplspePool == null)
-            vplspePool = testDb.table("VPLSPE_POOL", "vplspe_name", VPLSPE_POOL_COLUMNS);
-        if (pserver == null)
-            pserver = testDb.table("PSERVER", "hostname", PSERVER_COLUMNS);
-        if (serviceResource == null)
-            serviceResource = testDb.table("SERVICE_RESOURCE", "service_resource_id", SERVICE_RESOURCE_COLUMNS);
-        if (resource == null)
+        if (resource == null) {
             resource = testDb.table("RESOURCE", "resource_id", RESOURCE_COLUMNS);
-        if (allocationItem == null)
+        }
+        if (allocationItem == null) {
             allocationItem = testDb.table("ALLOCATION_ITEM", "allocation_item_id", ALLOCATION_ITEM_COLUMNS);
+        }
     }
 
     public void cleanup() {
         initTables();
-        vpePool.delete("true");
-        vplspePool.delete("true");
-        pserver.delete("true");
-        serviceResource.delete("true");
         allocationItem.delete("true");
         resource.delete("true");
     }
 
-    public void setupVpePort(
-            String aicSiteId,
-            String vpeId,
-            String interfaceName,
-            String provStatus,
-            String imageFileName) {
-        initTables();
-        vpePool.add(vpeId, "127.0.0.1", "107.134.152.139", provStatus, aicSiteId, "mtanj-esx-az01", "3501",
-                "JUNIPER", interfaceName, "1", "GBPS", "vpe002", "VPESAT-auttx200me6", imageFileName);
-    }
-
-    public void setupVplspePort(
-            String aicSiteId,
-            String vplspeId,
-            String interfaceName,
-            String provStatus,
-            String imageFileName) {
-        initTables();
-        vplspePool.add(vplspeId, aicSiteId, "mtanj-esx-az01", interfaceName, "100", "GBPS", "192.168.119.32", "3501",
-                "vpls002", imageFileName, provStatus, "JUNIPER");
-    }
-
-    public void setupPserver(String hostname, String aicSiteId) {
-        initTables();
-        pserver.add(hostname, hostname + "srv1", 4, 1000, 16000, "equip_type", "equip_vendor", "equip_model", "fqdn",
-                "pserver_selflink", "123.123.123.123", "serial_number", "pserver_id", "internet_topology", aicSiteId,
-                "N", hostname, "purpose");
-    }
-
-    public void setupService(
-            String serviceInstanceId,
-            String status,
-            int changeNumber,
-            long speedKbps,
-            String vpeId,
-            String vplspeId,
-            String serverId) {
-        initTables();
-
-        String resourceSetId = serviceInstanceId + "/" + changeNumber;
-        String resourceUnionId = serviceInstanceId;
-
-        serviceResource.add(serviceInstanceId, status, changeNumber, resourceSetId, resourceUnionId);
-
-        Long rid = resource.getId("asset_id = '" + vpeId + "/ae0' AND resource_name = 'Bandwidth'");
-        if (rid == null) {
-            resource.add(vpeId + "/ae0", "Bandwidth", "Limit", 1);
-            rid = resource.getLastId();
-        }
-        allocationItem.add(rid, "SDNC", resourceSetId, resourceUnionId, null, speedKbps, new Date());
-
-        rid = resource.getId("asset_id = '" + vplspeId + "' AND resource_name = 'Bandwidth'");
-        if (rid == null) {
-            resource.add(vplspeId, "Bandwidth", "Limit", 1);
-            rid = resource.getLastId();
-        }
-        allocationItem.add(rid, "SDNC", resourceSetId, resourceUnionId, null, speedKbps, new Date());
-
-        rid = resource.getId("asset_id = '" + serverId + "' AND resource_name = 'Bandwidth'");
-        if (rid == null) {
-            resource.add(serverId, "Bandwidth", "Limit", 1);
-            rid = resource.getLastId();
-        }
-        allocationItem.add(rid, "SDNC", resourceSetId, resourceUnionId, null, speedKbps, new Date());
-
-        rid = resource.getId("asset_id = '" + serverId + "' AND resource_name = 'Connection'");
-        if (rid == null) {
-            resource.add(serverId, "Connection", "Limit", 1);
-            rid = resource.getLastId();
-        }
-        allocationItem.add(rid, "SDNC", resourceSetId, resourceUnionId, null, 1, new Date());
-    }
-
-    public boolean serviceNotInDb(String serviceInstanceId, String status, Integer changeNumber) {
-        String where = "service_instance_id = '" + serviceInstanceId + "'";
-        if (status != null)
-            where += " AND service_status = '" + status + "'";
-        if (changeNumber != null)
-            where += " AND service_change_number = " + changeNumber;
-
-        if (serviceResource.exists(where))
-            return false;
-
-        where = "resource_union_id = '" + serviceInstanceId + "'";
-        if (changeNumber != null)
-            where += " AND resource_set_id = '" + serviceInstanceId + "/" + changeNumber + "'";
-
-        if (allocationItem.exists(where))
-            return false;
-
-        return true;
-    }
-
-    public boolean serviceCorrectInDb(String serviceInstanceId, String status, int changeNumber, long speedKbps) {
-        String where = "service_instance_id = '" + serviceInstanceId + "' AND service_status = '" + status +
-                "' AND service_change_number = " + changeNumber;
-        if (!serviceResource.exists(where))
-            return false;
-
-        where = "resource_union_id = '" + serviceInstanceId + "' AND resource_set_id = '" + serviceInstanceId + "/" +
-                changeNumber + "' AND lt_used = " + speedKbps;
-        if (!allocationItem.exists(where))
-            return false;
-
-        return true;
-    }
-
-    public boolean serviceCorrectInDb(
-            String vpeId,
-            String aicSiteId,
-            String serviceInstanceId,
-            String status,
-            int changeNumber,
-            long speedKbps) {
-
-        String where = "service_instance_id = '" + serviceInstanceId + "' AND service_status = '" + status +
-                "' AND service_change_number = " + changeNumber;
-        if (!serviceResource.exists(where))
-            return false;
-
-        Long vpebwrid = resource.getId("asset_id = '" + vpeId + "/ae0' AND resource_name = 'Bandwidth'");
-        if (vpebwrid == null)
-            return false;
-
-        where = "resource_id = " + vpebwrid + " AND resource_union_id = '" + serviceInstanceId +
-                "' AND resource_set_id = '" + serviceInstanceId + "/" + changeNumber + "' AND lt_used = " + speedKbps;
-        if (!allocationItem.exists(where))
-            return false;
-
-        Long srvbwrid = resource.getId("asset_id = '" + aicSiteId + "/Server1' AND resource_name = 'Bandwidth'");
-        if (srvbwrid == null)
-            return false;
-
-        where = "resource_id = " + srvbwrid + " AND resource_union_id = '" + serviceInstanceId +
-                "' AND resource_set_id = '" + serviceInstanceId + "/" + changeNumber + "' AND lt_used = " + speedKbps;
-        if (!allocationItem.exists(where))
-            return false;
-
-        Long srvconrid = resource.getId("asset_id = '" + aicSiteId + "/Server1' AND resource_name = 'Connection'");
-        if (srvconrid == null)
-            return false;
-
-        where = "resource_id = " + srvconrid + " AND resource_union_id = '" + serviceInstanceId +
-                "' AND resource_set_id = '" + serviceInstanceId + "/" + changeNumber + "' AND lt_used = 1";
-        if (!allocationItem.exists(where))
-            return false;
-
-        return true;
-    }
-
-    public boolean serviceCorrectInDb(
-            String serviceInstanceId,
-            String endPointPosition,
-            String status,
-            int changeNumber,
-            long speedKbps) {
-        String where = "service_instance_id = '" + serviceInstanceId + "' AND service_status = '" + status +
-                "' AND service_change_number = " + changeNumber;
-        if (!serviceResource.exists(where))
-            return false;
-
-        where = "resource_union_id = '" + serviceInstanceId + "/" + endPointPosition + "' AND resource_set_id = '" +
-                serviceInstanceId + "/" + endPointPosition + "/" + changeNumber + "' AND lt_used = " + speedKbps;
-        if (!allocationItem.exists(where))
-            return false;
-
-        return true;
-    }
-
     public void setTestDb(TestDb testDb) {
         this.testDb = testDb;
     }
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestIsAvailable.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestIsAvailable.java
deleted file mode 100644
index 4dee2d6..0000000
--- a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestIsAvailable.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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 jtest.org.onap.ccsdk.sli.adaptors.ra;
-
-import org.junit.Assert;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.MethodSorters;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
-import org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath:test-context.xml" })
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestIsAvailable {
-
-    private static final Logger log = LoggerFactory.getLogger(TestIsAvailable.class);
-
-    @Autowired(required = true)
-    private ResourceAllocator resourceAllocator;
-
-    @Autowired(required = true)
-    private DataSetup dataSetup;
-
-    @Test
-    public void test001() throws Exception {
-        String t = "001";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test successful response - all resources available");
-
-        String service1 = "isAvailable" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test002() throws Exception {
-        String t = "002";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test capacity not found - request very big number that is above the limits");
-
-        String service1 = "isAvailable" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Gbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        String maxAvailableSpeed = ctx.getAttribute("tmp.resource-allocator-output.max-available-speed");
-        String speedUnit = ctx.getAttribute("tmp.resource-allocator-output.speed-unit");
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " + maxAvailableSpeed);
-        log.info("  tmp.resource-allocator-output.speed-unit: " + speedUnit);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(maxAvailableSpeed.equals("960000"));
-        Assert.assertTrue(speedUnit.equals("kbps"));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test003() throws Exception {
-        String t = "003";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test capacity not found - PROV check for VPE");
-
-        String service1 = "isAvailable" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "---", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        String maxAvailableSpeed = ctx.getAttribute("tmp.resource-allocator-output.max-available-speed");
-        String speedUnit = ctx.getAttribute("tmp.resource-allocator-output.speed-unit");
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " + maxAvailableSpeed);
-        log.info("  tmp.resource-allocator-output.speed-unit: " + speedUnit);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(maxAvailableSpeed.equals("0"));
-        Assert.assertTrue(speedUnit.equals("kbps"));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test004() throws Exception {
-        String t = "004";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test capacity not found - PROV check for VPLSPE");
-
-        String service1 = "isAvailable" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "---", null);
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        String maxAvailableSpeed = ctx.getAttribute("tmp.resource-allocator-output.max-available-speed");
-        String speedUnit = ctx.getAttribute("tmp.resource-allocator-output.speed-unit");
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " + maxAvailableSpeed);
-        log.info("  tmp.resource-allocator-output.speed-unit: " + speedUnit);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(maxAvailableSpeed.equals("0"));
-        Assert.assertTrue(speedUnit.equals("kbps"));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test005() throws Exception {
-        String t = "005";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test capacity not found - VPE not found in DB");
-
-        String service1 = "isAvailable" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        String maxAvailableSpeed = ctx.getAttribute("tmp.resource-allocator-output.max-available-speed");
-        String speedUnit = ctx.getAttribute("tmp.resource-allocator-output.speed-unit");
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " + maxAvailableSpeed);
-        log.info("  tmp.resource-allocator-output.speed-unit: " + speedUnit);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(maxAvailableSpeed.equals("0"));
-        Assert.assertTrue(speedUnit.equals("kbps"));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test006() throws Exception {
-        String t = "006";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test capacity not found - VPLSPE not found in DB");
-
-        String service1 = "isAvailable" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        String maxAvailableSpeed = ctx.getAttribute("tmp.resource-allocator-output.max-available-speed");
-        String speedUnit = ctx.getAttribute("tmp.resource-allocator-output.speed-unit");
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " + maxAvailableSpeed);
-        log.info("  tmp.resource-allocator-output.speed-unit: " + speedUnit);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(maxAvailableSpeed.equals("0"));
-        Assert.assertTrue(speedUnit.equals("kbps"));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test007() throws Exception {
-        String t = "007";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test capacity not found - test max available speed calculation");
-
-        String service1 = "isAvailable" + t + "/service1";
-        String existingService1 = "isAvailable" + t + "/existing-service1";
-        String existingService2 = "isAvailable" + t + "/existing-service2";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv127", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(existingService1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1",
-                "MTSNJA4LCP1/Server1");
-        dataSetup.setupService(existingService2, "Active", 3, 100000, "mtanjrsv127", "mtsnj303vr1",
-                "MTSNJA4LCP1/Server1");
-        dataSetup.setupService(existingService2, "Pending", 4, 500000, "mtanjrsv127", "mtsnj303vr1",
-                "MTSNJA4LCP1/Server1");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Gbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        String maxAvailableSpeed = ctx.getAttribute("tmp.resource-allocator-output.max-available-speed");
-        String speedUnit = ctx.getAttribute("tmp.resource-allocator-output.speed-unit");
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " + maxAvailableSpeed);
-        log.info("  tmp.resource-allocator-output.speed-unit: " + speedUnit);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(maxAvailableSpeed.equals("260000"));
-        Assert.assertTrue(speedUnit.equals("kbps"));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test008() throws Exception {
-        String t = "008";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test capacity not found - test server limit depending on number of connections");
-
-        String service1 = "isAvailable" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv127", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        for (int i = 1; i <= 13; i++)
-            dataSetup.setupService("isAvailable" + t + "/existing-service" + i, "Active", 2, 20000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Gbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        String maxAvailableSpeed = ctx.getAttribute("tmp.resource-allocator-output.max-available-speed");
-        String speedUnit = ctx.getAttribute("tmp.resource-allocator-output.speed-unit");
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " + maxAvailableSpeed);
-        log.info("  tmp.resource-allocator-output.speed-unit: " + speedUnit);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(maxAvailableSpeed.equals("340000"));
-        Assert.assertTrue(speedUnit.equals("kbps"));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test009() throws Exception {
-        String t = "009";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test successful response - no service instance id in input - all resources available");
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-    }
-
-    @Test
-    public void test010() throws Exception {
-        String t = "010";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test input validations - no aic-site-id in input");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Gbps");
-
-        try {
-            resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-        } catch (SvcLogicException e) {
-            Assert.assertTrue(e.getMessage().equals(
-                    "tmp.resource-allocator.aic-site-id is required in ResourceAllocator"));
-            return;
-        }
-        Assert.fail("SvcLogicException expected");
-    }
-
-    @Test
-    public void test011() throws Exception {
-        String t = "011";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test input validations - speed not a number in input");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.speed", "nnnnn");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Gbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        try {
-            resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-        } catch (SvcLogicException e) {
-            Assert.assertTrue(e.getMessage().equals("Invalid tmp.resource-allocator.speed. Must be a number."));
-            return;
-        }
-        Assert.fail("SvcLogicException expected");
-    }
-
-    @Test
-    public void test012() throws Exception {
-        String t = "012";
-        log.info("============== isAvailable " + t + " ================================");
-        log.info("=== Test input validations - speed-unit missing in input");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        try {
-            resourceAllocator.isAvailable("NetworkCapacity", null, null, ctx);
-        } catch (SvcLogicException e) {
-            Assert.assertTrue(e.getMessage().equals(
-                    "tmp.resource-allocator.speed-unit is required in ResourceAllocator"));
-            return;
-        }
-        Assert.fail("SvcLogicException expected");
-    }
-}
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestLockHelper.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestLockHelper.java
new file mode 100644
index 0000000..6564dc3
--- /dev/null
+++ b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestLockHelper.java
@@ -0,0 +1,59 @@
+package jtest.org.onap.ccsdk.sli.adaptors.ra;
+
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.MethodSorters;
+import org.onap.ccsdk.sli.adaptors.lock.comp.LockHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations = { "classpath:test-context.xml" })
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestLockHelper {
+
+    private static final Logger log = LoggerFactory.getLogger(TestLockHelper.class);
+
+    @Autowired
+    private LockHelper lockHelper;
+
+    @Test
+    public void test1() throws Exception {
+        LockThread t1 = new LockThread("req1");
+        LockThread t2 = new LockThread("req2");
+        LockThread t3 = new LockThread("req3");
+
+        t1.start();
+        t2.start();
+        t3.start();
+
+        t1.join();
+        t2.join();
+        t3.join();
+    }
+
+    private class LockThread extends Thread {
+        private String requester;
+
+        public LockThread(String requester) {
+            this.requester = requester;
+        }
+
+        @Override
+        public void run() {
+            lockHelper.lock("resource1", requester, 20);
+
+            try {
+                Thread.sleep(500);
+            } catch (InterruptedException e) {
+                log.warn("Thread interrupted: " + e.getMessage(), e);
+            }
+
+            lockHelper.unlock("resource1", false);
+        }
+    }
+}
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestQuery.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestQuery.java
deleted file mode 100644
index 435f4aa..0000000
--- a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestQuery.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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 jtest.org.onap.ccsdk.sli.adaptors.ra;
-
-import org.junit.Assert;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.MethodSorters;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
-import org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath:test-context.xml" })
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestQuery {
-
-    private static final Logger log = LoggerFactory.getLogger(TestQuery.class);
-
-    @Autowired(required = true)
-    private ResourceAllocator resourceAllocator;
-
-    @Autowired(required = true)
-    private DataSetup dataSetup;
-
-    @Test
-    public void test001() throws Exception {
-        String t = "001";
-        log.info("============== query " + t + " ================================");
-        log.info("=== Test reading assigned resources (subinterface-id, vlan-id-inner)");
-
-        String service1 = "ICOREPVC" + t + "-1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-model", "L3AVPN-EVC");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-        ctx.setAttribute("tmp.resource-allocator.vpn-id", "123");
-        ctx.setAttribute("tmp.resource-allocator.vrf-required", "false");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "VPE-Cust", "Pending", 1, 300000));
-
-        st = resourceAllocator.query("NetworkCapacity", true, null, service1, "end-point", null, ctx);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertEquals(ctx.getAttribute("end-point.subinterface-id"), "100");
-        Assert.assertEquals(ctx.getAttribute("end-point.vlan-id-inner"), "2");
-        Assert.assertEquals(ctx.getAttribute("end-point.vpe-name"), "mtanjrsv126");
-        Assert.assertEquals(ctx.getAttribute("end-point.affinity-link"), "1");
-    }
-}
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestRelease.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestRelease.java
deleted file mode 100644
index 6210225..0000000
--- a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestRelease.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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 jtest.org.onap.ccsdk.sli.adaptors.ra;
-
-import org.junit.Assert;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.MethodSorters;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
-import org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath:test-context.xml" })
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestRelease {
-
-    private static final Logger log = LoggerFactory.getLogger(TestRelease.class);
-
-    @Autowired(required = true)
-    private ResourceAllocator resourceAllocator;
-
-    @Autowired(required = true)
-    private DataSetup dataSetup;
-
-    @Test
-    public void test001() throws Exception {
-        String t = "001";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - cancel - new start");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Pending", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Pending", 2, 200000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Cancel");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test002() throws Exception {
-        String t = "002";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - cancel - change");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        dataSetup.setupService(service1, "Pending", 3, 400000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Pending", 3, 400000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Cancel");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 3));
-    }
-
-    @Test
-    public void test003() throws Exception {
-        String t = "003";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - cancel - active there, but no pending - should do nothing and return success");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Cancel");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-    }
-
-    @Test
-    public void test004() throws Exception {
-        String t = "004";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - cancel - nothing in DB - should return success");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Cancel");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test005() throws Exception {
-        String t = "005";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - activate - new start");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Pending", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Pending", 2, 200000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Activate");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-    }
-
-    @Test
-    public void test006() throws Exception {
-        String t = "006";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - actovate - change");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        dataSetup.setupService(service1, "Pending", 3, 400000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Pending", 3, 400000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Activate");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 3, 400000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 2));
-    }
-
-    @Test
-    public void test007() throws Exception {
-        String t = "007";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - activate - active there, but no pending - should do nothing and return success");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Activate");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-    }
-
-    @Test
-    public void test008() throws Exception {
-        String t = "008";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - activate - nothing in DB - should return success");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Activate");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test009() throws Exception {
-        String t = "009";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - disconnect - only pending in DB");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Pending", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Pending", 2, 200000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Disconnect");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test010() throws Exception {
-        String t = "010";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - disconnect - only active in DB");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Disconnect");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test011() throws Exception {
-        String t = "011";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - disconnect - both active and pending in DB");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        dataSetup.setupService(service1, "Pending", 3, 400000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "Pending", 3, 400000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Disconnect");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test012() throws Exception {
-        String t = "012";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test release - disconnect - nothing in DB - should return success");
-
-        String service1 = "release" + t + "/service1";
-
-        dataSetup.cleanup();
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Disconnect");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        QueryStatus st = resourceAllocator.release("NetworkCapacity", null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test013() throws Exception {
-        String t = "013";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test input validations - request-type missing in input");
-
-        String service1 = "release" + t + "/service1";
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        try {
-            resourceAllocator.release("NetworkCapacity", null, ctx);
-        } catch (SvcLogicException e) {
-            Assert.assertTrue(e.getMessage().equals(
-                    "tmp.resource-allocator.request-type is required in ResourceAllocator"));
-            return;
-        }
-        Assert.fail("SvcLogicException expected");
-    }
-
-    @Test
-    public void test014() throws Exception {
-        String t = "014";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test input validations - invalid request-type in input");
-
-        String service1 = "release" + t + "/service1";
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "xxxxx");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-
-        try {
-            resourceAllocator.release("NetworkCapacity", null, ctx);
-        } catch (SvcLogicException e) {
-            Assert.assertTrue(e.getMessage().equals(
-                    "Invalid tmp.resource-allocator.request-type: xxxxx. Supported values are Cancel, Activate, Disconnect."));
-            return;
-        }
-        Assert.fail("SvcLogicException expected");
-    }
-
-    @Test
-    public void test015() throws Exception {
-        String t = "015";
-        log.info("============== release " + t + " ================================");
-        log.info("=== Test input validations - missing service-instance-id in input");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Cancel");
-
-        try {
-            resourceAllocator.release("NetworkCapacity", null, ctx);
-        } catch (SvcLogicException e) {
-            Assert.assertTrue(e.getMessage().equals(
-                    "tmp.resource-allocator.service-instance-id is required in ResourceAllocator"));
-            return;
-        }
-        Assert.fail("SvcLogicException expected");
-    }
-}
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
index a4ee525..c420075 100644
--- a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
+++ b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
@@ -1,51 +1,58 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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 jtest.org.onap.ccsdk.sli.adaptors.ra;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import org.junit.Assert;
 import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.MethodSorters;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
 import org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceEntity;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceRequest;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse;
+import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceTarget;
+import org.onap.ccsdk.sli.adaptors.rm.data.AllocationStatus;
+import org.onap.ccsdk.sli.adaptors.util.str.StrUtil;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import jtest.util.org.onap.ccsdk.sli.adaptors.ra.TestTable;
 
 @RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath:test-context.xml" })
+@ContextConfiguration(locations = {"classpath:test-context.xml"})
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestReserve {
 
     private static final Logger log = LoggerFactory.getLogger(TestReserve.class);
 
+    private JdbcTemplate jdbcTemplate;
+
+    private static final String[] RESOURCE_COLUMNS = {"asset_id", "resource_name", "resource_type", "lt_used"};
+
+    private static final String[] ALLOCATION_ITEM_COLUMNS = {"resource_id", "application_id", "resource_set_id",
+            "resource_union_id", "resource_share_group_list", "lt_used", "allocation_time"};
+
+
+    @Autowired
+    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
+        this.jdbcTemplate = jdbcTemplate;
+    }
+
     @Autowired(required = true)
     private ResourceAllocator resourceAllocator;
 
+    /*
+     * @Autowired(required = true) private ResourceAllocatorApi resourceAllocatorApi;
+     */
+
     @Autowired(required = true)
     private DataSetup dataSetup;
 
@@ -55,627 +62,576 @@
         log.info("============== reserve " + t + " ================================");
         log.info("=== Test successful response - new start - all resources available");
 
-        String service1 = "reserve" + t + "/service1";
+        // String service1 = "reserve" + t + "/service1";
 
         dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupPserver("server1", "MTSNJA4LCP1");
+
+        TestTable resource = new TestTable(jdbcTemplate, "RESOURCE", "resource_id", RESOURCE_COLUMNS);
+        TestTable allocationItem =
+                new TestTable(jdbcTemplate, "ALLOCATION_ITEM", "allocation_item_id", ALLOCATION_ITEM_COLUMNS);
+
 
         SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
+        ctx.setAttribute("ra-input.service-model", "ADIG");
+        ctx.setAttribute("ra-input.check-only", "false");
+        ctx.setAttribute("ra-input.reservation-entity-type", "SI");
+        ctx.setAttribute("ra-input.reservation-entity-id", "ICOREPVCID-123456");
+        ctx.setAttribute("ra-input.reservation-entity-data.service-speed", "100");
+        ctx.setAttribute("ra-input.reservation-entity-data.service-speed-unit", "Mbps");
+
+        ctx.setAttribute("ra-input.reservation-target-data.vnf-type", "VPE");
+        ctx.setAttribute("ra-input.reservation-target-data.vpe-name", "mdt300vpe54");
+        ctx.setAttribute("ra-input.reservation-target-id", "mdt300vpe54");
+        ctx.setAttribute("ra-input.reservation-target-type", "VNF");
+
+        ctx.setAttribute("ra-input.reservation-target-data.max-vpe-bandwidth-mbps", "5000");
+
 
         QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
 
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
+        Assert.assertTrue(st == QueryStatus.SUCCESS);
+
+        resource.print();
+        allocationItem.print();
+
+        ctx.setAttribute("ra-input.service-model", "ADIG");
+        ctx.setAttribute("ra-input.check-only", "false");
+        ctx.setAttribute("ra-input.reservation-entity-type", "SI");
+        ctx.setAttribute("ra-input.reservation-entity-id", "ICOREPVCID-123456");
+        ctx.setAttribute("ra-input.reservation-entity-data.service-speed", "100");
+        ctx.setAttribute("ra-input.reservation-entity-data.service-speed-unit", "Mbps");
+
+        ctx.setAttribute("ra-input.reservation-target-data.service-speed", "100");
+        ctx.setAttribute("ra-input.reservation-target-data.service-speed-unit", "Mbps");
+        ctx.setAttribute("ra-input.reservation-target-id", "ICORESITEID-123456");
+        ctx.setAttribute("ra-input.reservation-target-type", "Port");
+
+
+        st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
 
         Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 1, 300000));
+
+        ctx.setAttribute("ra-input.service-model", "ADIG");
+        ctx.setAttribute("ra-input.check-only", "false");
+        ctx.setAttribute("ra-input.reservation-entity-type", "SI");
+        ctx.setAttribute("ra-input.reservation-entity-id", "ICOREPVCID-123456");
+        ctx.setAttribute("ra-input.reservation-entity-data.service-speed", "100");
+        ctx.setAttribute("ra-input.reservation-entity-data.service-speed-unit", "Mbps");
+
+        ctx.setAttribute("ra-input.reservation-target-data.vnf-type", "VPE");
+        ctx.setAttribute("ra-input.reservation-target-data.vpe-name", "mdt300vpe54");
+        ctx.setAttribute("ra-input.reservation-target-id", "mdt300vpe54");
+        ctx.setAttribute("ra-input.reservation-target-type", "AffinityLink");
+
+
+        st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+
+        Assert.assertTrue(st == QueryStatus.SUCCESS);
+
+        resource.print();
+        allocationItem.print();
+
+
+        /* Query Using ReservationEntityId using ServiceLogicContext */
+        ctx = new SvcLogicContext();
+        ctx.setAttribute("ra-input.service-model", "ADIG");
+        ctx.setAttribute("ra-input.reservation-entity-id", "ICOREPVCID-123456");
+        ctx.setAttribute("ra-input.reservation-entity-type", "SI");
+
+
+        st = resourceAllocator.query("NetworkCapacity", false, null, null, null, null, ctx);
+        Assert.assertTrue(st == QueryStatus.SUCCESS);
+
+
+        /* Query Using ReservationTargetId using ServiceLogicContext */
+        ctx = new SvcLogicContext();
+        ctx.setAttribute("ra-input.service-model", "ADIG");
+        ctx.setAttribute("ra-input.reservation-target-id", "ICORESITEID-123456");
+        ctx.setAttribute("ra-input.reservation-target-type", "Port");
+        ctx.setAttribute("ra-input.resource-name", "Bandwidth");
+
+        st = resourceAllocator.query("NetworkCapacity", false, null, null, null, null, ctx);
+        Assert.assertTrue(st == QueryStatus.SUCCESS);
+
+        log.info("========================  Query Using ResourceEntity==============================");
+        /* Query Using ResourceEntity bean */
+        ResourceEntity sd = new ResourceEntity();
+        sd.resourceEntityId = "ICOREPVCID-123456";
+        sd.resourceEntityType = "SI";
+
+
+        ResourceRequest rr = new ResourceRequest();
+        rr.serviceModel = "ADIG";
+        rr.resourceName = "cust-vlan-id";
+        rr.requestType = "New";
+        rr.rangeMaxOverride = -1;
+        rr.rangeMinOverride = -1;
+
+        List<ResourceResponse> rsList = new ArrayList<>();
+        resourceAllocator.query(sd, null, null, rsList);
+
+        rsList.forEach(r -> {
+            StrUtil.info(log, r);
+        });
+
+        log.info("========================  release Using ResourceEntity==============================");
+        rsList = new ArrayList<>();
+        AllocationStatus status = resourceAllocator.release(sd);
+        Assert.assertTrue(status == AllocationStatus.Success);
+
+
+        log.info("========================  Query Using ResourceEntity==============================");
+        rsList = new ArrayList<>();
+        resourceAllocator.query(sd, null, null, rsList);
+
+
+        rsList.forEach(r -> {
+            StrUtil.info(log, r);
+        });
+
     }
 
     @Test
     public void test002() throws Exception {
         String t = "002";
         log.info("============== reserve " + t + " ================================");
-        log.info("=== Test successful response - new start supp - all resources available");
+        log.info("=== Test successful response - new start - all resources available");
 
-        String service1 = "reserve" + t + "/service1";
+        Map<String, String> data = new HashMap<>();
+        data.put("service-speed", "100");
+        data.put("service-speed-unit", "Mbps");
 
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Pending", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
+        ResourceEntity sd = new ResourceEntity();
+        sd.resourceEntityId = "ICOREPVCID-123456";
+        sd.resourceEntityType = "SI";
+        sd.data = data;
 
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 2, 200000));
+        data = new HashMap<>();
+        data.put("vnf-type", "VPE");
+        data.put("vpe-name", "mdt300vpe54");
+        data.put("max-vpe-bandwidth-mbps", "5000");
 
-        SvcLogicContext ctx = new SvcLogicContext();
-        // ctx.setAttribute("tmp.resource-allocator.request-type", "New"); - Default is New
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "400");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
+        ResourceTarget rt = new ResourceTarget();
+        rt.resourceTargetId = "mdt300vpe54";
+        rt.resourceTargetType = "VNF";
+        rt.data = data;
 
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+        ResourceRequest rr = new ResourceRequest();
+        rr.serviceModel = "ADIG";
+        // rr.resourceName = "cust-vlan-id";
+        rr.requestType = "New";
+        rr.rangeMaxOverride = -1;
+        rr.rangeMinOverride = -1;
 
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
+        List<ResourceResponse> rsList = new ArrayList<>();
 
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 400000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 2));
+        resourceAllocator.reserve(sd, rt, rr, rsList);
+
+        rsList.forEach(r -> {
+            StrUtil.info(log, r);
+        });
+
+        log.info("========================  Query + t ==============================");
+        rsList = new ArrayList<>();
+        resourceAllocator.query(sd, null, rr, rsList);
+
+        rsList.forEach(r -> {
+            StrUtil.info(log, r);
+        });
+
     }
-
+    
+    
     @Test
-    public void test003() throws Exception {
-        String t = "003";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test successful response - change - all resources available");
+	public void test003() throws Exception {
+		String t = "003";
+		log.info("============== reserve " + t + " ================================");
+		log.info("=== Test successful response - new start - all resources available");
+		
+		ResourceEntity sd = new ResourceEntity();
+		sd.resourceEntityId = "gblond2003me6";
+		sd.resourceEntityType = "VNF";
+		
+		ResourceTarget rt = new ResourceTarget();
+		rt.resourceTargetId = "MDTWNJ21A5";
+		rt.resourceTargetType = "Site";
 
-        String service1 = "reserve" + t + "/service1";
+		
+		ResourceRequest rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL";
+		rr.resourceName = "VPE-Cust";
+		//rr.requestType = "New";
+		//rr.rangeMaxOverride = 5;
+		//rr.rangeMinOverride = 5;
+		
+		List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
+		resourceAllocator.reserve(sd, rt, rr, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
+		
+		log.info("========================  Query + t ==============================");
+		rsList = new ArrayList<org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse>();
+		resourceAllocator.query(sd, null, rr, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
 
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
+	}
+	
+	
+	
+	
+	@Test
+	public void test004() throws Exception {
+		String t = "004";
+		log.info("============== reserve " + t + " ================================");
+		log.info("=== Test successful response - new start - all resources available");
+		
+		ResourceEntity sd = new ResourceEntity();
+		sd.resourceEntityId = "gblond2003me6";
+		sd.resourceEntityType = "VNF";
+		
+		ResourceTarget rt = new ResourceTarget();
+		rt.resourceTargetId = "MDTWNJ21A5";
+		rt.resourceTargetType = "Site";
 
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
+		List<ResourceRequest> rrs = new ArrayList<ResourceRequest>();
+		ResourceRequest rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL";
+		rr.resourceName = "VPE-Cust";
+		rrs.add(rr);
+		
+		rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL";
+		rr.resourceName = "VPE-Core1";
+		rrs.add(rr);
+		
+		rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL";
+		rr.resourceName = "VPE-Core2";
+		rrs.add(rr);
+		
+		
+		
+		List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
+		//resourceAllocator.reserve(sd, rt, rrs, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
+		
+		log.info("========================  Query + t ==============================");
+		rsList = new ArrayList<org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse>();
+		resourceAllocator.query(sd, null, rr, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
 
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "400");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
+	}
+	
+	
+	@Test
+	public void test005() throws Exception {
+		String t = "005";
+		log.info("============== reserve " + t + " ================================");
+		log.info("=== Test successful response - new start - all resources available");
 
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+		//String service1 = "reserve" + t + "/service1";
 
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
+		dataSetup.cleanup();
+		
+		TestTable resource = new TestTable(jdbcTemplate, "RESOURCE", "resource_id", RESOURCE_COLUMNS);
+		TestTable allocationItem = new TestTable(jdbcTemplate, "ALLOCATION_ITEM", "allocation_item_id",
+				ALLOCATION_ITEM_COLUMNS);
+		
+		
+		SvcLogicContext ctx = new SvcLogicContext();
+		ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
+		ctx.setAttribute("ra-input.check-only", "false");
+		ctx.setAttribute("ra-input.reservation-entity-type", "VPE-Cust");
+		ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
 
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 400000));
-    }
+		ctx.setAttribute("ra-input.reservation-target-id", "MDTWNJ21A5");
+		ctx.setAttribute("ra-input.reservation-target-type", "Site");
+		
+		ctx.setAttribute("ra-input.resource-name", "cust-vlan-id");
 
-    @Test
-    public void test004() throws Exception {
-        String t = "004";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test successful response - change supp - all resources available");
+		
+		QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+		
+		Assert.assertTrue(st == QueryStatus.SUCCESS);
+		
+		resource.print();
+		allocationItem.print();
+		
+		ctx = new SvcLogicContext();
+		ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
+		ctx.setAttribute("ra-input.check-only", "false");
+		ctx.setAttribute("ra-input.reservation-entity-type", "VPE-Core1");
+		ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
 
-        String service1 = "reserve" + t + "/service1";
+		ctx.setAttribute("ra-input.reservation-target-id", "MDTWNJ21A5");
+		ctx.setAttribute("ra-input.reservation-target-type", "Site");
+		
+		ctx.setAttribute("ra-input.resource-name", "vlan-id-inner");
 
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        dataSetup.setupService(service1, "Pending", 3, 400000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
+		
+		st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+		
+		Assert.assertTrue(st == QueryStatus.SUCCESS);
+		
+		resource.print();
+		allocationItem.print();
+		
+		ctx = new SvcLogicContext();
+		ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
+		ctx.setAttribute("ra-input.check-only", "false");
+		ctx.setAttribute("ra-input.reservation-entity-type", "VPE-Core2");
+		ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
 
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 400000));
+		ctx.setAttribute("ra-input.reservation-target-id", "MDTWNJ21A5");
+		ctx.setAttribute("ra-input.reservation-target-type", "Site");
+		
+		ctx.setAttribute("ra-input.resource-name", "vlan-id-inner");
+		ctx.setAttribute("ra-input.replace", "false");
 
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "500");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
+		
+		st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+		
+		Assert.assertTrue(st == QueryStatus.SUCCESS);
+		
+		resource.print();
+		allocationItem.print();
+		
+		
+		/*Query Using ReservationEntityId using ServiceLogicContext*/
+		ctx = new SvcLogicContext();
+		ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
+		ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
+		ctx.setAttribute("ra-input.reservation-entity-type", "VPE-Core1");
 
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+		
+		st = resourceAllocator.query("NetworkCapacity", false, null, null, null, null, ctx);
+		Assert.assertTrue(st == QueryStatus.SUCCESS);
 
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
+		
+		/*Query Using ReservationTargetId using ServiceLogicContext*/
+		ctx = new SvcLogicContext();
+		ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
+		ctx.setAttribute("ra-input.reservation-target-id", "MDTWNJ21A5");
+		ctx.setAttribute("ra-input.reservation-target-type", "Site");
+		ctx.setAttribute("ra-input.resource-name", "vlan-id-inner");
+		
+		st = resourceAllocator.query("NetworkCapacity", false, null, null, null, null, ctx);
+		Assert.assertTrue(st == QueryStatus.SUCCESS);
+		
+		log.info("========================  Query Using ResourceEntity==============================");
+		/*Query Using ResourceEntity bean*/
+		ResourceEntity sd = new ResourceEntity();
+		sd.resourceEntityId = "gblond2003me6";
+		sd.resourceEntityType = "VPE-Core1";
 
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 4, 500000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 3));
-    }
+		
+		ResourceRequest rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL-1";
+		rr.resourceName = "vlan-id-inner";
+		rr.requestType = "New";
+		rr.rangeMaxOverride = -1;
+		rr.rangeMinOverride = -1;
+		
+		List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
+		resourceAllocator.query(sd, null, null, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
+		
+		/*log.info("========================  release Using ResourceEntity==============================");
+		rsList = new ArrayList<ResourceResponse>();
+		AllocationStatus status = resourceAllocator.release(sd);
+		Assert.assertTrue(status == AllocationStatus.Success);
+		
+		
+		log.info("========================  Query Using ResourceEntity==============================");
+		rsList = new ArrayList<ResourceResponse>();
+		resourceAllocator.query(sd, null, null, rsList);
+		
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});*/
+		
+	}
+	
+	
+	
+	@Test
+	public void test006() throws Exception {
+		String t = "006";
+		log.info("============== reserve " + t + " ================================");
+		log.info("=== Test successful response - new start - all resources available");
+		
+		ResourceEntity sd = new ResourceEntity();
+		sd.resourceEntityId = "gblond2003me6";
+		sd.resourceEntityType = "VPE-Cust";
+		
+		ResourceTarget rt = new ResourceTarget();
+		rt.resourceTargetId = "MDTWNJ21A5";
+		rt.resourceTargetType = "Site";
 
-    @Test
-    public void test005() throws Exception {
-        String t = "005";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test successful response - change - check that hard limits are applied, not soft for change");
 
-        String service1 = "reserve" + t + "/service1";
+		ResourceRequest rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL-1";
+		rr.resourceName = "cust-vlan-id";
+	
+		
+		List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
+		resourceAllocator.reserve(sd, rt, rr, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
+		
+		log.info("========================  Query + t ==============================");
+		rsList = new ArrayList<org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse>();
+		resourceAllocator.query(sd, null, rr, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
 
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
+	}
+	
+	@Test
+	public void test007() throws Exception {
+		String t = "007";
+		log.info("============== reserve " + t + " ================================");
+		log.info("=== Test successful response - new start - all resources available");
+		
+		dataSetup.cleanup();
+		
+		TestTable resource = new TestTable(jdbcTemplate, "RESOURCE", "resource_id", RESOURCE_COLUMNS);
+		TestTable allocationItem = new TestTable(jdbcTemplate, "ALLOCATION_ITEM", "allocation_item_id",
+				ALLOCATION_ITEM_COLUMNS);
+		
+		
+		ResourceEntity sd = new ResourceEntity();
+		sd.resourceEntityId = "gblond2003me6";
+		sd.resourceEntityType = "VPE";
+		sd.resourceEntityVersion = "1";
+		
+		ResourceTarget rt = new ResourceTarget();
+		rt.resourceTargetId = "MDTWNJ21A5";
+		rt.resourceTargetType = "Site";
 
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
 
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "1200000");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "kbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
+		ResourceRequest rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL";
+		//rr.resourceName = "vlan-id-outer";
+		rr.endPointPosition="VPE-Cust";
+		rr.rangeMaxOverride = -1;
+		rr.rangeMinOverride = -1;
+	
+		
+		List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
+		resourceAllocator.reserve(sd, rt, rr, rsList);
+		
+		//VPE-Core1
+		sd = new ResourceEntity();
+		sd.resourceEntityId = "gblond2003me6";
+		sd.resourceEntityType = "VPE";
+		sd.resourceEntityVersion = "1";
+		
+		rt = new ResourceTarget();
+		rt.resourceTargetId = "MDTWNJ21A5";
+		rt.resourceTargetType = "Site";
 
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
 
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
+		rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL";
+		//rr.resourceName = "vlan-id-filter";
+		rr.endPointPosition="VPE-Core1";
+		rr.rangeMaxOverride = -1;
+		rr.rangeMinOverride = -1;
+	
+		
+		rsList = new ArrayList<ResourceResponse>();
+		resourceAllocator.reserve(sd, rt, rr, rsList);
+		
+		
+		//VPE-Core2
+		sd = new ResourceEntity();
+		sd.resourceEntityId = "gblond2003me6";
+		sd.resourceEntityType = "VPE";
+		sd.resourceEntityVersion = "1";
+		
+		rt = new ResourceTarget();
+		rt.resourceTargetId = "MDTWNJ21A5";
+		rt.resourceTargetType = "Site";
 
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 1200000));
-    }
 
-    @Test
-    public void test006() throws Exception {
-        String t = "006";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test capacity not found - new start");
+		rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL";
+		//rr.resourceName = "vlan-id-filter";
+		rr.endPointPosition="VPE-Core2";
+		rr.rangeMaxOverride = -1;
+		rr.rangeMinOverride = -1;
+	
+		
+		rsList = new ArrayList<ResourceResponse>();
+		resourceAllocator.reserve(sd, rt, rr, rsList);
+		
+		
+		//VPE-Core3
+		sd = new ResourceEntity();
+		sd.resourceEntityId = "gblond2003me6";
+		sd.resourceEntityType = "VPE";
+		sd.resourceEntityVersion = "1";
+		
+		rt = new ResourceTarget();
+		rt.resourceTargetId = "MDTWNJ21A5";
+		rt.resourceTargetType = "Site";
 
-        String service1 = "reserve" + t + "/service1";
 
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Gbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test007() throws Exception {
-        String t = "007";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test capacity not found - new start supp");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Pending", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 2, 200000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "2000");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 3));
-    }
-
-    @Test
-    public void test008() throws Exception {
-        String t = "008";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test capacity not found - change");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "2000");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 3));
-    }
-
-    @Test
-    public void test009() throws Exception {
-        String t = "009";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test capacity not found - change supp");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupService(service1, "Active", 2, 200000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        dataSetup.setupService(service1, "Pending", 3, 400000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 400000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "2000");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 200000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 400000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 4));
-    }
-
-    @Test
-    public void test010() throws Exception {
-        String t = "010";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test border condition - connection limit - new start - adding connection " +
-                "when we are on the limit should fail");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        for (int i = 1; i <= 40; i++)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Active", 2, 1000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        for (int i = 1; i <= 40; i += 4)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Pending", 3, 1000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "1");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
-
-    @Test
-    public void test011() throws Exception {
-        String t = "011";
-        log.info("============== reserve " + t + " ================================");
-        log.info(
-                "=== Test border condition - connection limit - new start supp should succeed as no new connection being added");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        for (int i = 1; i <= 39; i++)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Active", 2, 1000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        for (int i = 1; i <= 39; i += 4)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Pending", 3, 1000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        dataSetup.setupService(service1, "Pending", 2, 1000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 2, 1000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "5");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 5000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 2));
-    }
-
-    @Test
-    public void test012() throws Exception {
-        String t = "012";
-        log.info("============== reserve " + t + " ================================");
-        log.info(
-                "=== Test border condition - connection limit - change should succeed as no new connection being added");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        for (int i = 1; i <= 39; i++)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Active", 2, 1000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        for (int i = 1; i <= 39; i += 4)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Pending", 3, 1000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        dataSetup.setupService(service1, "Active", 2, 1000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 1000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "5");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 1000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 5000));
-    }
-
-    @Test
-    public void test013() throws Exception {
-        String t = "013";
-        log.info("============== reserve " + t + " ================================");
-        log.info(
-                "=== Test border condition - connection limit - change supp should succeed as no new connection being added");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        for (int i = 1; i <= 39; i++)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Active", 2, 1000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        for (int i = 1; i <= 39; i += 4)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Pending", 3, 1000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        dataSetup.setupService(service1, "Active", 2, 1000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-        dataSetup.setupService(service1, "Pending", 3, 5000, "mtanjrsv126", "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 1000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 3, 5000));
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "Change");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "10");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Active", 2, 1000));
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 4, 10000));
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, 3));
-    }
-
-    @Test
-    public void test014() throws Exception {
-        String t = "014";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test input validations - invalid request-type in input");
-
-        String service1 = "reserve" + t + "/service1";
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "xxxxx");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "10");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        try {
-            resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-        } catch (SvcLogicException e) {
-            Assert.assertTrue(e.getMessage().equals(
-                    "Invalid tmp.resource-allocator.request-type: xxxxx. Supported values are New, Change."));
-            return;
-        }
-        Assert.fail("SvcLogicException expected");
-    }
-
-    @Test
-    public void test015() throws Exception {
-        String t = "015";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test server bw limit depends on number of servers - limit is 960Mbps for 1 server, 1920 for 2");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupPserver("server1", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server2", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server3", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server4", "MTSNJA4LCP1");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "1200");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 1, 1200000));
-    }
-
-    @Test
-    public void test016() throws Exception {
-        String t = "016";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test resource threshold output");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupPserver("server1", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server2", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server3", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server4", "MTSNJA4LCP1");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "1605");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-        for (String key : ctx.getAttributeKeySet())
-            if (key.startsWith("tmp.resource-allocator-output"))
-                log.info("  " + key + ": " + ctx.getAttribute(key));
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 1, 1605000));
-    }
-
-    @Test
-    public void test017() throws Exception {
-        String t = "017";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test if evc_count lookup in MAX_SERVER_SPEED depends on the number of primary servers.");
-        log.info("=== For 10 existing EVC, it should take the first row, not the second (see data.sql).");
-        log.info("=== Applied limit should be 1920Mbps, not 1680Mbps.");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupPserver("server1", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server2", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server3", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server4", "MTSNJA4LCP1");
-
-        for (int i = 1; i <= 10; i++)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Active", 2, 100000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "800"); // 10*100Mbps existing + 800 = 1800
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb("mtanjrsv126", "MTSNJA4LCP1", service1, "Pending", 1, 800000));
-    }
-
-    @Test
-    public void test018() throws Exception {
-        String t = "018";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test if evc_count lookup in MAX_SERVER_SPEED depends on the number of primary servers.");
-        log.info("=== For 11 existing EVC, it should take the second row (see data.sql).");
-        log.info("=== Applied limit should be 1680Mbps. We have 11*100 + 700, so this should fail.");
-
-        String service1 = "reserve" + t + "/service1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-        dataSetup.setupVplspePort("MTSNJA4LCP1", "mtsnj303vr1", "xe-0/0/2", "PROV", null);
-        dataSetup.setupPserver("server1", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server2", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server3", "MTSNJA4LCP1");
-        dataSetup.setupPserver("server4", "MTSNJA4LCP1");
-
-        for (int i = 1; i <= 11; i++)
-            dataSetup.setupService("reserve" + t + "/existing-service" + i, "Active", 2, 100000, "mtanjrsv126",
-                    "mtsnj303vr1", "MTSNJA4LCP1/Server1");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "700"); // 11*100Mbps existing + 700 = 1800
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        log.info("Result: " + st);
-        log.info("  tmp.resource-allocator-output.max-available-speed: " +
-                ctx.getAttribute("tmp.resource-allocator-output.max-available-speed"));
-        log.info("  tmp.resource-allocator-output.speed-unit: " +
-                ctx.getAttribute("tmp.resource-allocator-output.speed-unit"));
+		rr= new ResourceRequest();
+		rr.serviceModel = "MY-SERV-MODEL";
+		//rr.resourceName = "vlan-id-filter";
+		rr.endPointPosition="VPE-Core3";
+		rr.rangeMaxOverride = -1;
+		rr.rangeMinOverride = -1;
+	
+		
+		rsList = new ArrayList<ResourceResponse>();
+		resourceAllocator.reserve(sd, rt, rr, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
+		
+		resource.print();
+		allocationItem.print();
+		
+		log.info("========================  Query + t ==============================");
+		rsList = new ArrayList<org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse>();
+		resourceAllocator.query(sd, null, rr, rsList);
+		
+		rsList.forEach(r -> {
+			StrUtil.info(log, r);
+		});
+		
+		
+		
+		SvcLogicContext ctx = new SvcLogicContext();
+		ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
+		ctx.setAttribute("ra-input.reservation-entity-type", "VPE");
 
-        log.info("Result: " + st);
+		
+		QueryStatus st = resourceAllocator.release("NetworkCapacity", "gblond2003me6", ctx);
+		Assert.assertTrue(st == QueryStatus.SUCCESS);
 
-        Assert.assertTrue(st == QueryStatus.NOT_FOUND);
-        Assert.assertTrue(dataSetup.serviceNotInDb(service1, null, null));
-    }
+	}
 }
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve2.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve2.java
deleted file mode 100644
index 7ae1697..0000000
--- a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve2.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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 jtest.org.onap.ccsdk.sli.adaptors.ra;
-
-import org.junit.Assert;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.MethodSorters;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
-import org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath:test-context.xml" })
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestReserve2 {
-
-    private static final Logger log = LoggerFactory.getLogger(TestReserve2.class);
-
-    @Autowired(required = true)
-    private ResourceAllocator resourceAllocator;
-
-    @Autowired(required = true)
-    private DataSetup dataSetup;
-
-    @Test
-    public void test001() throws Exception {
-        String t = "001";
-        log.info("============== reserve " + t + " ================================");
-        log.info("=== Test successful response - new start - all resources available");
-
-        String service1 = "ICOREPVC" + t + "-1";
-
-        dataSetup.cleanup();
-        dataSetup.setupVpePort("MTSNJA4LCP1", "mtanjrsv126", "ae0", "PROV", "juniper-vpe-image");
-
-        SvcLogicContext ctx = new SvcLogicContext();
-        ctx.setAttribute("tmp.resource-allocator.request-type", "New");
-        ctx.setAttribute("tmp.resource-allocator.service-model", "L3AVPN-EVC");
-        ctx.setAttribute("tmp.resource-allocator.service-instance-id", service1);
-        ctx.setAttribute("tmp.resource-allocator.speed", "300");
-        ctx.setAttribute("tmp.resource-allocator.speed-unit", "Mbps");
-        ctx.setAttribute("tmp.resource-allocator.aic-site-id", "MTSNJA4LCP1");
-        ctx.setAttribute("tmp.resource-allocator.vpn-id", "123");
-        ctx.setAttribute("tmp.resource-allocator.vrf-required", "false");
-
-        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
-
-        Assert.assertTrue(st == QueryStatus.SUCCESS);
-        Assert.assertTrue(dataSetup.serviceCorrectInDb(service1, "VPE-Cust", "Pending", 1, 300000));
-    }
-}
diff --git a/resource-assignment/provider/src/test/java/jtest/util/org/openecomp/sdnc/ra/TestDb.java b/resource-assignment/provider/src/test/java/jtest/util/org/onap/ccsdk/sli/adaptors/ra/TestDb.java
similarity index 100%
rename from resource-assignment/provider/src/test/java/jtest/util/org/openecomp/sdnc/ra/TestDb.java
rename to resource-assignment/provider/src/test/java/jtest/util/org/onap/ccsdk/sli/adaptors/ra/TestDb.java
diff --git a/resource-assignment/provider/src/test/java/jtest/util/org/onap/ccsdk/sli/adaptors/ra/TestTable.java b/resource-assignment/provider/src/test/java/jtest/util/org/onap/ccsdk/sli/adaptors/ra/TestTable.java
new file mode 100644
index 0000000..e2541f3
--- /dev/null
+++ b/resource-assignment/provider/src/test/java/jtest/util/org/onap/ccsdk/sli/adaptors/ra/TestTable.java
@@ -0,0 +1,135 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ *                         reserved.
+ * ================================================================================
+ * 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 jtest.util.org.onap.ccsdk.sli.adaptors.ra;
+
+import java.sql.ResultSetMetaData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.support.rowset.SqlRowSet;
+
+public class TestTable {
+
+	private String tableName;
+	private String[] columnList;
+	private String idName;
+
+	private String insertSql;
+
+	private JdbcTemplate jdbcTemplate;
+	
+	private static final Logger log = LoggerFactory.getLogger(TestTable.class);
+
+	public TestTable(JdbcTemplate jdbcTemplate, String tableName, String idName, String... columnList) {
+		this.jdbcTemplate = jdbcTemplate;
+		this.tableName = tableName;
+		this.idName = idName;
+		this.columnList = columnList;
+		createInsertSql();
+	}
+	
+	public TestTable(JdbcTemplate jdbcTemplate, String tableName) {
+		this.jdbcTemplate = jdbcTemplate;
+		this.tableName = tableName;
+	}
+
+	private void createInsertSql() {
+		StringBuilder ss = new StringBuilder();
+		ss.append("INSERT INTO ").append(tableName).append(" (");
+		for (String s : columnList)
+			ss.append(s).append(", ");
+		ss.setLength(ss.length() - 2);
+		ss.append(") VALUES (");
+		for (int i = 0; i < columnList.length; i++)
+			ss.append("?, ");
+		ss.setLength(ss.length() - 2);
+		ss.append(")");
+		insertSql = ss.toString();
+	}
+
+	public void add(Object... values) {
+		jdbcTemplate.update(insertSql, values);
+	}
+	
+	public void update(String updateSql, Object... values) {
+		jdbcTemplate.update(updateSql, values);
+	}
+
+	public long getLastId() {
+		return jdbcTemplate.queryForObject("SELECT max(" + idName + ") FROM " + tableName, Long.class);
+	}
+
+	public Long getId(String where) {
+		String selectSql = "SELECT " + idName + " FROM " + tableName + " WHERE " + where;
+		SqlRowSet rs = jdbcTemplate.queryForRowSet(selectSql);
+		if (rs.first())
+			return rs.getLong(idName);
+		return null;
+	}
+	
+	public Object getColumn(String columnName, String where) {
+		String selectSql = "SELECT " + columnName + " FROM " + tableName + " WHERE " + where;
+		SqlRowSet rs = jdbcTemplate.queryForRowSet(selectSql);
+		if (rs.first())
+			return rs.getObject(columnName);
+		return null;
+	}
+
+	public boolean exists(String where) {
+		String selectSql = "SELECT * FROM " + tableName + " WHERE " + where;
+		SqlRowSet rs = jdbcTemplate.queryForRowSet(selectSql);
+		return rs.first();
+	}
+
+	public void delete(String where) {
+		jdbcTemplate.update("DELETE FROM " + tableName + " WHERE " + where);
+	}
+	
+	public void print() {
+		
+		jdbcTemplate.query("SELECT * FROM " + tableName, 
+								(rs, rowNum) -> {
+									String row = "Table Data for " + tableName +"\n";
+									String col = "";
+									
+									final ResultSetMetaData meta = rs.getMetaData();
+									final int columnCount = meta.getColumnCount();
+									
+									do {
+										col = "";
+								
+										for (int column = 1; column <= columnCount; ++column) {
+											Object obj = rs.getObject(column);
+											if(!rs.wasNull()) {
+												col = col + obj + ",";
+											} 
+										}
+										col = col.trim().length() == 0 ? "" : (col.trim().substring(0, col.trim().length() - 1));
+										row = row + col + "\n";
+									} while (rs.next());
+									
+									return row;
+								}).forEach(row -> {
+														log.info(row);
+													});
+	}
+}
\ No newline at end of file
diff --git a/resource-assignment/provider/src/test/java/jtest/util/org/openecomp/sdnc/ra/TestTable.java b/resource-assignment/provider/src/test/java/jtest/util/org/openecomp/sdnc/ra/TestTable.java
deleted file mode 100644
index cda7302..0000000
--- a/resource-assignment/provider/src/test/java/jtest/util/org/openecomp/sdnc/ra/TestTable.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                         reserved.
- * ================================================================================
- * 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 jtest.util.org.onap.ccsdk.sli.adaptors.ra;
-
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.support.rowset.SqlRowSet;
-
-public class TestTable {
-
-    private String tableName;
-    private String[] columnList;
-    private String idName;
-
-    private String insertSql;
-
-    private JdbcTemplate jdbcTemplate;
-
-    public TestTable(JdbcTemplate jdbcTemplate, String tableName, String idName, String... columnList) {
-        this.jdbcTemplate = jdbcTemplate;
-        this.tableName = tableName;
-        this.idName = idName;
-        this.columnList = columnList;
-        createInsertSql();
-    }
-
-    private void createInsertSql() {
-        StringBuilder ss = new StringBuilder();
-        ss.append("INSERT INTO ").append(tableName).append(" (");
-        for (String s : columnList)
-            ss.append(s).append(", ");
-        ss.setLength(ss.length() - 2);
-        ss.append(") VALUES (");
-        for (int i = 0; i < columnList.length; i++)
-            ss.append("?, ");
-        ss.setLength(ss.length() - 2);
-        ss.append(")");
-        insertSql = ss.toString();
-    }
-
-    public void add(Object... values) {
-        jdbcTemplate.update(insertSql, values);
-    }
-
-    public long getLastId() {
-        return jdbcTemplate.queryForObject("SELECT max(" + idName + ") FROM " + tableName, Long.class);
-    }
-
-    public Long getId(String where) {
-        String selectSql = "SELECT " + idName + " FROM " + tableName + " WHERE " + where;
-        SqlRowSet rs = jdbcTemplate.queryForRowSet(selectSql);
-        if (rs.first())
-            return rs.getLong(idName);
-        return null;
-    }
-
-    public boolean exists(String where) {
-        String selectSql = "SELECT * FROM " + tableName + " WHERE " + where;
-        SqlRowSet rs = jdbcTemplate.queryForRowSet(selectSql);
-        return rs.first();
-    }
-
-    public void delete(String where) {
-        jdbcTemplate.update("DELETE FROM " + tableName + " WHERE " + where);
-    }
-}
diff --git a/resource-assignment/provider/src/test/resources/homing-req.json b/resource-assignment/provider/src/test/resources/homing-req.json
deleted file mode 100644
index 1f061ec..0000000
--- a/resource-assignment/provider/src/test/resources/homing-req.json
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- * reserved.
- * ================================================================================
- * 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=========================================================
- */
-
-{
-    "input":{
-        "sdnc-homing-header":{
-            "svc-request-id":"omx-123",
-            "svc-action":"homing"
-        },
-        "request-information":{
-            "request-id":"mso-1234",
-            "request-action":"GetAicNodesRequest",
-            "source":"OMX",
-            "list-length":1
-        },
-        "homing-request-information":{
-            "service-type":"SDN-ETHERNET-INTERNET",
-            "global-customer-id":"custid-123",
-            "customer-location":{
-                "lata":332
-            }
-        },
-        "homing-other-information":{
-            "bandwidth-value":150,
-            "bandwidth-units":"Mbps"
-        }
-    }
-}
diff --git a/resource-assignment/provider/src/test/resources/param.txt b/resource-assignment/provider/src/test/resources/param.txt
deleted file mode 100755
index a20ac90..0000000
--- a/resource-assignment/provider/src/test/resources/param.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-isAvailable:
-	Input in ctx:
-		tmp.resource-allocator.aic-site-id
-		tmp.resource-allocator.speed
-		tmp.resource-allocator.speed-unit
-	Output in ctx:
-		tmp.resource-allocator.max-available-speed
-		tmp.resource-allocator.speed-unit
-	Return:
-		SUCCESS – capacity available
-		NOT_FOUND – capacity not available
-			Error message in: error-message, error-code
-		FAILURE – the check has failed (data error, code defect, etc)
-			Error message in: error-message, error-code
-
-Reserve:
-	Input in ctx:
-		tmp.resource-allocator.aic-site-id
-		tmp.resource-allocator.speed
-		tmp.resource-allocator.speed-unit
-		tmp.resource-allocator.service-instance-id
-		tmp.resource-allocator.request-type { New, Change }
-	Output in ctx:
-		tmp.resource-allocator-output.max-available-speed
-		tmp.resource-allocator-output.speed-unit
-	Return:
-		SUCCESS – capacity available
-		NOT_FOUND – capacity not available
-			Error message in: error-message, error-code
-		FAILURE – the check has failed (data error, code defect, etc)
-			Error message in: error-message, error-code
-
-Release:
-	Input in ctx:
-		tmp.resource-allocator.service-instance-id
-		tmp.resource-allocator.request-type { Activate, Cancel, Disconnect }
-	Return:
-		SUCCESS – capacity available
-		FAILURE – the check has failed (data error, code defect, etc)
-			Error message in: error-message, error-code
-
-
-Plugin name: org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator
-Resource: NetworkCapacity
diff --git a/resource-assignment/provider/src/test/resources/sql/data.sql b/resource-assignment/provider/src/test/resources/sql/data.sql
index 5fd4c75..681a9c4 100644
--- a/resource-assignment/provider/src/test/resources/sql/data.sql
+++ b/resource-assignment/provider/src/test/resources/sql/data.sql
@@ -118,3 +118,69 @@
 VALUES ('homing.pserver.sparing.ratio', '1:1', 'homing',
   'Ratio of primary to backup servers within any of the AIC sites. Used in RA to calculate the max allowed bw in an AIC site.');
 
+INSERT INTO RESOURCE_RULE (
+     resource_name, service_model, end_point_position, service_expression, equipment_level, equipment_expression,
+    allocation_expression, soft_limit_expression, hard_limit_expression)
+VALUES (
+     'PortBandwidth', 'ADIG', 'VPE', 'true', 'Port', 'true',
+    'service-speed-mbps', 'service-speed-mbps', 'service-speed-mbps');
+    
+INSERT INTO RESOURCE_RULE (
+     resource_name, service_model, end_point_position, service_expression, equipment_level, equipment_expression,
+    allocation_expression, soft_limit_expression, hard_limit_expression)
+VALUES (
+     'Bandwidth', 'ADIG', 'VPE', 'true', 'VNF', 'vnf-type = "VPE"',
+    'service-speed-mbps', '0.5 * max-vpe-bandwidth-mbps', '0.9 * max-vpe-bandwidth-mbps');
+	
+	
+INSERT INTO RESOURCE_RULE (
+     resource_name, service_model, end_point_position, service_expression, equipment_level, equipment_expression,
+    allocation_expression, soft_limit_expression, hard_limit_expression)
+VALUES (
+     'Bandwidth', 'ADIG', 'VPE', 'true', 'AffinityLink', 'true',
+    'service-speed-mbps', '9999999999', '9999999999');
+	
+INSERT INTO RESOURCE_RULE (
+     resource_name, service_model, end_point_position, service_expression, equipment_level, equipment_expression,
+    allocation_expression, soft_limit_expression, hard_limit_expression)
+VALUES (
+     'Connection', 'ADIG', 'VPE', 'true', 'VNF', 'true',
+    '1', '200', '200');	
+    
+INSERT INTO RANGE_RULE (
+     range_name, service_model, end_point_position, equipment_level, min_value,
+    max_value)
+VALUES (
+     'cust-vlan-id', 'ADIG', 'VPE', 'VNF', '2', '1000');
+	
+INSERT INTO RANGE_RULE (
+     range_name, service_model, end_point_position, equipment_level, min_value,
+    max_value)
+VALUES (
+     'vlan-id-inner', 'ADIG', 'VPE', 'VNF', '1002', '2000');	    
+
+     
+INSERT INTO RANGE_RULE (
+     range_name, service_model, end_point_position, equipment_level, min_value,
+    max_value)
+VALUES (
+     'vlan-id-outer', 'MY-SERV-MODEL', 'VPE-Cust', 'Site', '2', '1000');
+	
+INSERT INTO RANGE_RULE (
+     range_name, service_model, end_point_position, equipment_level, min_value,
+    max_value)
+VALUES (
+     'vlan-id-filter', 'MY-SERV-MODEL', 'VPE-Core1', 'Site', '1002', '2000');	 
+     
+INSERT INTO RANGE_RULE (
+     range_name, service_model, end_point_position, equipment_level, min_value,
+    max_value)
+VALUES (
+     'vlan-id-filter', 'MY-SERV-MODEL', 'VPE-Core2', 'Site', '1002', '2000');
+     
+INSERT INTO RANGE_RULE (
+     range_name, service_model, end_point_position, equipment_level, min_value,
+    max_value)
+VALUES (
+     'vlan-id-filter', 'MY-SERV-MODEL', 'VPE-Core3', 'Site', '400', '600');     
+     
\ No newline at end of file
diff --git a/resource-assignment/provider/src/test/resources/svc-topology-req.json b/resource-assignment/provider/src/test/resources/svc-topology-req.json
deleted file mode 100644
index ab8afb6..0000000
--- a/resource-assignment/provider/src/test/resources/svc-topology-req.json
+++ /dev/null
@@ -1,195 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- * 						reserved.
- * ================================================================================
- * 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=========================================================
- */
-
-{
-	"input":{
-		"sdnc-request-header":{
-			"svc-request-id":"omx-123",
-			"svc-action":"assign"
-		},
-		"sdnc-topology-additional-data":{
-			"svc-vnf-type":"vce"
-		},
-		"request-information":{
-			"request-id":"mso-1234",
-			"request-action":"Layer3ServiceActivateRequest",
-			"source":"OMX"
-		},
-		"service-information":{
-			"service-type":"SDN-ETHERNET-INTERNET",
-			"service-instance-id":"service-instance-123",
-			"subscriber-name":"ssb-subscriber"
-		},
-		"l2-homing-information":{
-			"evc-name":"EVC-123",
-			"topology":"PointToPoint",
-			"preferred-aic-clli":"ATLNGATL001"
-		}
-		"internet-evc-access-information":{
-			"internet-evc-speed-value":"150",
-			"internet-evc-speed-units":"Mbps",
-			"ip-version":"v6"
-		}
-		"vr-lan":{
-			"routing-protocol":"none",
-			{
-				"v6-vr-lan-prefix":"string",
-				"v6-public-lan-prefixes":{
-					"t-provided-v6-lan-public-prefixes":[
-						{
-							"v6-lan-public-prefix-length":"integer",
-							"v6-lan-public-prefix":"string",
-							"request-index":"integer"
-						}
-					]
-				},
-				"v6-vr-lan-prefix-length":"integer",
-				"v4-vr-lan-prefix-length":"integer",
-				"firewall-lite":{
-					"v6-firewall-packet-filters":[
-						{
-							"v6-firewall-prefix-length":"integer",
-							"udp-port-list":[
-								{
-									"port-number":"integer"
-								}
-							],
-							"tcp-port-list":[
-								{
-									"port-number":"integer"
-								}
-							],
-							"v6-firewall-prefix":"string"
-						}
-					],
-					"v4-firewall-packet-filters":[
-						{
-							"v4-firewall-prefix-length":"integer",
-							"udp-port-list":[
-								{
-									"port-number":"integer"
-								}
-							],
-							"tcp-port-list":[
-								{
-									"port-number":"integer"
-								}
-							],
-							"v4-firewall-prefix":"string"
-						}
-					]
-				},
-				"v6-vce-wan-address":"string",
-				"v4-public-lan-prefixes":{
-					"t-provided-v4-lan-public-prefixes":[
-						{
-							"v4-lan-public-prefix":"string",
-							"v4-lan-public-prefix-length":"integer",
-							"request-index":"integer"
-						}
-					]
-				},
-				"pat":{
-					"v4-pat-default-pool-prefix-length":"integer",
-					"v4-pat-pools":[
-						{
-							"v4-pat-pool-next-hop-address":"string",
-							"v4-pat-pool-prefix-length":"integer",
-							"v4-pat-pool-prefix":"string"
-						}
-					],
-					"v4-pat-default-pool-prefix":"string"
-				},
-				"v4-vce-loopback-address":"string",
-				"v4-vr-lan-prefix":"string",
-				"dhcp":{
-					"v4-dhcp-pools":[
-						{
-							"v4-dhcp-relay-next-hop-address":"string",
-							"excluded-v4-addresses":[
-								{
-									"excluded-v4-address":"string"
-								}
-							],
-							"v4-dhcp-pool-prefix":"string",
-							"v4-dhcp-relay-gateway-address":"string",
-							"v4-dhcp-pool-prefix-length":"integer"
-						}
-					],
-					"excluded-v4-dhcp-addresses-from-default-pool":[
-						{
-							"excluded-v4-address":"string"
-						}
-					],
-					"v6-dhcp-pools":[
-						{
-							"v6-dhcp-relay-gateway-address":"string",
-							"excluded-v6-addresses":[
-								{
-									"excluded-v6-address":"string"
-								}
-							],
-							"v6-dhcp-pool-prefix-length":"integer",
-							"v6-dhcp-relay-next-hop-address":"string",
-							"v6-dhcp-pool-prefix":"string"
-						}
-					],
-					"v6-dhcp-default-pool-prefix":"string",
-					"v6-dhcp-default-pool-prefix-length":"integer",
-					"v4-dhcp-default-pool-prefix":"string",
-					"excluded-v6-dhcp-addresses-from-default-pool":[
-						{
-							"excluded-v6-address":"string"
-						}
-					],
-					"v4-dhcp-default-pool-prefix-length":"integer"
-				},
-				"nat":{
-					"v4-nat-mapping-entries":[
-						{
-							"v4-nat-external":"string",
-							"v4-nat-next-hop-address":"string",
-							"v4-nat-internal":"string"
-						}
-					]
-				},
-				"static-routes":{
-					"v6-static-routes":[
-						{
-							"v6-static-route-prefix-length":"integer",
-							"v6-next-hop-address":"string",
-							"v6-static-route-prefix":"string"
-						}
-					],
-					"v4-static-routes":[
-						{
-							"v4-static-route-prefix-length":"integer",
-							"v4-static-route-prefix":"string",
-							"v4-next-hop-address":"string"
-						}
-					]
-				}
-			}
-			
-		}
-		
-	}
-}
diff --git a/resource-assignment/provider/src/test/resources/test-context.xml b/resource-assignment/provider/src/test/resources/test-context.xml
index c3b09a1..32b54e9 100644
--- a/resource-assignment/provider/src/test/resources/test-context.xml
+++ b/resource-assignment/provider/src/test/resources/test-context.xml
@@ -4,7 +4,7 @@
   openECOMP : SDN-C
   ================================================================================
   Copyright (C) 2017 AT&T Intellectual Property. All rights
-                          reserved.
+  						reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -20,22 +20,23 @@
   ============LICENSE_END=========================================================
   -->
 
-<beans xmlns="http://www.springframework.org/schema/beans"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:jdbc="http://www.springframework.org/schema/jdbc"
     xmlns:context="http://www.springframework.org/schema/context"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
-    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
-    http://www.springframework.org/schema/jdbc
-    http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
-    http://www.springframework.org/schema/context
-    http://www.springframework.org/schema/context/spring-context-3.1.xsd
-                    ">
+	http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+	http://www.springframework.org/schema/jdbc
+ 	http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
+ 	http://www.springframework.org/schema/context
+ 	http://www.springframework.org/schema/context/spring-context-3.1.xsd
+ 					">
 
     <context:annotation-config />
 
-    <!-- JDBC setup -->
+	<!-- JDBC setup -->
 
-    <bean id="test.dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="false">
+    <bean id="test.dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
+        lazy-init="false" primary="true">
         <property name="driverClassName" value="org.h2.Driver" />
         <property name="url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;MODE=MySQL" />
     </bean>
@@ -45,10 +46,18 @@
         <jdbc:script location="sql/data.sql" />
     </jdbc:initialize-database>
 
-    <bean id="rm.jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
+    <bean id="lock.dataSource" class="org.onap.ccsdk.sli.adaptors.util.db.CachedDataSourceWrap">
         <property name="dataSource" ref="test.dataSource" />
     </bean>
 
+    <bean id="rm.jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" primary="true">
+        <property name="dataSource" ref="test.dataSource" />
+    </bean>
+
+    <bean id="lock.jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
+        <property name="dataSource" ref="lock.dataSource" />
+    </bean>
+
     <bean id="testDb" class="jtest.util.org.onap.ccsdk.sli.adaptors.ra.TestDb">
         <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
     </bean>
@@ -57,17 +66,10 @@
         <property name="testDb" ref="testDb" />
     </bean>
 
-    <!-- Utils Configuration -->
-
-    <bean id="speedUtil" class="org.onap.ccsdk.sli.adaptors.util.speed.SpeedUtil">
-        <property name="unitFactor" value="1000" />
-    </bean>
-
-    <!-- Resource Lock Configuration -->
+	<!-- Resource Lock Configuration -->
 
     <bean id="resourceLockDao" class="org.onap.ccsdk.sli.adaptors.lock.dao.ResourceLockDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-        <property name="testing" value="true" />
+        <property name="jdbcTemplate" ref="lock.jdbcTemplate" />
     </bean>
 
     <bean id="lockHelper" class="org.onap.ccsdk.sli.adaptors.lock.comp.LockHelperImpl">
@@ -76,7 +78,7 @@
         <property name="lockWait" value="5" /> <!-- Seconds -->
     </bean>
 
-    <!-- RM Configuration -->
+	<!-- RM Configuration -->
 
     <bean id="resourceJdbcDao" class="org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.ResourceJdbcDaoImpl">
         <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
@@ -99,35 +101,10 @@
     <bean id="resourceManager" class="org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManagerImpl">
         <property name="lockHelper" ref="lockHelper" />
         <property name="resourceDao" ref="resourceDao" />
-        <property name="applicationId" value="SDNC" />
         <property name="lockTimeout" value="600" /> <!-- Seconds -->
     </bean>
 
-    <!-- Equipment DAO Configuration -->
-
-    <bean id="serverDao" class="org.onap.ccsdk.sli.adaptors.ra.equip.dao.ServerDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-    </bean>
-
-    <bean id="vpePortDao" class="org.onap.ccsdk.sli.adaptors.ra.equip.dao.VpePortDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-    </bean>
-
-    <bean id="vplspePortDao" class="org.onap.ccsdk.sli.adaptors.ra.equip.dao.VplspePortDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-    </bean>
-
-    <!-- Rule DAO Configuration -->
-
-    <bean id="maxPortSpeedDao" class="org.onap.ccsdk.sli.adaptors.ra.rule.dao.MaxPortSpeedDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-        <property name="speedUtil" ref="speedUtil" />
-    </bean>
-
-    <bean id="maxServerSpeedDao" class="org.onap.ccsdk.sli.adaptors.ra.rule.dao.MaxServerSpeedDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-        <property name="speedUtil" ref="speedUtil" />
-    </bean>
+	<!-- Rule DAO Configuration -->
 
     <bean id="resourceRuleDao" class="org.onap.ccsdk.sli.adaptors.ra.rule.dao.ResourceRuleDaoImpl">
         <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
@@ -137,161 +114,37 @@
         <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
     </bean>
 
-    <bean id="vpeLockDao" class="org.onap.ccsdk.sli.adaptors.ra.rule.dao.VpeLockDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-    </bean>
-
-    <bean id="parameterDao" class="org.onap.ccsdk.sli.adaptors.ra.rule.dao.ParameterDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-    </bean>
-
-    <!-- Service DAO Configuration -->
-
-    <bean id="serviceResourceDao" class="org.onap.ccsdk.sli.adaptors.ra.service.dao.ServiceResourceDaoImpl">
-        <property name="jdbcTemplate" ref="rm.jdbcTemplate" />
-    </bean>
-
-    <!-- ResourceAllocator Configuration -->
-
-    <bean id="allocationRequestBuilder" class="org.onap.ccsdk.sli.adaptors.ra.rule.comp.AllocationRequestBuilderImpl">
-        <property name="resourceRuleDao" ref="resourceRuleDao" />
-        <property name="rangeRuleDao" ref="rangeRuleDao" />
-    </bean>
+	<!-- ResourceAllocator Configuration -->
 
     <bean id="resourceAllocator" class="org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator">
-        <property name="speedUtil" ref="speedUtil" />
-        <property name="parameterDao" ref="parameterDao" />
-        <property name="serverDao" ref="serverDao" />
-        <property name="vpePortDao" ref="vpePortDao" />
-        <property name="vplspePortDao" ref="vplspePortDao" />
-        <property name="maxPortSpeedDao" ref="maxPortSpeedDao" />
-        <property name="maxServerSpeedDao" ref="maxServerSpeedDao" />
-        <property name="serviceResourceDao" ref="serviceResourceDao" />
-        <property name="allocationRequestBuilder" ref="allocationRequestBuilder" />
         <property name="resourceManager" ref="resourceManager" />
         <property name="endPointAllocator" ref="endPointAllocator" />
+        <property name="speedUtil" ref="speedUtil" />
     </bean>
 
-    <!-- EndPointAllocator Configuration -->
+
+    <bean id="speedUtil" class="org.onap.ccsdk.sli.adaptors.util.speed.SpeedUtil" />
+
+	<!-- EndPointAllocator Configuration -->
 
     <bean id="endPointAllocator" class="org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocatorImpl">
         <property name="resourceManager" ref="resourceManager" />
-        <property name="endPointAllocationDefinitionMap">
+        <property name="allocationRuleMap">
             <map>
-                <entry key="L3AVPN-PORT">
+                <entry key="DEFAULT">
                     <list>
-                        <bean class="org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocationDefinition">
-                            <property name="serviceModel" value="L3AVPN-PORT" />
-                            <property name="endPointPosition" value="VPE-Cust" />
-                            <property name="equipmentReader" ref="vpePortReader" />
-                            <property name="equipmentCheckList">
-                                <list>
-                                    <ref bean="provStatusCheck" />
-                                    <ref bean="excludeVpeCheck" />
-                                    <ref bean="anyVrfPresentCheck" />
-                                </list>
-                            </property>
-                            <property name="preferenceRuleList">
-                                <list>
-                                    <ref bean="affinityLinkPref" />
-                                </list>
-                            </property>
-                            <property name="allocationRuleList">
-                                <list>
-                                    <ref bean="dbAllocationRule" />
-                                    <ref bean="affinityAllocationRule" />
-                                </list>
-                            </property>
-                        </bean>
-                    </list>
-                </entry>
-                <entry key="L3AVPN-EVC">
-                    <list>
-                        <bean class="org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocationDefinition">
-                            <property name="serviceModel" value="L3AVPN-EVC" />
-                            <property name="endPointPosition" value="VPE-Cust" />
-                            <property name="equipmentReader" ref="vpePortReader" />
-                            <property name="equipmentCheckList">
-                                <list>
-                                    <ref bean="provStatusCheck" />
-                                    <ref bean="excludeVpeCheck" />
-                                    <ref bean="vpeLockCheck" />
-                                    <ref bean="anyVrfPresentCheck" />
-                                    <ref bean="oneMVrfCheck" />
-                                    <ref bean="hubWithRgCheck" />
-                                </list>
-                            </property>
-                            <property name="preferenceRuleList">
-                                <list>
-                                    <ref bean="affinityLinkPref" />
-                                </list>
-                            </property>
-                            <property name="allocationRuleList">
-                                <list>
-                                    <ref bean="dbAllocationRule" />
-                                    <ref bean="vrfAllocationRule" />
-                                    <ref bean="servingSiteAllocationRule" />
-                                    <ref bean="affinityAllocationRule" />
-                                </list>
-                            </property>
-                        </bean>
+                        <ref bean="dbAllocationRule" />
                     </list>
                 </entry>
             </map>
         </property>
     </bean>
 
-    <!-- Equipment Readers Configuration -->
-
-    <bean id="vpePortReader" class="org.onap.ccsdk.sli.adaptors.ra.reader.VpePortReader">
-        <property name="vpePortDao" ref="vpePortDao" />
-    </bean>
-
-    <!-- Equipment Checks Configuration -->
-
-    <bean id="provStatusCheck" class="org.onap.ccsdk.sli.adaptors.ra.check.ProvStatusCheck">
-    </bean>
-
-    <bean id="excludeVpeCheck" class="org.onap.ccsdk.sli.adaptors.ra.check.ExcludeVpeCheck">
-    </bean>
-
-    <bean id="vpeLockCheck" class="org.onap.ccsdk.sli.adaptors.ra.check.VpeLockCheck">
-        <property name="vpeLockDao" ref="vpeLockDao" />
-        <property name="resourceManager" ref="resourceManager" />
-    </bean>
-
-    <bean id="anyVrfPresentCheck" class="org.onap.ccsdk.sli.adaptors.ra.check.AnyVrfPresentCheck">
-        <property name="resourceManager" ref="resourceManager" />
-    </bean>
-
-    <bean id="oneMVrfCheck" class="org.onap.ccsdk.sli.adaptors.ra.check.OneMVrfCheck">
-        <property name="resourceManager" ref="resourceManager" />
-    </bean>
-
-    <bean id="hubWithRgCheck" class="org.onap.ccsdk.sli.adaptors.ra.check.HubWithRgCheck">
-        <property name="resourceManager" ref="resourceManager" />
-    </bean>
-
-    <!-- Preference Rule Configuration -->
-
-    <bean id="affinityLinkPref" class="org.onap.ccsdk.sli.adaptors.ra.pref.AffinityLinkPref">
-        <property name="resourceManager" ref="resourceManager" />
-    </bean>
-
-    <!-- Resource Allocation Rule Configuration -->
+	<!-- Resource Allocation Rule Configuration -->
 
     <bean id="dbAllocationRule" class="org.onap.ccsdk.sli.adaptors.ra.alloc.DbAllocationRule">
         <property name="resourceRuleDao" ref="resourceRuleDao" />
         <property name="rangeRuleDao" ref="rangeRuleDao" />
     </bean>
 
-    <bean id="vrfAllocationRule" class="org.onap.ccsdk.sli.adaptors.ra.alloc.VrfAllocationRule">
-    </bean>
-
-    <bean id="servingSiteAllocationRule" class="org.onap.ccsdk.sli.adaptors.ra.alloc.ServingSiteAllocationRule">
-    </bean>
-
-    <bean id="affinityAllocationRule" class="org.onap.ccsdk.sli.adaptors.ra.alloc.AffinityAllocationRule">
-    </bean>
-
 </beans>
