Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed duplicated models from RAS #32

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
<artifactId>fogbow-as</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>fogbow</groupId>
<artifactId>fogbow-ras</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cloud.fogbow.accs.api.http.response;

import cloud.fogbow.accs.core.models.orders.OrderState;
import cloud.fogbow.accs.core.models.specs.OrderSpec;
import cloud.fogbow.ras.core.models.orders.OrderState;
import cloud.fogbow.accs.constants.ApiDocumentation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/cloud/fogbow/accs/core/SpecFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import cloud.fogbow.accs.constants.Messages;
import cloud.fogbow.accs.core.datastore.accountingstorage.OrderSpecRepository;
import cloud.fogbow.accs.core.exceptions.TypeNotAllowedException;
import cloud.fogbow.accs.core.models.ResourceType;
import cloud.fogbow.accs.core.models.orders.ComputeOrder;
import cloud.fogbow.accs.core.models.orders.NetworkOrder;
import cloud.fogbow.accs.core.models.orders.Order;
import cloud.fogbow.accs.core.models.orders.VolumeOrder;
import cloud.fogbow.accs.core.models.specs.ComputeSpec;
import cloud.fogbow.accs.core.models.specs.NetworkSpec;
import cloud.fogbow.accs.core.models.specs.OrderSpec;
import cloud.fogbow.accs.core.models.specs.VolumeSpec;
import cloud.fogbow.ras.core.models.ResourceType;
import cloud.fogbow.ras.core.models.orders.ComputeOrder;
import cloud.fogbow.ras.core.models.orders.NetworkOrder;
import cloud.fogbow.ras.core.models.orders.Order;
import cloud.fogbow.ras.core.models.orders.VolumeOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand All @@ -27,7 +27,7 @@ public OrderSpec constructSpec(Order order) {
ResourceType resourceType = order.getType();
switch (resourceType) {
case COMPUTE:
spec = new ComputeSpec(((ComputeOrder) order).getvCPU(), ((ComputeOrder) order).getMemory());
spec = new ComputeSpec(((ComputeOrder) order).getvCPU(), ((ComputeOrder) order).getRam());
break;
case NETWORK:
spec = new NetworkSpec(((NetworkOrder) order).getCidr(), ((NetworkOrder) order).getAllocationMode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import cloud.fogbow.accs.core.models.AccountingUser;
import cloud.fogbow.accs.core.models.AuditableOrderIdRecorder;
import cloud.fogbow.accs.core.models.Record;
import cloud.fogbow.accs.core.models.orders.AuditableOrderStateChange;
import cloud.fogbow.accs.core.models.orders.Order;
import cloud.fogbow.accs.core.models.orders.OrderState;
import cloud.fogbow.common.models.SystemUser;
import cloud.fogbow.ras.core.datastore.orderstorage.AuditableOrderStateChange;
import cloud.fogbow.ras.core.models.orders.Order;
import cloud.fogbow.ras.core.models.orders.OrderState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public class OrderStorageConfiguration extends StorageConfiguration {
// The order datasource properties names must use this prefix.
public static final String ORDER_DATASOURCE_CONFIGURATION_PREFIX = "spring.order-datasource";
// All entities related to Order must be placed in this package.
private static final String ORDER_ENTITIES_PACKAGE = "cloud.fogbow.accs.core.models.orders";
private static final String[] ORDER_ENTITIES_PACKAGES = { "cloud.fogbow.ras.core.models.orders",
"cloud.fogbow.ras.core.datastore.orderstorage" };

@Autowired
private Environment env;
Expand All @@ -45,7 +46,7 @@ public DataSource orderDataSource() {
@Bean
public LocalContainerEntityManagerFactoryBean orderEntityManager() {
DataSource source = orderDataSource();
String[] packagesToScan = { ORDER_ENTITIES_PACKAGE };
String[] packagesToScan = ORDER_ENTITIES_PACKAGES;
return getEntityManager(source, env, packagesToScan);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import cloud.fogbow.accs.core.datastore.AccountingStorageConfiguration;
import cloud.fogbow.accs.core.models.AccountingUser;
import cloud.fogbow.accs.core.models.Record;
import cloud.fogbow.accs.core.models.orders.OrderState;
import cloud.fogbow.ras.core.models.orders.OrderState;
import org.springframework.data.jpa.repository.JpaRepository;

import org.springframework.stereotype.Repository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cloud.fogbow.accs.core.datastore.orderstorage;

import cloud.fogbow.accs.core.datastore.OrderStorageConfiguration;
import cloud.fogbow.accs.core.models.orders.AuditableOrderStateChange;
import cloud.fogbow.accs.core.models.orders.OrderState;
import cloud.fogbow.ras.core.datastore.orderstorage.AuditableOrderStateChange;
import cloud.fogbow.ras.core.models.orders.OrderState;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cloud.fogbow.accs.core.datastore.orderstorage;

import cloud.fogbow.accs.core.datastore.OrderStorageConfiguration;
import cloud.fogbow.accs.core.models.orders.Order;
import cloud.fogbow.ras.core.models.orders.Order;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import cloud.fogbow.accs.core.datastore.accountingstorage.RecordRepository;
import cloud.fogbow.accs.core.exceptions.InvalidIntervalException;
import cloud.fogbow.accs.core.models.*;
import cloud.fogbow.accs.core.models.orders.OrderState;
import cloud.fogbow.common.models.SystemUser;
import cloud.fogbow.ras.core.models.orders.OrderState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cloud/fogbow/accs/core/models/Record.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cloud.fogbow.accs.core.models;

import cloud.fogbow.accs.core.models.orders.OrderState;
import cloud.fogbow.accs.core.models.specs.OrderSpec;
import cloud.fogbow.ras.core.models.orders.OrderState;

import javax.persistence.*;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading