api: Entities will extend InternalIdentity and Identity

Entities correlated to the Identity and carry a uuid and those
correlated to InternalIdentity carry an id. Those entities that carry
both will correlated to Identity and InternalIdentity.

This refactors entities wherever possible to ensure the VO only
implements the first class entity.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2012-12-26 18:28:55 -08:00
parent b80dccee3f
commit 840da55520
128 changed files with 344 additions and 383 deletions

View File

@ -16,11 +16,12 @@
// under the License. // under the License.
package com.cloud.alert; package com.cloud.alert;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
public interface Alert { public interface Alert extends Identity, InternalIdentity {
long getId();
String getUuid();
short getType(); short getType();
String getSubject(); String getSubject();
Long getPodId(); Long getPodId();

View File

@ -51,8 +51,6 @@ public interface AsyncJob extends Identity, InternalIdentity {
AutoScaleVmGroup AutoScaleVmGroup
} }
long getId();
long getUserId(); long getUserId();
long getAccountId(); long getAccountId();

View File

@ -16,7 +16,10 @@
// under the License. // under the License.
package com.cloud.capacity; package com.cloud.capacity;
public interface Capacity { import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface Capacity extends InternalIdentity, Identity {
public static final short CAPACITY_TYPE_MEMORY = 0; public static final short CAPACITY_TYPE_MEMORY = 0;
public static final short CAPACITY_TYPE_CPU = 1; public static final short CAPACITY_TYPE_CPU = 1;
public static final short CAPACITY_TYPE_STORAGE = 2; public static final short CAPACITY_TYPE_STORAGE = 2;
@ -28,8 +31,6 @@ public interface Capacity {
public static final short CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8; public static final short CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8;
public static final short CAPACITY_TYPE_LOCAL_STORAGE = 9; public static final short CAPACITY_TYPE_LOCAL_STORAGE = 9;
public long getId();
public Long getHostOrPoolId(); public Long getHostOrPoolId();
public Long getDataCenterId(); public Long getDataCenterId();
@ -47,6 +48,4 @@ public interface Capacity {
public long getReservedCapacity(); public long getReservedCapacity();
public Float getUsedPercentage(); public Float getUsedPercentage();
} }

View File

@ -16,7 +16,9 @@
// under the License. // under the License.
package com.cloud.cluster; package com.cloud.cluster;
public interface ManagementServerHost { import org.apache.cloudstack.api.InternalIdentity;
public interface ManagementServerHost extends InternalIdentity {
public static enum State { public static enum State {
Up, Starting, Down Up, Starting, Down

View File

@ -20,8 +20,6 @@ import org.apache.cloudstack.api.InternalIdentity;
public interface ResourceCount extends Resource, InternalIdentity { public interface ResourceCount extends Resource, InternalIdentity {
public long getId();
public long getCount(); public long getCount();
public void setCount(long count); public void setCount(long count);

View File

@ -20,8 +20,6 @@ import org.apache.cloudstack.api.InternalIdentity;
public interface ResourceLimit extends Resource, InternalIdentity { public interface ResourceLimit extends Resource, InternalIdentity {
public long getId();
public Long getMax(); public Long getMax();
public void setMax(Long max); public void setMax(Long max);

View File

@ -19,20 +19,18 @@ package com.cloud.dc;
import java.util.Map; import java.util.Map;
import com.cloud.org.Grouping; import com.cloud.org.Grouping;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
/** /**
* *
*/ */
public interface DataCenter extends Grouping { public interface DataCenter extends Grouping, Identity, InternalIdentity {
public enum NetworkType { public enum NetworkType {
Basic, Basic,
Advanced, Advanced,
} }
long getId();
String getUuid();
String getDns1(); String getDns1();
String getDns2(); String getDns2();

View File

@ -17,19 +17,14 @@
package com.cloud.dc; package com.cloud.dc;
import com.cloud.org.Grouping; import com.cloud.org.Grouping;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
/** /**
* Represents one pod in the cloud stack. * Represents one pod in the cloud stack.
* *
*/ */
public interface Pod extends Grouping, InternalIdentity { public interface Pod extends Grouping, Identity, InternalIdentity {
/**
* @return unique id mapped to the pod.
*/
long getId();
String getUuid();
String getCidrAddress(); String getCidrAddress();
@ -39,8 +34,6 @@ public interface Pod extends Grouping, InternalIdentity {
long getDataCenterId(); long getDataCenterId();
// String getUniqueName();
String getDescription(); String getDescription();
String getName(); String getName();

View File

@ -16,8 +16,10 @@
// under the License. // under the License.
package com.cloud.dc; package com.cloud.dc;
public interface StorageNetworkIpRange { import org.apache.cloudstack.api.Identity;
String getUuid(); import org.apache.cloudstack.api.InternalIdentity;
public interface StorageNetworkIpRange extends InternalIdentity, Identity {
Integer getVlan(); Integer getVlan();

View File

@ -16,7 +16,10 @@
// under the License. // under the License.
package com.cloud.dc; package com.cloud.dc;
public interface Vlan { import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface Vlan extends InternalIdentity, Identity {
public enum VlanType { public enum VlanType {
DirectAttached, DirectAttached,
VirtualNetwork VirtualNetwork
@ -24,10 +27,6 @@ public interface Vlan {
public final static String UNTAGGED = "untagged"; public final static String UNTAGGED = "untagged";
public long getId();
public String getUuid();
public String getVlanTag(); public String getVlanTag();
public String getVlanGateway(); public String getVlanGateway();

View File

@ -19,23 +19,20 @@ package com.cloud.domain;
import java.util.Date; import java.util.Date;
import com.cloud.user.OwnedBy; import com.cloud.user.OwnedBy;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
/** /**
* Domain defines the Domain object. * Domain defines the Domain object.
*/ */
public interface Domain extends OwnedBy, InternalIdentity { public interface Domain extends OwnedBy, Identity, InternalIdentity {
public static final long ROOT_DOMAIN = 1L; public static final long ROOT_DOMAIN = 1L;
enum State { enum State {
Active, Inactive Active, Inactive
}; };
long getId();
String getUuid();
Long getParent(); Long getParent();
void setParent(Long parent); void setParent(Long parent);

View File

@ -19,9 +19,10 @@ package com.cloud.event;
import java.util.Date; import java.util.Date;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface Event extends ControlledEntity, InternalIdentity { public interface Event extends ControlledEntity, Identity, InternalIdentity {
public enum State { public enum State {
Created, Created,
Scheduled, Scheduled,
@ -29,16 +30,12 @@ public interface Event extends ControlledEntity, InternalIdentity {
Completed; Completed;
} }
long getId();
String getType(); String getType();
State getState(); State getState();
String getDescription(); String getDescription();
Date getCreateDate(); Date getCreateDate();
long getUserId(); long getUserId();
long getAccountId();
long getDomainId();
int getTotalSize(); int getTotalSize();
String getLevel(); String getLevel();
long getStartId(); long getStartId();

View File

@ -21,12 +21,14 @@ import java.util.Date;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.resource.ResourceState; import com.cloud.resource.ResourceState;
import com.cloud.utils.fsm.StateObject; import com.cloud.utils.fsm.StateObject;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
/** /**
* Host represents one particular host server. * Host represents one particular host server.
*/ */
public interface Host extends StateObject<Status> { public interface Host extends StateObject<Status>, Identity, InternalIdentity {
public enum Type { public enum Type {
Storage(false), Storage(false),
Routing(false), Routing(false),
@ -61,13 +63,6 @@ public interface Host extends StateObject<Status> {
} }
} }
/**
* @return id of the host.
*/
long getId();
String getUuid();
/** /**
* @return name of the machine. * @return name of the machine.
*/ */

View File

@ -17,18 +17,14 @@
package com.cloud.hypervisor; package com.cloud.hypervisor;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
/** /**
* HypervisorCapability represents one particular hypervisor version's capabilities. * HypervisorCapability represents one particular hypervisor version's capabilities.
*/ */
public interface HypervisorCapabilities { public interface HypervisorCapabilities extends Identity, InternalIdentity{
/**
* @return id of the host.
*/
long getId();
String getUuid();
/** /**
* @return type of hypervisor * @return type of hypervisor

View File

@ -20,6 +20,7 @@ import java.util.Date;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import com.cloud.utils.net.Ip; import com.cloud.utils.net.Ip;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
/** /**
@ -33,7 +34,7 @@ import org.apache.cloudstack.api.InternalIdentity;
* - DomainId = domain of the account owner. * - DomainId = domain of the account owner.
* - Allocated = time it was allocated. * - Allocated = time it was allocated.
*/ */
public interface IpAddress extends ControlledEntity, InternalIdentity { public interface IpAddress extends ControlledEntity, Identity, InternalIdentity {
enum State { enum State {
Allocating, // The IP Address is being propagated to other network elements and is not ready for use yet. Allocating, // The IP Address is being propagated to other network elements and is not ready for use yet.
Allocated, // The IP address is in used. Allocated, // The IP address is in used.
@ -68,13 +69,6 @@ public interface IpAddress extends ControlledEntity, InternalIdentity {
public Long getPhysicalNetworkId(); public Long getPhysicalNetworkId();
/**
* @return database id.
*/
long getId();
String getUuid();
void setState(IpAddress.State state); void setState(IpAddress.State state);
Long getAllocatedToAccountId(); Long getAllocatedToAccountId();
@ -92,5 +86,4 @@ public interface IpAddress extends ControlledEntity, InternalIdentity {
* @param vpcId * @param vpcId
*/ */
void setVpcId(Long vpcId); void setVpcId(Long vpcId);
} }

View File

@ -22,6 +22,7 @@ import com.cloud.network.Networks.Mode;
import com.cloud.network.Networks.TrafficType; import com.cloud.network.Networks.TrafficType;
import com.cloud.utils.fsm.FiniteState; import com.cloud.utils.fsm.FiniteState;
import com.cloud.utils.fsm.StateMachine; import com.cloud.utils.fsm.StateMachine;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
import java.net.URI; import java.net.URI;
@ -32,7 +33,7 @@ import java.util.Set;
/** /**
* owned by an account. * owned by an account.
*/ */
public interface Network extends ControlledEntity, InternalIdentity { public interface Network extends ControlledEntity, InternalIdentity, Identity {
public enum GuestType { public enum GuestType {
Shared, Shared,
@ -252,13 +253,6 @@ public interface Network extends ControlledEntity, InternalIdentity {
} }
} }
/**
* @return id of the network profile. Null means the network profile is not from the database.
*/
long getId();
String getUuid();
String getName(); String getName();
Mode getMode(); Mode getMode();

View File

@ -23,7 +23,7 @@ import com.cloud.network.Networks.Mode;
import com.cloud.network.Networks.TrafficType; import com.cloud.network.Networks.TrafficType;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public class NetworkProfile implements Network, InternalIdentity { public class NetworkProfile implements Network {
private long id; private long id;
private String uuid; private String uuid;
private long dataCenterId; private long dataCenterId;

View File

@ -16,6 +16,7 @@
// under the License. // under the License.
package com.cloud.network; package com.cloud.network;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
import java.util.List; import java.util.List;
@ -23,7 +24,7 @@ import java.util.List;
/** /**
* *
*/ */
public interface PhysicalNetwork extends InternalIdentity { public interface PhysicalNetwork extends Identity, InternalIdentity {
public enum State { public enum State {
Disabled, Disabled,
@ -42,8 +43,6 @@ public interface PhysicalNetwork extends InternalIdentity {
ZONE; ZONE;
} }
long getId();
BroadcastDomainRange getBroadcastDomainRange(); BroadcastDomainRange getBroadcastDomainRange();
// TrafficType getTrafficType(); // TrafficType getTrafficType();
@ -62,8 +61,6 @@ public interface PhysicalNetwork extends InternalIdentity {
String getSpeed(); String getSpeed();
String getUuid();
String getName(); String getName();
} }

View File

@ -17,14 +17,13 @@
package com.cloud.network; package com.cloud.network;
import com.cloud.network.Networks.TrafficType; import com.cloud.network.Networks.TrafficType;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
/** /**
* *
*/ */
public interface PhysicalNetworkTrafficType extends InternalIdentity { public interface PhysicalNetworkTrafficType extends InternalIdentity, Identity {
long getId();
long getPhysicalNetworkId(); long getPhysicalNetworkId();
@ -37,6 +36,4 @@ public interface PhysicalNetworkTrafficType extends InternalIdentity {
String getVmwareNetworkLabel(); String getVmwareNetworkLabel();
String getSimulatorNetworkLabel(); String getSimulatorNetworkLabel();
String getUuid();
} }

View File

@ -19,11 +19,10 @@ package com.cloud.network;
import java.util.Date; import java.util.Date;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface Site2SiteCustomerGateway extends ControlledEntity, InternalIdentity { public interface Site2SiteCustomerGateway extends ControlledEntity, Identity, InternalIdentity {
public long getId();
public String getUuid();
public String getGatewayIp(); public String getGatewayIp();
public String getGuestCidrList(); public String getGuestCidrList();
public String getIpsecPsk(); public String getIpsecPsk();

View File

@ -19,11 +19,10 @@ package com.cloud.network;
import java.util.Date; import java.util.Date;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface Site2SiteVpnGateway extends ControlledEntity, InternalIdentity { public interface Site2SiteVpnGateway extends ControlledEntity, Identity, InternalIdentity {
public long getId();
public String getUuid();
public long getAddrId(); public long getAddrId();
public long getVpcId(); public long getVpcId();
public Date getRemoved(); public Date getRemoved();

View File

@ -16,9 +16,10 @@
// under the License. // under the License.
package com.cloud.network; package com.cloud.network;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface VirtualRouterProvider extends InternalIdentity { public interface VirtualRouterProvider extends InternalIdentity, Identity {
public enum VirtualRouterProviderType { public enum VirtualRouterProviderType {
VirtualRouter, VirtualRouter,
ElasticLoadBalancerVm, ElasticLoadBalancerVm,
@ -27,10 +28,6 @@ public interface VirtualRouterProvider extends InternalIdentity {
public VirtualRouterProviderType getType(); public VirtualRouterProviderType getType();
public long getId();
public String getUuid();
public boolean isEnabled(); public boolean isEnabled();
public long getNspId(); public long getNspId();

View File

@ -17,19 +17,16 @@
package com.cloud.network; package com.cloud.network;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface VpnUser extends ControlledEntity, InternalIdentity { public interface VpnUser extends ControlledEntity, InternalIdentity, Identity {
enum State { enum State {
Add, Add,
Revoke, Revoke,
Active Active
} }
long getId();
String getUuid();
String getUsername(); String getUsername();
String getPassword(); String getPassword();

View File

@ -18,9 +18,10 @@
package com.cloud.network.as; package com.cloud.network.as;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface Condition extends ControlledEntity, InternalIdentity { public interface Condition extends ControlledEntity, Identity, InternalIdentity {
static enum Operator { static enum Operator {
EQ, GT, LT, GE, LE EQ, GT, LT, GE, LE
@ -31,8 +32,4 @@ public interface Condition extends ControlledEntity, InternalIdentity {
long getThreshold(); long getThreshold();
Operator getRelationalOperator(); Operator getRelationalOperator();
String getUuid();
long getId();
} }

View File

@ -17,7 +17,10 @@
package com.cloud.network.as; package com.cloud.network.as;
public interface Counter { import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface Counter extends InternalIdentity, Identity {
public static enum Source { public static enum Source {
netscaler, netscaler,
@ -29,8 +32,4 @@ public interface Counter {
String getValue(); String getValue();
Source getSource(); Source getSource();
String getUuid();
long getId();
} }

View File

@ -28,7 +28,7 @@ import com.cloud.network.rules.LoadBalancer;
import com.cloud.utils.Pair; import com.cloud.utils.Pair;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public class LoadBalancingRule implements FirewallRule, LoadBalancer, InternalIdentity { public class LoadBalancingRule implements FirewallRule, LoadBalancer {
private LoadBalancer lb; private LoadBalancer lb;
private List<LbDestination> destinations; private List<LbDestination> destinations;
private List<LbStickinessPolicy> stickinessPolicies; private List<LbStickinessPolicy> stickinessPolicies;

View File

@ -19,9 +19,10 @@ package com.cloud.network.rules;
import java.util.List; import java.util.List;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface FirewallRule extends ControlledEntity, InternalIdentity { public interface FirewallRule extends ControlledEntity, Identity, InternalIdentity {
enum Purpose { enum Purpose {
Firewall, Firewall,
PortForwarding, PortForwarding,
@ -48,17 +49,6 @@ public interface FirewallRule extends ControlledEntity, InternalIdentity {
Egress Egress
} }
/**
* @return database id.
*/
long getId();
/**
*
* @return uuid
*/
String getUuid();
/** /**
* @return external id. * @return external id.
*/ */

View File

@ -31,5 +31,4 @@ public interface LoadBalancer extends FirewallRule {
String getAlgorithm(); String getAlgorithm();
String getUuid();
} }

View File

@ -16,32 +16,7 @@
// under the License. // under the License.
package com.cloud.network.rules; package com.cloud.network.rules;
import com.cloud.acl.ControlledEntity; public interface StaticNatRule extends FirewallRule {
import org.apache.cloudstack.api.InternalIdentity;
public interface StaticNatRule extends ControlledEntity, InternalIdentity, FirewallRule {
long getId();
String getXid();
String getProtocol();
Integer getSourcePortStart();
Integer getSourcePortEnd();
Purpose getPurpose();
State getState();
long getAccountId();
long getDomainId();
long getNetworkId();
Long getSourceIpAddressId();
String getDestIpAddress(); String getDestIpAddress();
} }

View File

@ -19,12 +19,12 @@ package com.cloud.network.rules;
import java.util.List; import java.util.List;
import com.cloud.utils.Pair; import com.cloud.utils.Pair;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
/** /**
*/ */
public interface StickinessPolicy { public interface StickinessPolicy extends InternalIdentity, Identity {
public long getId();
public long getLoadBalancerId(); public long getLoadBalancerId();
@ -38,5 +38,4 @@ public interface StickinessPolicy {
public List<Pair<String, String>> getParams(); /* get params in Map <string,String> format */ public List<Pair<String, String>> getParams(); /* get params in Map <string,String> format */
public String getUuid();
} }

View File

@ -17,13 +17,11 @@
package com.cloud.network.security; package com.cloud.network.security;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
//FIXME: Annotation @doc("") //FIXME: Annotation @doc("")
public interface SecurityGroup extends ControlledEntity, InternalIdentity { public interface SecurityGroup extends ControlledEntity, InternalIdentity, Identity {
long getId();
String getUuid();
String getName(); String getName();

View File

@ -16,9 +16,9 @@
// under the License. // under the License.
package com.cloud.network.security; package com.cloud.network.security;
import com.cloud.network.security.SecurityRule.SecurityRuleType; import com.cloud.network.security.SecurityRule.SecurityRuleType;
import org.apache.cloudstack.api.InternalIdentity;
public interface SecurityGroupRules { public interface SecurityGroupRules extends InternalIdentity {
long getId();
String getName(); String getName();

View File

@ -17,8 +17,10 @@
package com.cloud.network.security; package com.cloud.network.security;
import com.cloud.async.AsyncInstanceCreateStatus; import com.cloud.async.AsyncInstanceCreateStatus;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface SecurityRule { public interface SecurityRule extends Identity, InternalIdentity {
public static class SecurityRuleType { public static class SecurityRuleType {
public static final SecurityRuleType IngressRule = new SecurityRuleType("ingress"); public static final SecurityRuleType IngressRule = new SecurityRuleType("ingress");
@ -33,7 +35,6 @@ public interface SecurityRule {
} }
private String _type; private String _type;
} }
long getId();
long getSecurityGroupId(); long getSecurityGroupId();
@ -52,7 +53,4 @@ public interface SecurityRule {
Long getAllowedNetworkId(); Long getAllowedNetworkId();
String getAllowedSourceIpCidr(); String getAllowedSourceIpCidr();
String getUuid();
} }

View File

@ -16,6 +16,6 @@
// under the License. // under the License.
package com.cloud.network.vpc; package com.cloud.network.vpc;
public interface PrivateGateway extends VpcGateway{ public interface PrivateGateway extends VpcGateway {
long getPhysicalNetworkId(); long getPhysicalNetworkId();
} }

View File

@ -17,9 +17,10 @@
package com.cloud.network.vpc; package com.cloud.network.vpc;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface StaticRoute extends ControlledEntity, InternalIdentity { public interface StaticRoute extends ControlledEntity, Identity, InternalIdentity {
enum State { enum State {
Staged, // route been created but has never got through network rule conflict detection. Routes in this state can not be sent to VPC virtual router. Staged, // route been created but has never got through network rule conflict detection. Routes in this state can not be sent to VPC virtual router.
Add, // Add means the route has been created and has gone through network rule conflict detection. Add, // Add means the route has been created and has gone through network rule conflict detection.
@ -46,13 +47,4 @@ public interface StaticRoute extends ControlledEntity, InternalIdentity {
* @return * @return
*/ */
Long getVpcId(); Long getVpcId();
/**
* @return
*/
long getId();
String getUuid();
} }

View File

@ -18,7 +18,7 @@ package com.cloud.network.vpc;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public class StaticRouteProfile implements StaticRoute, InternalIdentity { public class StaticRouteProfile implements StaticRoute {
private long id; private long id;
private String uuid; private String uuid;
private String targetCidr; private String targetCidr;

View File

@ -18,9 +18,10 @@ package com.cloud.network.vpc;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import com.cloud.network.Network; import com.cloud.network.Network;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface Vpc extends ControlledEntity, InternalIdentity{ public interface Vpc extends ControlledEntity, Identity, InternalIdentity {
public enum State { public enum State {
Enabled, Enabled,
Inactive Inactive
@ -30,10 +31,6 @@ public interface Vpc extends ControlledEntity, InternalIdentity{
boolean readyToUse(); boolean readyToUse();
long getId();
String getUuid();
String getName(); String getName();
long getZoneId(); long getZoneId();

View File

@ -33,8 +33,6 @@ public interface VpcGateway extends Identity, ControlledEntity, InternalIdentity
Deleting Deleting
} }
long getId();
/** /**
* @return * @return
*/ */

View File

@ -16,9 +16,10 @@
// under the License. // under the License.
package com.cloud.network.vpc; package com.cloud.network.vpc;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface VpcOffering extends InternalIdentity { public interface VpcOffering extends InternalIdentity, Identity {
public enum State { public enum State {
Disabled, Disabled,
Enabled Enabled
@ -26,10 +27,6 @@ public interface VpcOffering extends InternalIdentity {
public static final String defaultVPCOfferingName = "Default VPC offering"; public static final String defaultVPCOfferingName = "Default VPC offering";
long getId();
String getUuid();
String getName(); String getName();
String getUniqueName(); String getUniqueName();

View File

@ -16,6 +16,9 @@
// under the License. // under the License.
package com.cloud.offering; package com.cloud.offering;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
/** /**
@ -23,10 +26,7 @@ import java.util.Date;
* the disk offering. * the disk offering.
* *
*/ */
public interface DiskOffering { public interface DiskOffering extends Identity, InternalIdentity {
long getId();
String getUuid();
String getUniqueName(); String getUniqueName();

View File

@ -18,13 +18,14 @@ package com.cloud.offering;
import com.cloud.network.Network.GuestType; import com.cloud.network.Network.GuestType;
import com.cloud.network.Networks.TrafficType; import com.cloud.network.Networks.TrafficType;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
/** /**
* Describes network offering * Describes network offering
* *
*/ */
public interface NetworkOffering extends InternalIdentity { public interface NetworkOffering extends InternalIdentity, Identity {
public enum Availability { public enum Availability {
Required, Required,
@ -51,11 +52,6 @@ public interface NetworkOffering extends InternalIdentity {
public final static String DefaultIsolatedNetworkOfferingForVpcNetworks = "DefaultIsolatedNetworkOfferingForVpcNetworks"; public final static String DefaultIsolatedNetworkOfferingForVpcNetworks = "DefaultIsolatedNetworkOfferingForVpcNetworks";
public final static String DefaultIsolatedNetworkOfferingForVpcNetworksNoLB = "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"; public final static String DefaultIsolatedNetworkOfferingForVpcNetworksNoLB = "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB";
long getId();
String getUuid();
/** /**
* @return name for the network offering. * @return name for the network offering.
*/ */

View File

@ -18,17 +18,15 @@ package com.cloud.org;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.org.Managed.ManagedState; import com.cloud.org.Managed.ManagedState;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface Cluster extends Grouping { public interface Cluster extends Grouping, InternalIdentity, Identity {
public static enum ClusterType { public static enum ClusterType {
CloudManaged, CloudManaged,
ExternalManaged; ExternalManaged;
}; };
long getId();
String getUuid();
String getName(); String getName();
long getDataCenterId(); long getDataCenterId();

View File

@ -19,15 +19,14 @@ package com.cloud.projects;
import java.util.Date; import java.util.Date;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface ProjectInvitation extends ControlledEntity, InternalIdentity { public interface ProjectInvitation extends ControlledEntity, Identity, InternalIdentity {
public enum State { public enum State {
Pending, Completed, Expired, Declined Pending, Completed, Expired, Declined
} }
long getId();
long getProjectId(); long getProjectId();
Long getForAccountId(); Long getForAccountId();

View File

@ -17,9 +17,10 @@
package com.cloud.server; package com.cloud.server;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface ResourceTag extends ControlledEntity, InternalIdentity { public interface ResourceTag extends ControlledEntity, Identity, InternalIdentity {
public enum TaggedResourceType { public enum TaggedResourceType {
UserVm, UserVm,
@ -39,11 +40,6 @@ public interface ResourceTag extends ControlledEntity, InternalIdentity {
StaticRoute StaticRoute
} }
/**
* @return
*/
long getId();
/** /**
* @return * @return
*/ */

View File

@ -16,13 +16,10 @@
// under the License. // under the License.
package com.cloud.storage; package com.cloud.storage;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface GuestOS extends InternalIdentity { public interface GuestOS extends InternalIdentity, Identity {
long getId();
String getUuid();
String getName(); String getName();

View File

@ -16,12 +16,12 @@
// under the License. // under the License.
package com.cloud.storage; package com.cloud.storage;
public interface GuestOsCategory { import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface GuestOsCategory extends Identity, InternalIdentity {
// Used by OS preference, 'None' for no OS preference // Used by OS preference, 'None' for no OS preference
public static final String CATEGORY_NONE ="None"; public static final String CATEGORY_NONE ="None";
long getId();
String getUuid();
String getName(); String getName();

View File

@ -19,14 +19,12 @@
package com.cloud.storage; package com.cloud.storage;
import com.cloud.agent.api.to.S3TO; import com.cloud.agent.api.to.S3TO;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
public interface S3 { public interface S3 extends InternalIdentity, Identity {
long getId();
String getUuid();
String getAccessKey(); String getAccessKey();

View File

@ -20,9 +20,10 @@ import java.util.Date;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface Snapshot extends ControlledEntity, InternalIdentity { public interface Snapshot extends ControlledEntity, Identity, InternalIdentity {
public enum Type { public enum Type {
MANUAL, MANUAL,
RECURRING, RECURRING,
@ -68,10 +69,6 @@ public interface Snapshot extends ControlledEntity, InternalIdentity {
public static final long MANUAL_POLICY_ID = 0L; public static final long MANUAL_POLICY_ID = 0L;
long getId();
String getUuid();
long getAccountId(); long getAccountId();
long getVolumeId(); long getVolumeId();

View File

@ -19,25 +19,16 @@ package com.cloud.storage;
import java.util.Date; import java.util.Date;
import com.cloud.storage.Storage.StoragePoolType; import com.cloud.storage.Storage.StoragePoolType;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface StoragePool { public interface StoragePool extends Identity, InternalIdentity {
/**
* @return id of the pool.
*/
long getId();
/** /**
* @return name of the pool. * @return name of the pool.
*/ */
String getName(); String getName();
/***
*
* @return unique identifier
*/
String getUuid();
/** /**
* @return the type of pool. * @return the type of pool.
*/ */

View File

@ -16,11 +16,12 @@
// under the License. // under the License.
package com.cloud.storage; package com.cloud.storage;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
public interface Upload extends InternalIdentity { public interface Upload extends InternalIdentity, Identity {
public static enum Status { public static enum Status {
UNKNOWN, ABANDONED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS, NOT_COPIED, COPY_IN_PROGRESS, COPY_ERROR, COPY_COMPLETE, DOWNLOAD_URL_CREATED, DOWNLOAD_URL_NOT_CREATED, ERROR UNKNOWN, ABANDONED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS, NOT_COPIED, COPY_IN_PROGRESS, COPY_ERROR, COPY_COMPLETE, DOWNLOAD_URL_CREATED, DOWNLOAD_URL_NOT_CREATED, ERROR
@ -36,10 +37,6 @@ public interface Upload extends InternalIdentity {
long getHostId(); long getHostId();
long getId();
String getUuid();
Date getCreated(); Date getCreated();
Date getLastUpdated(); Date getLastUpdated();

View File

@ -16,9 +16,12 @@
// under the License. // under the License.
package com.cloud.storage; package com.cloud.storage;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
public interface VMTemplateStorageResourceAssoc { public interface VMTemplateStorageResourceAssoc extends InternalIdentity {
public static enum Status { public static enum Status {
UNKNOWN, DOWNLOAD_ERROR, NOT_DOWNLOADED, DOWNLOAD_IN_PROGRESS, DOWNLOADED, ABANDONED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS UNKNOWN, DOWNLOAD_ERROR, NOT_DOWNLOADED, DOWNLOAD_IN_PROGRESS, DOWNLOADED, ABANDONED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS
} }
@ -35,8 +38,6 @@ public interface VMTemplateStorageResourceAssoc {
void setDownloadState(Status downloadState); void setDownloadState(Status downloadState);
long getId();
Date getCreated(); Date getCreated();
Date getLastUpdated(); Date getLastUpdated();

View File

@ -22,9 +22,10 @@ import com.cloud.acl.ControlledEntity;
import com.cloud.template.BasedOn; import com.cloud.template.BasedOn;
import com.cloud.utils.fsm.StateMachine2; import com.cloud.utils.fsm.StateMachine2;
import com.cloud.utils.fsm.StateObject; import com.cloud.utils.fsm.StateObject;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface Volume extends ControlledEntity, InternalIdentity, BasedOn, StateObject<Volume.State> { public interface Volume extends ControlledEntity, Identity, InternalIdentity, BasedOn, StateObject<Volume.State> {
enum Type { enum Type {
UNKNOWN, ROOT, SWAP, DATADISK, ISO UNKNOWN, ROOT, SWAP, DATADISK, ISO
}; };
@ -94,10 +95,6 @@ public interface Volume extends ControlledEntity, InternalIdentity, BasedOn, Sta
ExpungingRequested; ExpungingRequested;
} }
long getId();
String getUuid();
/** /**
* @return the volume name * @return the volume name
*/ */

View File

@ -16,10 +16,10 @@
// under the License. // under the License.
package com.cloud.storage.snapshot; package com.cloud.storage.snapshot;
public interface SnapshotPolicy { import org.apache.cloudstack.api.Identity;
long getId(); import org.apache.cloudstack.api.InternalIdentity;
String getUuid(); public interface SnapshotPolicy extends Identity, InternalIdentity {
long getVolumeId(); long getVolumeId();

View File

@ -23,9 +23,10 @@ import com.cloud.acl.ControlledEntity;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Storage.ImageFormat; import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.Storage.TemplateType; import com.cloud.storage.Storage.TemplateType;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface VirtualMachineTemplate extends ControlledEntity, InternalIdentity { public interface VirtualMachineTemplate extends ControlledEntity, Identity, InternalIdentity {
public static enum BootloaderType { public static enum BootloaderType {
PyGrub, HVM, External, CD PyGrub, HVM, External, CD
@ -41,13 +42,6 @@ public interface VirtualMachineTemplate extends ControlledEntity, InternalIdenti
all // all templates (only usable by admins) all // all templates (only usable by admins)
} }
/**
* @return id.
*/
long getId();
String getUuid();
boolean isFeatured(); boolean isFeatured();
/** /**

View File

@ -19,9 +19,10 @@ package com.cloud.user;
import java.util.Date; import java.util.Date;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface Account extends ControlledEntity, InternalIdentity { public interface Account extends ControlledEntity, InternalIdentity, Identity {
public enum Type { public enum Type {
Normal, Normal,
Admin, Admin,
@ -50,10 +51,6 @@ public interface Account extends ControlledEntity, InternalIdentity {
public static final long ACCOUNT_ID_SYSTEM = 1; public static final long ACCOUNT_ID_SYSTEM = 1;
public long getId();
public String getUuid();
public String getAccountName(); public String getAccountName();
public short getType(); public short getType();

View File

@ -21,11 +21,6 @@ import org.apache.cloudstack.api.InternalIdentity;
public interface SSHKeyPair extends ControlledEntity, InternalIdentity { public interface SSHKeyPair extends ControlledEntity, InternalIdentity {
/**
* @return The id of the key pair.
*/
public long getId();
/** /**
* @return The given name of the key pair. * @return The given name of the key pair.
*/ */

View File

@ -19,10 +19,10 @@ package com.cloud.vm;
import java.util.Date; import java.util.Date;
import com.cloud.acl.ControlledEntity; import com.cloud.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface InstanceGroup extends ControlledEntity, InternalIdentity { public interface InstanceGroup extends ControlledEntity, Identity, InternalIdentity {
long getId();
String getName(); String getName();

View File

@ -25,11 +25,13 @@ import com.cloud.network.Networks.AddressFormat;
import com.cloud.network.Networks.Mode; import com.cloud.network.Networks.Mode;
import com.cloud.utils.fsm.FiniteState; import com.cloud.utils.fsm.FiniteState;
import com.cloud.utils.fsm.StateMachine; import com.cloud.utils.fsm.StateMachine;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
/** /**
* Nic represents one nic on the VM. * Nic represents one nic on the VM.
*/ */
public interface Nic { public interface Nic extends Identity, InternalIdentity {
enum Event { enum Event {
ReservationRequested, ReleaseRequested, CancelRequested, OperationCompleted, OperationFailed, ReservationRequested, ReleaseRequested, CancelRequested, OperationCompleted, OperationFailed,
} }
@ -86,11 +88,6 @@ public interface Nic {
PlaceHolder, Create, Start, Managed; PlaceHolder, Create, Start, Managed;
} }
/**
* @return id in the CloudStack database
*/
long getId();
/** /**
* @return reservation id returned by the allocation source. This can be the String version of the database id if * @return reservation id returned by the allocation source. This can be the String version of the database id if
* the * the

View File

@ -207,11 +207,6 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I
*/ */
public String getInstanceName(); public String getInstanceName();
/**
* @return the id of this virtual machine. null means the id has not been set.
*/
public long getId();
/** /**
* @return the host name of the virtual machine. If the user did not * @return the host name of the virtual machine. If the user did not
* specify the host name when creating the virtual machine then it is * specify the host name when creating the virtual machine then it is

View File

@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

View File

@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

View File

@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

View File

@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

View File

@ -0,0 +1,61 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
import factory
import marvin
from marvin import cloudstackTestCase
from marvin.integration.lib.base import *
from marvin.integration.lib import utils
class AccountFactory(factory.Factory):
FACTORY_FOR = createAccount.createAccountCmd
firstname = 'firstname-'+random_gen()
lastname = 'lastname-'+random_gen()
email = factory.lazy_attribute(lambda e: '{0}.{1}@cloudstack.org'.format(e.firstname, e.lastname).lower())
class AdminAccountFactory(AccountFactory):
accounttype = 1
class UserAccountFactory(AccountFactory):
accounttype = 0
class TestCreateAccount(cloudstackTestCase):
def setUp(self):
self.apiClient = self.testClient.getApiClient()
self.userApiClient = self.testClient.getUserApiClient(account='test'+utils.random_gen(), 'ROOT')
def test_createAccountAsAdmin(self):
"""
creates an account for a user as admin
"""
Account.create(self.apiClient, services=None)
from marvin.cloudstackAPI.createAccount import createAccountCmd
self.assertEqual(True, False)
def test_createAccountAsUser(self):
"""
negative: create account as a user
"""
self.assertEqual(True, False)
def tearDown(self):
self.apiClient.close()
self.userApiClient.close()
if __name__ == '__main__':
unittest.main()

View File

@ -34,7 +34,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="alert") @Table(name="alert")
public class AlertVO implements Alert, Identity, InternalIdentity { public class AlertVO implements Alert {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -36,7 +36,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="async_job") @Table(name="async_job")
public class AsyncJobVO implements AsyncJob, InternalIdentity { public class AsyncJobVO implements AsyncJob {
public static final int CALLBACK_POLLING = 0; public static final int CALLBACK_POLLING = 0;
public static final int CALLBACK_EMAIL = 1; public static final int CALLBACK_EMAIL = 1;
@ -126,21 +126,21 @@ public class AsyncJobVO implements AsyncJob, InternalIdentity {
} }
public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, Long instanceId, Type instanceType) { public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, Long instanceId, Type instanceType) {
this.userId = userId; this.userId = userId;
this.accountId = accountId; this.accountId = accountId;
this.cmd = cmd; this.cmd = cmd;
this.cmdInfo = cmdInfo; this.cmdInfo = cmdInfo;
this.callbackType = CALLBACK_POLLING; this.callbackType = CALLBACK_POLLING;
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
this.instanceId = instanceId; this.instanceId = instanceId;
} }
public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo,
int callbackType, String callbackAddress, Long instanceId, Type instanceType) { int callbackType, String callbackAddress, Long instanceId, Type instanceType) {
this(userId, accountId, cmd, cmdInfo, instanceId, instanceType); this(userId, accountId, cmd, cmdInfo, instanceId, instanceType);
this.callbackType = callbackType; this.callbackType = callbackType;
this.callbackAddress = callbackAddress; this.callbackAddress = callbackAddress;
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
} }

View File

@ -33,7 +33,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="op_host_capacity") @Table(name="op_host_capacity")
public class CapacityVO implements Capacity, InternalIdentity { public class CapacityVO implements Capacity {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")
@ -196,4 +196,9 @@ public class CapacityVO implements Capacity, InternalIdentity {
public void setUsedPercentage(float usedPercentage) { public void setUsedPercentage(float usedPercentage) {
this.usedPercentage = usedPercentage; this.usedPercentage = usedPercentage;
} }
@Override
public String getUuid() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
} }

View File

@ -29,7 +29,7 @@ import javax.persistence.Table;
@Entity @Entity
@Table(name="resource_count") @Table(name="resource_count")
public class ResourceCountVO implements ResourceCount, InternalIdentity { public class ResourceCountVO implements ResourceCount {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)

View File

@ -29,7 +29,7 @@ import javax.persistence.Table;
@Entity @Entity
@Table(name = "resource_limit") @Table(name = "resource_limit")
public class ResourceLimitVO implements ResourceLimit, InternalIdentity { public class ResourceLimitVO implements ResourceLimit {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)

View File

@ -35,7 +35,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="event") @Table(name="event")
public class EventVO implements Event, Identity, InternalIdentity { public class EventVO implements Event {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -21,7 +21,6 @@ import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
public interface UsageEvent extends InternalIdentity { public interface UsageEvent extends InternalIdentity {
long getId();
String getType(); String getType();
Date getCreateDate(); Date getCreateDate();

View File

@ -30,7 +30,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="usage_event") @Table(name="usage_event")
public class UsageEventVO implements UsageEvent, InternalIdentity { public class UsageEventVO implements UsageEvent {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -49,7 +49,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Table(name="host") @Table(name="host")
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32) @DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
public class HostVO implements Host, Identity, InternalIdentity { public class HostVO implements Host {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -34,7 +34,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="hypervisor_capabilities") @Table(name="hypervisor_capabilities")
public class HypervisorCapabilitiesVO implements HypervisorCapabilities, Identity, InternalIdentity { public class HypervisorCapabilitiesVO implements HypervisorCapabilities {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -33,7 +33,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name=("vpn_users")) @Table(name=("vpn_users"))
public class VpnUserVO implements VpnUser, Identity, InternalIdentity { public class VpnUserVO implements VpnUser {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -33,7 +33,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name = ("security_group_rule")) @Table(name = ("security_group_rule"))
public class SecurityGroupRuleVO implements SecurityRule, InternalIdentity { public class SecurityGroupRuleVO implements SecurityRule {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id") @Column(name = "id")

View File

@ -33,7 +33,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Table(name = ("security_group")) @Table(name = ("security_group"))
@JoinType(type = "left") @JoinType(type = "left")
@SecondaryTable(name = "security_group_rule", pkJoinColumns = { @PrimaryKeyJoinColumn(name = "id", referencedColumnName = "security_group_id") }) @SecondaryTable(name = "security_group_rule", pkJoinColumns = { @PrimaryKeyJoinColumn(name = "id", referencedColumnName = "security_group_id") })
public class SecurityGroupRulesVO implements SecurityGroupRules, InternalIdentity { public class SecurityGroupRulesVO implements SecurityGroupRules {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id") @Column(name = "id")

View File

@ -30,7 +30,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name = ("security_group")) @Table(name = ("security_group"))
public class SecurityGroupVO implements SecurityGroup, Identity, InternalIdentity { public class SecurityGroupVO implements SecurityGroup {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id") @Column(name = "id")

View File

@ -16,6 +16,8 @@
// under the License. // under the License.
package com.cloud.network.security; package com.cloud.network.security;
import org.apache.cloudstack.api.InternalIdentity;
/** /**
* Work related to security groups for a vm * Work related to security groups for a vm
* *

View File

@ -43,7 +43,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Table(name="disk_offering") @Table(name="disk_offering")
@Inheritance(strategy=InheritanceType.JOINED) @Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32) @DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
public class DiskOfferingVO implements DiskOffering, Identity, InternalIdentity { public class DiskOfferingVO implements DiskOffering {
public enum Type { public enum Type {
Disk, Disk,
Service Service

View File

@ -30,7 +30,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="guest_os_category") @Table(name="guest_os_category")
public class GuestOSCategoryVO implements GuestOsCategory, Identity, InternalIdentity { public class GuestOSCategoryVO implements GuestOsCategory {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -30,7 +30,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="guest_os") @Table(name="guest_os")
public class GuestOSVO implements GuestOS, Identity, InternalIdentity { public class GuestOSVO implements GuestOS {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -33,7 +33,7 @@ import java.util.Date;
@Entity @Entity
@Table(name = "s3") @Table(name = "s3")
public class S3VO implements S3, Identity, InternalIdentity { public class S3VO implements S3 {
public static final String ID_COLUMN_NAME = "id"; public static final String ID_COLUMN_NAME = "id";

View File

@ -32,7 +32,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="snapshot_policy") @Table(name="snapshot_policy")
public class SnapshotPolicyVO implements SnapshotPolicy, InternalIdentity { public class SnapshotPolicyVO implements SnapshotPolicy {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)

View File

@ -34,7 +34,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="snapshot_schedule") @Table(name="snapshot_schedule")
public class SnapshotScheduleVO implements SnapshotSchedule, InternalIdentity { public class SnapshotScheduleVO implements SnapshotSchedule {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)

View File

@ -36,7 +36,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="snapshots") @Table(name="snapshots")
public class SnapshotVO implements Snapshot, Identity, InternalIdentity { public class SnapshotVO implements Snapshot {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)

View File

@ -16,9 +16,11 @@
// under the License. // under the License.
package com.cloud.storage; package com.cloud.storage;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
public interface StoragePoolHostAssoc { public interface StoragePoolHostAssoc extends InternalIdentity {
long getHostId(); long getHostId();

View File

@ -36,7 +36,7 @@ import org.apache.cloudstack.api.InternalIdentity;
*/ */
@Entity @Entity
@Table(name="storage_pool_host_ref") @Table(name="storage_pool_host_ref")
public class StoragePoolHostVO implements StoragePoolHostAssoc, InternalIdentity { public class StoragePoolHostVO implements StoragePoolHostAssoc {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id; private Long id;

View File

@ -37,7 +37,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="storage_pool") @Table(name="storage_pool")
public class StoragePoolVO implements StoragePool, Identity, InternalIdentity { public class StoragePoolVO implements StoragePool {
@Id @Id
@TableGenerator(name="storage_pool_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="storage_pool_seq", allocationSize=1) @TableGenerator(name="storage_pool_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="storage_pool_seq", allocationSize=1)
@Column(name="id", updatable=false, nullable = false) @Column(name="id", updatable=false, nullable = false)

View File

@ -36,7 +36,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="upload") @Table(name="upload")
public class UploadVO implements Upload, InternalIdentity { public class UploadVO implements Upload {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
long id; long id;

View File

@ -38,7 +38,7 @@ import org.apache.cloudstack.api.InternalIdentity;
*/ */
@Entity @Entity
@Table(name="template_host_ref") @Table(name="template_host_ref")
public class VMTemplateHostVO implements VMTemplateStorageResourceAssoc, InternalIdentity { public class VMTemplateHostVO implements VMTemplateStorageResourceAssoc {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
Long id; Long id;

View File

@ -38,7 +38,7 @@ import org.apache.cloudstack.api.InternalIdentity;
*/ */
@Entity @Entity
@Table(name="template_spool_ref") @Table(name="template_spool_ref")
public class VMTemplateStoragePoolVO implements VMTemplateStorageResourceAssoc, InternalIdentity { public class VMTemplateStoragePoolVO implements VMTemplateStorageResourceAssoc {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
long id; long id;

View File

@ -41,7 +41,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="vm_template") @Table(name="vm_template")
public class VMTemplateVO implements VirtualMachineTemplate, InternalIdentity { public class VMTemplateVO implements VirtualMachineTemplate {
@Id @Id
@TableGenerator(name="vm_template_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_template_seq", allocationSize=1) @TableGenerator(name="vm_template_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_template_seq", allocationSize=1)
@Column(name="id", nullable = false) @Column(name="id", nullable = false)

View File

@ -39,7 +39,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name = "volumes") @Table(name = "volumes")
public class VolumeVO implements Volume, Identity, InternalIdentity { public class VolumeVO implements Volume {
@Id @Id
@TableGenerator(name = "volume_sq", table = "sequence", pkColumnName = "name", valueColumnName = "value", pkColumnValue = "volume_seq", allocationSize = 1) @TableGenerator(name = "volume_sq", table = "sequence", pkColumnName = "name", valueColumnName = "value", pkColumnValue = "volume_seq", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.TABLE) @GeneratedValue(strategy = GenerationType.TABLE)

View File

@ -16,12 +16,12 @@
// under the License. // under the License.
package com.cloud.storage.snapshot; package com.cloud.storage.snapshot;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
public interface SnapshotSchedule { public interface SnapshotSchedule extends InternalIdentity, Identity {
long getId();
String getUuid();
Long getVolumeId(); Long getVolumeId();

View File

@ -34,7 +34,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Entity @Entity
@Table(name="account") @Table(name="account")
public class AccountVO implements Account, Identity, InternalIdentity { public class AccountVO implements Account {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -28,7 +28,7 @@ import javax.persistence.Transient;
@Entity @Entity
@Table(name="ssh_keypairs") @Table(name="ssh_keypairs")
public class SSHKeyPairVO implements SSHKeyPair, InternalIdentity { public class SSHKeyPairVO implements SSHKeyPair {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)

View File

@ -36,7 +36,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Table(name="instance_group") @Table(name="instance_group")
@SecondaryTable(name="account", @SecondaryTable(name="account",
pkJoinColumns={@PrimaryKeyJoinColumn(name="account_id", referencedColumnName="id")}) pkJoinColumns={@PrimaryKeyJoinColumn(name="account_id", referencedColumnName="id")})
public class InstanceGroupVO implements InstanceGroup, Identity, InternalIdentity { public class InstanceGroupVO implements InstanceGroup {
@Id @Id
@GeneratedValue(strategy=GenerationType.IDENTITY) @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id") @Column(name="id")

View File

@ -48,7 +48,7 @@ import org.apache.cloudstack.api.InternalIdentity;
@Table(name="vm_instance") @Table(name="vm_instance")
@Inheritance(strategy=InheritanceType.JOINED) @Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32) @DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
public class VMInstanceVO implements VirtualMachine, InternalIdentity, FiniteStateObject<State, VirtualMachine.Event> { public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, VirtualMachine.Event> {
@Id @Id
@TableGenerator(name="vm_instance_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_instance_seq", allocationSize=1) @TableGenerator(name="vm_instance_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_instance_seq", allocationSize=1)
@Column(name="id", updatable=false, nullable = false) @Column(name="id", updatable=false, nullable = false)

View File

@ -16,7 +16,10 @@
// under the License. // under the License.
package com.cloud.network; package com.cloud.network;
public interface CiscoNexusVSMDevice { import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface CiscoNexusVSMDevice extends InternalIdentity, Identity {
// This tells us whether the VSM is currently enabled or disabled. We may // This tells us whether the VSM is currently enabled or disabled. We may
// need this if we would like to carry out any sort of maintenance on the // need this if we would like to carry out any sort of maintenance on the
@ -39,10 +42,6 @@ public interface CiscoNexusVSMDevice {
Standby Standby
} }
long getId();
String getUuid();
public String getvsmName(); public String getvsmName();
public long getHostId(); public long getHostId();

Some files were not shown because too many files have changed in this diff Show More