Reformatted all of the code.

This commit is contained in:
Alex Huang 2013-11-21 06:15:26 -08:00
parent eaa250fd3c
commit d620df2bdd
3156 changed files with 43639 additions and 35957 deletions

View File

@ -35,9 +35,10 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.naming.ConfigurationException; import javax.naming.ConfigurationException;
import org.apache.cloudstack.managed.context.ManagedContextTimerTask;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.cloudstack.managed.context.ManagedContextTimerTask;
import com.cloud.agent.api.AgentControlAnswer; import com.cloud.agent.api.AgentControlAnswer;
import com.cloud.agent.api.AgentControlCommand; import com.cloud.agent.api.AgentControlCommand;
import com.cloud.agent.api.Answer; import com.cloud.agent.api.Answer;
@ -132,10 +133,12 @@ public class Agent implements HandlerFactory, IAgentControl {
Runtime.getRuntime().addShutdownHook(new ShutdownThread(this)); Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));
_ugentTaskPool = new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory( _ugentTaskPool =
new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory(
"UgentTask")); "UgentTask"));
_executor = new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory( _executor =
new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(
"agentRequest-Handler")); "agentRequest-Handler"));
} }
@ -168,10 +171,12 @@ public class Agent implements HandlerFactory, IAgentControl {
s_logger.debug("Adding shutdown hook"); s_logger.debug("Adding shutdown hook");
Runtime.getRuntime().addShutdownHook(new ShutdownThread(this)); Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));
_ugentTaskPool = new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory( _ugentTaskPool =
new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory(
"UgentTask")); "UgentTask"));
_executor = new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory( _executor =
new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(
"agentRequest-Handler")); "agentRequest-Handler"));
s_logger.info("Agent [id = " + (_id != null ? _id : "new") + " : type = " + getResourceName() + " : zone = " + _shell.getZone() + " : pod = " + _shell.getPod() + s_logger.info("Agent [id = " + (_id != null ? _id : "new") + " : type = " + getResourceName() + " : zone = " + _shell.getZone() + " : pod = " + _shell.getPod() +
@ -489,7 +494,7 @@ public class Agent implements HandlerFactory, IAgentControl {
} else { } else {
if (cmd instanceof ReadyCommand) { if (cmd instanceof ReadyCommand) {
processReadyCommand((ReadyCommand)cmd); processReadyCommand(cmd);
} }
_inProgress.incrementAndGet(); _inProgress.incrementAndGet();
try { try {

View File

@ -401,6 +401,7 @@ public class AgentShell implements IAgentShell, Daemon {
return _nextAgentId++; return _nextAgentId++;
} }
@Override
public void start() { public void start() {
try { try {
/* By default we only search for log4j.xml */ /* By default we only search for log4j.xml */
@ -444,10 +445,12 @@ public class AgentShell implements IAgentShell, Daemon {
} }
} }
@Override
public void stop() { public void stop() {
_exit = true; _exit = true;
} }
@Override
public void destroy() { public void destroy() {
} }

View File

@ -20,7 +20,6 @@ import java.io.IOException;
import java.net.DatagramPacket; import java.net.DatagramPacket;
import java.net.DatagramSocket; import java.net.DatagramSocket;
import java.net.InetAddress; import java.net.InetAddress;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
@ -42,6 +41,7 @@ public class DhcpProtocolParserServer extends Thread {
_running = true; _running = true;
} }
@Override
public void run() { public void run() {
while (_running) { while (_running) {
try { try {

View File

@ -33,6 +33,7 @@ public interface DhcpSnooper extends Adapter {
public Map<String, InetAddress> syncIpAddr(); public Map<String, InetAddress> syncIpAddr();
@Override
public boolean stop(); public boolean stop();
public void initializeMacTable(List<Pair<String, String>> macVmNameList); public void initializeMacTable(List<Pair<String, String>> macVmNameList);

View File

@ -53,8 +53,8 @@ public class MockVmMgr implements VmMgr {
} }
@Override @Override
public String startVM(String vmName, String vnetId, String gateway, String dns, String privateIP, String privateMac, String privateMask, String publicIP, String publicMac, public String startVM(String vmName, String vnetId, String gateway, String dns, String privateIP, String privateMac, String privateMask, String publicIP,
String publicMask, int cpuCount, int cpuUtilization, long ramSize, String localPath, String vncPassword) { String publicMac, String publicMask, int cpuCount, int cpuUtilization, long ramSize, String localPath, String vncPassword) {
if (s_logger.isInfoEnabled()) { if (s_logger.isInfoEnabled()) {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
@ -132,6 +132,7 @@ public class MockVmMgr implements VmMgr {
return false; return false;
} }
@Override
public MockVm getVm(String vmName) { public MockVm getVm(String vmName) {
synchronized (this) { synchronized (this) {
MockVm vm = vms.get(vmName); MockVm vm = vms.get(vmName);

View File

@ -25,8 +25,8 @@ import com.cloud.vm.VirtualMachine.State;
public interface VmMgr { public interface VmMgr {
public Set<String> getCurrentVMs(); public Set<String> getCurrentVMs();
public String startVM(String vmName, String vnetId, String gateway, String dns, String privateIP, String privateMac, String privateMask, String publicIP, String publicMac, public String startVM(String vmName, String vnetId, String gateway, String dns, String privateIP, String privateMac, String privateMask, String publicIP,
String publicMask, int cpuCount, int cpuUtilization, long ramSize, String localPath, String vncPassword); String publicMac, String publicMask, int cpuCount, int cpuUtilization, long ramSize, String localPath, String vncPassword);
public String stopVM(String vmName, boolean force); public String stopVM(String vmName, boolean force);

View File

@ -32,9 +32,9 @@ import com.cloud.agent.api.Command;
import com.cloud.agent.api.PingCommand; import com.cloud.agent.api.PingCommand;
import com.cloud.agent.api.StartupCommand; import com.cloud.agent.api.StartupCommand;
import com.cloud.agent.api.StartupRoutingCommand; import com.cloud.agent.api.StartupRoutingCommand;
import com.cloud.agent.api.StartupRoutingCommand.VmState;
import com.cloud.agent.api.StartupStorageCommand; import com.cloud.agent.api.StartupStorageCommand;
import com.cloud.agent.api.StoragePoolInfo; import com.cloud.agent.api.StoragePoolInfo;
import com.cloud.agent.api.StartupRoutingCommand.VmState;
import com.cloud.host.Host; import com.cloud.host.Host;
import com.cloud.host.Host.Type; import com.cloud.host.Host.Type;
import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.Hypervisor.HypervisorType;
@ -110,14 +110,14 @@ public class DummyResource implements ServerResource {
protected void fillNetworkInformation(final StartupCommand cmd) { protected void fillNetworkInformation(final StartupCommand cmd) {
cmd.setPrivateIpAddress((String)getConfiguredProperty("private.ip.address", "127.0.0.1")); cmd.setPrivateIpAddress(getConfiguredProperty("private.ip.address", "127.0.0.1"));
cmd.setPrivateMacAddress((String)getConfiguredProperty("private.mac.address", "8A:D2:54:3F:7C:C3")); cmd.setPrivateMacAddress(getConfiguredProperty("private.mac.address", "8A:D2:54:3F:7C:C3"));
cmd.setPrivateNetmask((String)getConfiguredProperty("private.ip.netmask", "255.255.255.0")); cmd.setPrivateNetmask(getConfiguredProperty("private.ip.netmask", "255.255.255.0"));
cmd.setStorageIpAddress((String)getConfiguredProperty("private.ip.address", "127.0.0.1")); cmd.setStorageIpAddress(getConfiguredProperty("private.ip.address", "127.0.0.1"));
cmd.setStorageMacAddress((String)getConfiguredProperty("private.mac.address", "8A:D2:54:3F:7C:C3")); cmd.setStorageMacAddress(getConfiguredProperty("private.mac.address", "8A:D2:54:3F:7C:C3"));
cmd.setStorageNetmask((String)getConfiguredProperty("private.ip.netmask", "255.255.255.0")); cmd.setStorageNetmask(getConfiguredProperty("private.ip.netmask", "255.255.255.0"));
cmd.setGatewayIpAddress((String)getConfiguredProperty("gateway.ip.address", "127.0.0.1")); cmd.setGatewayIpAddress(getConfiguredProperty("gateway.ip.address", "127.0.0.1"));
} }
@ -133,13 +133,13 @@ public class DummyResource implements ServerResource {
} }
protected StoragePoolInfo initializeLocalStorage() { protected StoragePoolInfo initializeLocalStorage() {
String hostIp = (String)getConfiguredProperty("private.ip.address", "127.0.0.1"); String hostIp = getConfiguredProperty("private.ip.address", "127.0.0.1");
String localStoragePath = (String)getConfiguredProperty("local.storage.path", "/mnt"); String localStoragePath = getConfiguredProperty("local.storage.path", "/mnt");
String lh = hostIp + localStoragePath; String lh = hostIp + localStoragePath;
String uuid = UUID.nameUUIDFromBytes(lh.getBytes()).toString(); String uuid = UUID.nameUUIDFromBytes(lh.getBytes()).toString();
String capacity = (String)getConfiguredProperty("local.storage.capacity", "1000000000"); String capacity = getConfiguredProperty("local.storage.capacity", "1000000000");
String available = (String)getConfiguredProperty("local.storage.avail", "10000000"); String available = getConfiguredProperty("local.storage.avail", "10000000");
return new StoragePoolInfo(uuid, hostIp, localStoragePath, localStoragePath, StoragePoolType.Filesystem, Long.parseLong(capacity), Long.parseLong(available)); return new StoragePoolInfo(uuid, hostIp, localStoragePath, localStoragePath, StoragePoolType.Filesystem, Long.parseLong(capacity), Long.parseLong(available));
@ -151,8 +151,9 @@ public class DummyResource implements ServerResource {
final List<Object> info = getHostInfo(); final List<Object> info = getHostInfo();
final StartupRoutingCommand cmd = new StartupRoutingCommand((Integer)info.get(0), (Long)info.get(1), (Long)info.get(2), (Long)info.get(4), (String)info.get(3), final StartupRoutingCommand cmd =
HypervisorType.KVM, RouterPrivateIpStrategy.HostLocal, changes, null); new StartupRoutingCommand((Integer)info.get(0), (Long)info.get(1), (Long)info.get(2), (Long)info.get(4), (String)info.get(3), HypervisorType.KVM,
RouterPrivateIpStrategy.HostLocal, changes, null);
fillNetworkInformation(cmd); fillNetworkInformation(cmd);
cmd.getHostDetails().putAll(getVersionStrings()); cmd.getHostDetails().putAll(getVersionStrings());
cmd.setCluster(getConfiguredProperty("cluster", "1")); cmd.setCluster(getConfiguredProperty("cluster", "1"));

View File

@ -23,7 +23,6 @@ import org.apache.cloudstack.api.InternalIdentity;
import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.FirewallRule.State; import com.cloud.network.rules.FirewallRule.State;
import com.cloud.network.rules.FirewallRule.TrafficType;
import com.cloud.utils.net.NetUtils; import com.cloud.utils.net.NetUtils;
/** /**
@ -60,8 +59,8 @@ public class FirewallRuleTO implements InternalIdentity {
protected FirewallRuleTO() { protected FirewallRuleTO() {
} }
public FirewallRuleTO(long id, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, boolean revoked, boolean alreadyAdded, FirewallRule.Purpose purpose, public FirewallRuleTO(long id, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, boolean revoked, boolean alreadyAdded,
List<String> sourceCidr, Integer icmpType, Integer icmpCode) { FirewallRule.Purpose purpose, List<String> sourceCidr, Integer icmpType, Integer icmpCode) {
this(id, null, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, purpose, sourceCidr, icmpType, icmpCode); this(id, null, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, purpose, sourceCidr, icmpType, icmpCode);
} }
@ -157,7 +156,8 @@ public class FirewallRuleTO implements InternalIdentity {
this.trafficType = trafficType; this.trafficType = trafficType;
} }
public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, FirewallRule.TrafficType trafficType, boolean defaultEgressPolicy) { public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, FirewallRule.TrafficType trafficType,
boolean defaultEgressPolicy) {
this(rule.getId(), this(rule.getId(),
srcVlanTag, srcVlanTag,
srcIp, srcIp,
@ -213,6 +213,7 @@ public class FirewallRuleTO implements InternalIdentity {
return trafficType; return trafficType;
} }
@Override
public long getId() { public long getId() {
return id; return id;
} }

View File

@ -31,8 +31,8 @@ import com.cloud.network.lb.LoadBalancingRule.LbAutoScaleVmProfile;
import com.cloud.network.lb.LoadBalancingRule.LbCondition; import com.cloud.network.lb.LoadBalancingRule.LbCondition;
import com.cloud.network.lb.LoadBalancingRule.LbDestination; import com.cloud.network.lb.LoadBalancingRule.LbDestination;
import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy; import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy;
import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
import com.cloud.network.lb.LoadBalancingRule.LbSslCert; import com.cloud.network.lb.LoadBalancingRule.LbSslCert;
import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
import com.cloud.utils.Pair; import com.cloud.utils.Pair;
public class LoadBalancerTO { public class LoadBalancerTO {
@ -83,7 +83,8 @@ public class LoadBalancerTO {
} }
public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline,
List<LbDestination> arg_destinations, List<LbStickinessPolicy> stickinessPolicies, List<LbHealthCheckPolicy> healthCheckPolicies, LbSslCert sslCert, String lbProtocol) { List<LbDestination> arg_destinations, List<LbStickinessPolicy> stickinessPolicies, List<LbHealthCheckPolicy> healthCheckPolicies, LbSslCert sslCert,
String lbProtocol) {
this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, inline, arg_destinations); this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, inline, arg_destinations);
this.stickinessPolicies = null; this.stickinessPolicies = null;
this.healthCheckPolicies = null; this.healthCheckPolicies = null;
@ -106,8 +107,9 @@ public class LoadBalancerTO {
this.healthCheckPolicies = new HealthCheckPolicyTO[MAX_HEALTHCHECK_POLICIES]; this.healthCheckPolicies = new HealthCheckPolicyTO[MAX_HEALTHCHECK_POLICIES];
int index = 0; int index = 0;
for (LbHealthCheckPolicy hcp : healthCheckPolicies) { for (LbHealthCheckPolicy hcp : healthCheckPolicies) {
this.healthCheckPolicies[0] = new HealthCheckPolicyTO(hcp.getpingpath(), hcp.getDescription(), hcp.getResponseTime(), hcp.getHealthcheckInterval(), this.healthCheckPolicies[0] =
hcp.getHealthcheckThresshold(), hcp.getUnhealthThresshold(), hcp.isRevoked()); new HealthCheckPolicyTO(hcp.getpingpath(), hcp.getDescription(), hcp.getResponseTime(), hcp.getHealthcheckInterval(), hcp.getHealthcheckThresshold(),
hcp.getUnhealthThresshold(), hcp.isRevoked());
index++; index++;
if (index == MAX_HEALTHCHECK_POLICIES) if (index == MAX_HEALTHCHECK_POLICIES)
break; break;
@ -215,7 +217,8 @@ public class LoadBalancerTO {
private int unhealthThresshold; private int unhealthThresshold;
private boolean revoke = false; private boolean revoke = false;
public HealthCheckPolicyTO(String pingPath, String description, int responseTime, int healthcheckInterval, int healthcheckThresshold, int unhealthThresshold, boolean revoke) { public HealthCheckPolicyTO(String pingPath, String description, int responseTime, int healthcheckInterval, int healthcheckThresshold, int unhealthThresshold,
boolean revoke) {
this.description = description; this.description = description;
this.pingPath = pingPath; this.pingPath = pingPath;
@ -411,8 +414,9 @@ public class LoadBalancerTO {
private final String vmName; private final String vmName;
private final String networkId; private final String networkId;
public AutoScaleVmProfileTO(String zoneId, String domainId, String cloudStackApiUrl, String autoScaleUserApiKey, String autoScaleUserSecretKey, String serviceOfferingId, public AutoScaleVmProfileTO(String zoneId, String domainId, String cloudStackApiUrl, String autoScaleUserApiKey, String autoScaleUserSecretKey,
String templateId, String vmName, String networkId, String otherDeployParams, List<Pair<String, String>> counterParamList, Integer destroyVmGraceperiod) { String serviceOfferingId, String templateId, String vmName, String networkId, String otherDeployParams, List<Pair<String, String>> counterParamList,
Integer destroyVmGraceperiod) {
this.zoneId = zoneId; this.zoneId = zoneId;
this.domainId = domainId; this.domainId = domainId;
this.serviceOfferingId = serviceOfferingId; this.serviceOfferingId = serviceOfferingId;
@ -487,8 +491,8 @@ public class LoadBalancerTO {
private final String state; private final String state;
private final String currentState; private final String currentState;
AutoScaleVmGroupTO(String uuid, int minMembers, int maxMembers, int memberPort, int interval, List<AutoScalePolicyTO> policies, AutoScaleVmProfileTO profile, String state, AutoScaleVmGroupTO(String uuid, int minMembers, int maxMembers, int memberPort, int interval, List<AutoScalePolicyTO> policies, AutoScaleVmProfileTO profile,
String currentState) { String state, String currentState) {
this.uuid = uuid; this.uuid = uuid;
this.minMembers = minMembers; this.minMembers = minMembers;
this.maxMembers = maxMembers; this.maxMembers = maxMembers;
@ -551,20 +555,21 @@ public class LoadBalancerTO {
conditionTOs.add(conditionTO); conditionTOs.add(conditionTO);
} }
AutoScalePolicy autoScalePolicy = lbAutoScalePolicy.getPolicy(); AutoScalePolicy autoScalePolicy = lbAutoScalePolicy.getPolicy();
autoScalePolicyTOs.add(new AutoScalePolicyTO(autoScalePolicy.getId(), autoScalePolicy.getDuration(), autoScalePolicy.getQuietTime(), autoScalePolicy.getAction(), autoScalePolicyTOs.add(new AutoScalePolicyTO(autoScalePolicy.getId(), autoScalePolicy.getDuration(), autoScalePolicy.getQuietTime(),
conditionTOs, lbAutoScalePolicy.isRevoked())); autoScalePolicy.getAction(), conditionTOs, lbAutoScalePolicy.isRevoked()));
} }
LbAutoScaleVmProfile lbAutoScaleVmProfile = lbAutoScaleVmGroup.getProfile(); LbAutoScaleVmProfile lbAutoScaleVmProfile = lbAutoScaleVmGroup.getProfile();
AutoScaleVmProfile autoScaleVmProfile = lbAutoScaleVmProfile.getProfile(); AutoScaleVmProfile autoScaleVmProfile = lbAutoScaleVmProfile.getProfile();
AutoScaleVmProfileTO autoScaleVmProfileTO = new AutoScaleVmProfileTO(lbAutoScaleVmProfile.getZoneId(), lbAutoScaleVmProfile.getDomainId(), lbAutoScaleVmProfile.getCsUrl(), AutoScaleVmProfileTO autoScaleVmProfileTO =
new AutoScaleVmProfileTO(lbAutoScaleVmProfile.getZoneId(), lbAutoScaleVmProfile.getDomainId(), lbAutoScaleVmProfile.getCsUrl(),
lbAutoScaleVmProfile.getAutoScaleUserApiKey(), lbAutoScaleVmProfile.getAutoScaleUserSecretKey(), lbAutoScaleVmProfile.getServiceOfferingId(), lbAutoScaleVmProfile.getAutoScaleUserApiKey(), lbAutoScaleVmProfile.getAutoScaleUserSecretKey(), lbAutoScaleVmProfile.getServiceOfferingId(),
lbAutoScaleVmProfile.getTemplateId(), lbAutoScaleVmProfile.getVmName(), lbAutoScaleVmProfile.getNetworkId(), autoScaleVmProfile.getOtherDeployParams(), lbAutoScaleVmProfile.getTemplateId(), lbAutoScaleVmProfile.getVmName(), lbAutoScaleVmProfile.getNetworkId(), autoScaleVmProfile.getOtherDeployParams(),
autoScaleVmProfile.getCounterParams(), autoScaleVmProfile.getDestroyVmGraceperiod()); autoScaleVmProfile.getCounterParams(), autoScaleVmProfile.getDestroyVmGraceperiod());
AutoScaleVmGroup autoScaleVmGroup = lbAutoScaleVmGroup.getVmGroup(); AutoScaleVmGroup autoScaleVmGroup = lbAutoScaleVmGroup.getVmGroup();
autoScaleVmGroupTO = new AutoScaleVmGroupTO(autoScaleVmGroup.getUuid(), autoScaleVmGroup.getMinMembers(), autoScaleVmGroup.getMaxMembers(), autoScaleVmGroupTO =
autoScaleVmGroup.getMemberPort(), autoScaleVmGroup.getInterval(), autoScalePolicyTOs, autoScaleVmProfileTO, autoScaleVmGroup.getState(), new AutoScaleVmGroupTO(autoScaleVmGroup.getUuid(), autoScaleVmGroup.getMinMembers(), autoScaleVmGroup.getMaxMembers(), autoScaleVmGroup.getMemberPort(),
lbAutoScaleVmGroup.getCurrentState()); autoScaleVmGroup.getInterval(), autoScalePolicyTOs, autoScaleVmProfileTO, autoScaleVmGroup.getState(), lbAutoScaleVmGroup.getCurrentState());
} }
} }

View File

@ -20,10 +20,10 @@ package com.cloud.agent.api.to;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.cloud.network.vpc.NetworkACLItem;
import com.cloud.network.vpc.NetworkACLItem.TrafficType;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
import com.cloud.network.vpc.NetworkACLItem;
import com.cloud.network.vpc.NetworkACLItem.TrafficType;
import com.cloud.utils.net.NetUtils; import com.cloud.utils.net.NetUtils;
public class NetworkACLTO implements InternalIdentity { public class NetworkACLTO implements InternalIdentity {
@ -95,6 +95,7 @@ public class NetworkACLTO implements InternalIdentity {
rule.getNumber()); rule.getNumber());
} }
@Override
public long getId() { public long getId() {
return id; return id;
} }

View File

@ -39,8 +39,8 @@ public class PortForwardingRuleTO extends FirewallRuleTO {
this.dstPortRange = new int[] {rule.getDestinationPortStart(), rule.getDestinationPortEnd()}; this.dstPortRange = new int[] {rule.getDestinationPortStart(), rule.getDestinationPortEnd()};
} }
public PortForwardingRuleTO(long id, String srcIp, int srcPortStart, int srcPortEnd, String dstIp, int dstPortStart, int dstPortEnd, String protocol, boolean revoked, public PortForwardingRuleTO(long id, String srcIp, int srcPortStart, int srcPortEnd, String dstIp, int dstPortStart, int dstPortEnd, String protocol,
boolean alreadyAdded) { boolean revoked, boolean alreadyAdded) {
super(id, null, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, FirewallRule.Purpose.PortForwarding, null, 0, 0); super(id, null, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, FirewallRule.Purpose.PortForwarding, null, 0, 0);
this.dstIp = dstIp; this.dstIp = dstIp;
this.dstPortRange = new int[] {dstPortStart, dstPortEnd}; this.dstPortRange = new int[] {dstPortStart, dstPortEnd};

View File

@ -47,8 +47,9 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
} }
public S3TO(final Long id, final String uuid, final String accessKey, final String secretKey, final String endPoint, final String bucketName, final Boolean httpsFlag, public S3TO(final Long id, final String uuid, final String accessKey, final String secretKey, final String endPoint, final String bucketName,
final Integer connectionTimeout, final Integer maxErrorRetry, final Integer socketTimeout, final Date created, final boolean enableRRS, final long maxUploadSize) { final Boolean httpsFlag, final Integer connectionTimeout, final Integer maxErrorRetry, final Integer socketTimeout, final Date created,
final boolean enableRRS, final long maxUploadSize) {
super(); super();
@ -158,6 +159,7 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
this.id = id; this.id = id;
} }
@Override
public String getUuid() { public String getUuid() {
return this.uuid; return this.uuid;
} }

View File

@ -42,6 +42,7 @@ public class SwiftTO implements DataStoreTO, SwiftUtil.SwiftClientCfg {
return id; return id;
} }
@Override
public String getUrl() { public String getUrl() {
return url; return url;
} }

View File

@ -35,6 +35,7 @@ public class TemplateTO implements InternalIdentity {
this.format = template.getFormat(); this.format = template.getFormat();
} }
@Override
public long getId() { public long getId() {
return id; return id;
} }

View File

@ -61,8 +61,8 @@ public class VirtualMachineTO {
DiskTO[] disks; DiskTO[] disks;
NicTO[] nics; NicTO[] nics;
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader, String os, public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader,
boolean enableHA, boolean limitCpuUse, String vncPassword) { String os, boolean enableHA, boolean limitCpuUse, String vncPassword) {
this.id = id; this.id = id;
this.name = instanceName; this.name = instanceName;
this.type = type; this.type = type;

View File

@ -92,6 +92,7 @@ public class VolumeTO implements InternalIdentity {
this.deviceId = id; this.deviceId = id;
} }
@Override
public long getId() { public long getId() {
return id; return id;
} }

View File

@ -18,8 +18,6 @@ package com.cloud.configuration;
import java.util.List; import java.util.List;
import javax.naming.NamingException;
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd; import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd; import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd;
import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd; import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;

View File

@ -21,6 +21,7 @@ import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface DedicatedResources extends InfrastructureEntity, InternalIdentity, Identity { public interface DedicatedResources extends InfrastructureEntity, InternalIdentity, Identity {
@Override
long getId(); long getId();
Long getDataCenterId(); Long getDataCenterId();
@ -35,6 +36,7 @@ public interface DedicatedResources extends InfrastructureEntity, InternalIdenti
Long getAccountId(); Long getAccountId();
@Override
String getUuid(); String getUuid();
long getAffinityGroupId(); long getAffinityGroupId();

View File

@ -18,9 +18,10 @@ package com.cloud.deploy;
import java.util.List; import java.util.List;
import org.apache.cloudstack.framework.config.ConfigKey;
import com.cloud.exception.InsufficientServerCapacityException; import com.cloud.exception.InsufficientServerCapacityException;
import com.cloud.vm.VirtualMachineProfile; import com.cloud.vm.VirtualMachineProfile;
import org.apache.cloudstack.framework.config.ConfigKey;
/** /**
*/ */
@ -29,14 +30,16 @@ public interface DeploymentClusterPlanner extends DeploymentPlanner {
static final String ClusterCPUCapacityDisableThresholdCK = "cluster.cpu.allocated.capacity.disablethreshold"; static final String ClusterCPUCapacityDisableThresholdCK = "cluster.cpu.allocated.capacity.disablethreshold";
static final String ClusterMemoryCapacityDisableThresholdCK = "cluster.memory.allocated.capacity.disablethreshold"; static final String ClusterMemoryCapacityDisableThresholdCK = "cluster.memory.allocated.capacity.disablethreshold";
static final ConfigKey<Float> ClusterCPUCapacityDisableThreshold = new ConfigKey<Float>( static final ConfigKey<Float> ClusterCPUCapacityDisableThreshold =
new ConfigKey<Float>(
Float.class, Float.class,
ClusterCPUCapacityDisableThresholdCK, ClusterCPUCapacityDisableThresholdCK,
"Alert", "Alert",
"0.85", "0.85",
"Percentage (as a value between 0 and 1) of cpu utilization above which allocators will disable using the cluster for low cpu available. Keep the corresponding notification threshold lower than this to be notified beforehand.", "Percentage (as a value between 0 and 1) of cpu utilization above which allocators will disable using the cluster for low cpu available. Keep the corresponding notification threshold lower than this to be notified beforehand.",
true, ConfigKey.Scope.Cluster, null); true, ConfigKey.Scope.Cluster, null);
static final ConfigKey<Float> ClusterMemoryCapacityDisableThreshold = new ConfigKey<Float>( static final ConfigKey<Float> ClusterMemoryCapacityDisableThreshold =
new ConfigKey<Float>(
Float.class, Float.class,
ClusterMemoryCapacityDisableThresholdCK, ClusterMemoryCapacityDisableThresholdCK,
"Alert", "Alert",

View File

@ -60,6 +60,7 @@ public interface Domain extends OwnedBy, Identity, InternalIdentity {
String getNetworkDomain(); String getNetworkDomain();
@Override
public String getUuid(); public String getUuid();
} }

View File

@ -18,8 +18,9 @@
*/ */
package com.cloud.event; package com.cloud.event;
import static java.lang.annotation.ElementType.*; import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.*; import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;

View File

@ -16,10 +16,10 @@
// under the License. // under the License.
package com.cloud.event; package com.cloud.event;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date; import java.util.Date;
import org.apache.cloudstack.api.InternalIdentity;
public interface UsageEvent extends InternalIdentity { public interface UsageEvent extends InternalIdentity {
String getType(); String getType();

View File

@ -16,8 +16,6 @@
// under the License. // under the License.
package com.cloud.exception; package com.cloud.exception;
import com.cloud.exception.CloudException;
public class AgentControlChannelException extends CloudException { public class AgentControlChannelException extends CloudException {
private static final long serialVersionUID = -310647782960500466L; private static final long serialVersionUID = -310647782960500466L;

View File

@ -30,23 +30,10 @@ import com.cloud.utils.fsm.StateObject;
*/ */
public interface Host extends StateObject<Status>, Identity, InternalIdentity { public interface Host extends StateObject<Status>, Identity, InternalIdentity {
public enum Type { public enum Type {
Storage(false), Storage(false), Routing(false), SecondaryStorage(false), SecondaryStorageCmdExecutor(false), ConsoleProxy(true), ExternalFirewall(false), ExternalLoadBalancer(
Routing(false), false), ExternalVirtualSwitchSupervisor(false), PxeServer(false), BaremetalPxe(false), BaremetalDhcp(false), TrafficMonitor(false),
SecondaryStorage(false),
SecondaryStorageCmdExecutor(false),
ConsoleProxy(true),
ExternalFirewall(false),
ExternalLoadBalancer(false),
ExternalVirtualSwitchSupervisor(false),
PxeServer(false),
BaremetalPxe(false),
BaremetalDhcp(false),
TrafficMonitor(false),
ExternalDhcp(false), ExternalDhcp(false), SecondaryStorageVM(true), LocalSecondaryStorage(false), L2Networking(false);
SecondaryStorageVM(true),
LocalSecondaryStorage(false),
L2Networking(false);
boolean _virtual; boolean _virtual;
private Type(boolean virtual) { private Type(boolean virtual) {

View File

@ -23,10 +23,15 @@ import com.cloud.utils.fsm.NoTransitionException;
import com.cloud.utils.fsm.StateMachine2; import com.cloud.utils.fsm.StateMachine2;
public enum Status { public enum Status {
Creating(true, false, false), Connecting(true, false, false), Up(true, false, false), Down(true, true, true), Disconnected(true, true, true), Alert(true, true, true), Removed( Creating(true, false, false),
true, Connecting(true, false, false),
false, Up(true, false, false),
true), Error(true, false, true), Rebalancing(true, false, true); Down(true, true, true),
Disconnected(true, true, true),
Alert(true, true, true),
Removed(true, false, true),
Error(true, false, true),
Rebalancing(true, false, true);
private final boolean updateManagementServer; private final boolean updateManagementServer;
private final boolean checkManagementServer; private final boolean checkManagementServer;

View File

@ -21,6 +21,7 @@ import org.apache.cloudstack.api.InternalIdentity;
public interface GuestVlan extends InternalIdentity, Identity { public interface GuestVlan extends InternalIdentity, Identity {
@Override
public long getId(); public long getId();
public long getAccountId(); public long getAccountId();

View File

@ -32,6 +32,7 @@ public interface MonitoringService extends ControlledEntity, Identity, InternalI
Dhcp, LoadBalancing, Ssh, Webserver, Dhcp, LoadBalancing, Ssh, Webserver,
} }
@Override
long getId(); long getId();
String getService(); String getService();

View File

@ -19,7 +19,6 @@ package com.cloud.network;
import com.cloud.deploy.DeployDestination; import com.cloud.deploy.DeployDestination;
import com.cloud.vm.NicProfile; import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext; import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile; import com.cloud.vm.VirtualMachineProfile;
/** /**

View File

@ -32,7 +32,6 @@ import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException; import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.GuestVlan;
import com.cloud.network.Network.Service; import com.cloud.network.Network.Service;
import com.cloud.network.Networks.TrafficType; import com.cloud.network.Networks.TrafficType;
import com.cloud.offering.NetworkOffering; import com.cloud.offering.NetworkOffering;
@ -51,12 +50,13 @@ public interface NetworkService {
List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner); List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner);
IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException; IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException, InsufficientAddressCapacityException,
ConcurrentOperationException;
boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException; boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;
IpAddress allocatePortableIP(Account ipOwner, int regionId, Long zoneId, Long networkId, Long vpcId) throws ResourceAllocationException, InsufficientAddressCapacityException, IpAddress allocatePortableIP(Account ipOwner, int regionId, Long zoneId, Long networkId, Long vpcId) throws ResourceAllocationException,
ConcurrentOperationException; InsufficientAddressCapacityException, ConcurrentOperationException;
boolean releasePortableIpAddress(long ipAddressId); boolean releasePortableIpAddress(long ipAddressId);
@ -90,9 +90,11 @@ public interface NetworkService {
List<? extends Service> listNetworkServices(String providerName); List<? extends Service> listNetworkServices(String providerName);
PhysicalNetworkServiceProvider addProviderToPhysicalNetwork(Long physicalNetworkId, String providerName, Long destinationPhysicalNetworkId, List<String> enabledServices); PhysicalNetworkServiceProvider addProviderToPhysicalNetwork(Long physicalNetworkId, String providerName, Long destinationPhysicalNetworkId,
List<String> enabledServices);
Pair<List<? extends PhysicalNetworkServiceProvider>, Integer> listNetworkServiceProviders(Long physicalNetworkId, String name, String state, Long startIndex, Long pageSize); Pair<List<? extends PhysicalNetworkServiceProvider>, Integer> listNetworkServiceProviders(Long physicalNetworkId, String name, String state, Long startIndex,
Long pageSize);
PhysicalNetworkServiceProvider updateNetworkServiceProvider(Long id, String state, List<String> enabledServices); PhysicalNetworkServiceProvider updateNetworkServiceProvider(Long id, String state, List<String> enabledServices);
@ -161,8 +163,9 @@ public interface NetworkService {
* @throws ConcurrentOperationException * @throws ConcurrentOperationException
* @throws ResourceAllocationException * @throws ResourceAllocationException
*/ */
Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String broadcastUri, String startIp, String endIP, String gateway, String netmask, Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String broadcastUri, String startIp, String endIP, String gateway,
long networkOwnerId, Long vpcId, Boolean sourceNat, Long networkOfferingId) throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException; String netmask, long networkOwnerId, Long vpcId, Boolean sourceNat, Long networkOfferingId) throws ResourceAllocationException, ConcurrentOperationException,
InsufficientCapacityException;
/* Requests an IP address for the guest nic */ /* Requests an IP address for the guest nic */
NicSecondaryIp allocateSecondaryGuestIP(Account account, long zoneId, Long nicId, Long networkId, String ipaddress) throws InsufficientAddressCapacityException; NicSecondaryIp allocateSecondaryGuestIP(Account account, long zoneId, Long nicId, Long networkId, String ipaddress) throws InsufficientAddressCapacityException;

View File

@ -18,12 +18,11 @@ package com.cloud.network;
import java.util.List; import java.util.List;
import com.cloud.host.Host;
import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd; import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd;
import org.apache.cloudstack.api.command.admin.usage.DeleteTrafficMonitorCmd; import org.apache.cloudstack.api.command.admin.usage.DeleteTrafficMonitorCmd;
import org.apache.cloudstack.api.command.admin.usage.ListTrafficMonitorsCmd; import org.apache.cloudstack.api.command.admin.usage.ListTrafficMonitorsCmd;
import org.apache.cloudstack.api.response.TrafficMonitorResponse;
import com.cloud.host.Host;
import com.cloud.utils.component.Manager; import com.cloud.utils.component.Manager;
public interface NetworkUsageService extends Manager { public interface NetworkUsageService extends Manager {

View File

@ -18,10 +18,11 @@ package com.cloud.network;
import java.util.List; import java.util.List;
import com.cloud.utils.Pair;
import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
import com.cloud.utils.Pair;
/** /**
* *
*/ */

View File

@ -31,6 +31,7 @@ public interface PhysicalNetworkServiceProvider extends InternalIdentity {
Disabled, Enabled, Shutdown; Disabled, Enabled, Shutdown;
} }
@Override
long getId(); long getId();
State getState(); State getState();

View File

@ -26,6 +26,7 @@ public interface Site2SiteVpnConnection extends ControlledEntity, InternalIdenti
Pending, Connected, Disconnected, Error, Pending, Connected, Disconnected, Error,
} }
@Override
public long getId(); public long getId();
public String getUuid(); public String getUuid();

View File

@ -16,16 +16,16 @@
// under the License. // under the License.
package com.cloud.network; package com.cloud.network;
import java.util.List;
import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd; import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd;
import org.apache.cloudstack.api.command.admin.router.UpgradeRouterTemplateCmd;
import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException; import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.router.VirtualRouter; import com.cloud.network.router.VirtualRouter;
import com.cloud.user.Account; import com.cloud.user.Account;
import org.apache.cloudstack.api.command.admin.router.UpgradeRouterTemplateCmd;
import java.util.List;
public interface VirtualNetworkApplianceService { public interface VirtualNetworkApplianceService {
/** /**

View File

@ -22,6 +22,7 @@ import org.apache.cloudstack.api.InternalIdentity;
public interface AutoScalePolicy extends ControlledEntity, InternalIdentity { public interface AutoScalePolicy extends ControlledEntity, InternalIdentity {
@Override
long getId(); long getId();
String getUuid(); String getUuid();

View File

@ -27,6 +27,7 @@ public interface AutoScaleVmGroup extends ControlledEntity, InternalIdentity {
String State_Enabled = "enabled"; String State_Enabled = "enabled";
String State_Disabled = "disabled"; String State_Disabled = "disabled";
@Override
long getId(); long getId();
@Override @Override

View File

@ -29,6 +29,7 @@ import com.cloud.utils.Pair;
*/ */
public interface AutoScaleVmProfile extends ControlledEntity, InternalIdentity { public interface AutoScaleVmProfile extends ControlledEntity, InternalIdentity {
@Override
public long getId(); public long getId();
public String getUuid(); public String getUuid();

View File

@ -23,12 +23,11 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network; import com.cloud.network.Network;
import com.cloud.vm.NicProfile; import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext; import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile; import com.cloud.vm.VirtualMachineProfile;
public interface DhcpServiceProvider extends NetworkElement { public interface DhcpServiceProvider extends NetworkElement {
boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, boolean addDhcpEntry(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
InsufficientCapacityException, ResourceUnavailableException; throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException;
boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) boolean configDhcpSupportForSubnet(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException; throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException;

View File

@ -20,7 +20,6 @@ import java.util.List;
import com.cloud.exception.ResourceUnavailableException; import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network; import com.cloud.network.Network;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.vpc.NetworkACLItem; import com.cloud.network.vpc.NetworkACLItem;
public interface NetworkACLServiceProvider extends NetworkElement { public interface NetworkACLServiceProvider extends NetworkElement {

View File

@ -33,7 +33,6 @@ import com.cloud.offering.NetworkOffering;
import com.cloud.utils.component.Adapter; import com.cloud.utils.component.Adapter;
import com.cloud.vm.NicProfile; import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext; import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile; import com.cloud.vm.VirtualMachineProfile;
/** /**
@ -84,7 +83,8 @@ public interface NetworkElement extends Adapter {
* @throws ConcurrentOperationException * @throws ConcurrentOperationException
* @throws ResourceUnavailableException * @throws ResourceUnavailableException
*/ */
boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException; boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException,
ResourceUnavailableException;
/** /**
* The network is being shutdown. * The network is being shutdown.
@ -121,7 +121,8 @@ public interface NetworkElement extends Adapter {
* @throws ConcurrentOperationException * @throws ConcurrentOperationException
* @throws ResourceUnavailableException * @throws ResourceUnavailableException
*/ */
boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException; boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context) throws ConcurrentOperationException,
ResourceUnavailableException;
/** /**
* This should return true if out of multiple services provided by this element, only some can be enabled. If all the services MUST be provided, this should return false. * This should return true if out of multiple services provided by this element, only some can be enabled. If all the services MUST be provided, this should return false.

View File

@ -23,7 +23,6 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network; import com.cloud.network.Network;
import com.cloud.vm.NicProfile; import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext; import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile; import com.cloud.vm.VirtualMachineProfile;
public interface UserDataServiceProvider extends NetworkElement { public interface UserDataServiceProvider extends NetworkElement {

View File

@ -108,7 +108,8 @@ public interface NetworkGuru extends Adapter {
* environment. At this time, the admin generally must be involved to * environment. At this time, the admin generally must be involved to
* allocate more resources before any more guest network can be implemented. * allocate more resources before any more guest network can be implemented.
*/ */
Network implement(Network network, NetworkOffering offering, DeployDestination destination, ReservationContext context) throws InsufficientVirtualNetworkCapcityException; Network implement(Network network, NetworkOffering offering, DeployDestination destination, ReservationContext context)
throws InsufficientVirtualNetworkCapcityException;
/** /**
* Once a guest network has been designed, virtual machines can be * Once a guest network has been designed, virtual machines can be
@ -126,8 +127,8 @@ public interface NetworkGuru extends Adapter {
* @throws InsufficientAddressCapacityException if there are not addresses * @throws InsufficientAddressCapacityException if there are not addresses
* to be assigned. * to be assigned.
*/ */
NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapcityException,
ConcurrentOperationException; InsufficientAddressCapacityException, ConcurrentOperationException;
/** /**
* Once a guest network is implemented, then the virtual machine must * Once a guest network is implemented, then the virtual machine must
@ -147,8 +148,8 @@ public interface NetworkGuru extends Adapter {
* @throws ConcurrentOperationException if there are multiple operations * @throws ConcurrentOperationException if there are multiple operations
* happening on this guest network or vm. * happening on this guest network or vm.
*/ */
void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
InsufficientAddressCapacityException, ConcurrentOperationException; throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException;
/** /**
* When a virtual machine is stopped, the NetworkGuru is informed via the * When a virtual machine is stopped, the NetworkGuru is informed via the

View File

@ -16,13 +16,13 @@
// under the License. // under the License.
package com.cloud.network.lb; package com.cloud.network.lb;
import java.util.List;
import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd; import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd;
import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd;
import org.apache.cloudstack.api.response.SslCertResponse; import org.apache.cloudstack.api.response.SslCertResponse;
import java.util.List;
public interface CertService { public interface CertService {
public SslCertResponse uploadSslCert(UploadSslCertCmd certCmd); public SslCertResponse uploadSslCert(UploadSslCertCmd certCmd);

View File

@ -39,8 +39,8 @@ public class LoadBalancingRule {
private LbSslCert sslCert; private LbSslCert sslCert;
private String lbProtocol; private String lbProtocol;
public LoadBalancingRule(LoadBalancer lb, List<LbDestination> destinations, List<LbStickinessPolicy> stickinessPolicies, List<LbHealthCheckPolicy> healthCheckPolicies, public LoadBalancingRule(LoadBalancer lb, List<LbDestination> destinations, List<LbStickinessPolicy> stickinessPolicies,
Ip sourceIp) { List<LbHealthCheckPolicy> healthCheckPolicies, Ip sourceIp) {
this.lb = lb; this.lb = lb;
this.destinations = destinations; this.destinations = destinations;
this.stickinessPolicies = stickinessPolicies; this.stickinessPolicies = stickinessPolicies;
@ -48,8 +48,8 @@ public class LoadBalancingRule {
this.sourceIp = sourceIp; this.sourceIp = sourceIp;
} }
public LoadBalancingRule(LoadBalancer lb, List<LbDestination> destinations, List<LbStickinessPolicy> stickinessPolicies, List<LbHealthCheckPolicy> healthCheckPolicies, public LoadBalancingRule(LoadBalancer lb, List<LbDestination> destinations, List<LbStickinessPolicy> stickinessPolicies,
Ip sourceIp, LbSslCert sslCert, String lbProtocol) { List<LbHealthCheckPolicy> healthCheckPolicies, Ip sourceIp, LbSslCert sslCert, String lbProtocol) {
this.lb = lb; this.lb = lb;
this.destinations = destinations; this.destinations = destinations;
this.stickinessPolicies = stickinessPolicies; this.stickinessPolicies = stickinessPolicies;
@ -196,7 +196,8 @@ public class LoadBalancingRule {
this(pingpath, description, responseTime, healthcheckInterval, healthcheckThresshold, unhealthThresshold, false); this(pingpath, description, responseTime, healthcheckInterval, healthcheckThresshold, unhealthThresshold, false);
} }
public LbHealthCheckPolicy(String pingpath, String description, int responseTime, int healthcheckInterval, int healthcheckThresshold, int unhealthThresshold, boolean revoke) { public LbHealthCheckPolicy(String pingpath, String description, int responseTime, int healthcheckInterval, int healthcheckThresshold, int unhealthThresshold,
boolean revoke) {
this.pingpath = pingpath; this.pingpath = pingpath;
this.description = description; this.description = description;
this.responseTime = responseTime; this.responseTime = responseTime;

View File

@ -49,8 +49,8 @@ public interface LoadBalancingRulesService {
* @return the newly created LoadBalancerVO if successful, null otherwise * @return the newly created LoadBalancerVO if successful, null otherwise
* @throws InsufficientAddressCapacityException * @throws InsufficientAddressCapacityException
*/ */
LoadBalancer createPublicLoadBalancerRule(String xId, String name, String description, int srcPortStart, int srcPortEnd, int defPortStart, int defPortEnd, Long ipAddrId, LoadBalancer createPublicLoadBalancerRule(String xId, String name, String description, int srcPortStart, int srcPortEnd, int defPortStart, int defPortEnd,
String protocol, String algorithm, long networkId, long lbOwnerId, boolean openFirewall, String lbProtocol) throws NetworkRuleConflictException, Long ipAddrId, String protocol, String algorithm, long networkId, long lbOwnerId, boolean openFirewall, String lbProtocol) throws NetworkRuleConflictException,
InsufficientAddressCapacityException; InsufficientAddressCapacityException;
LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd); LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd);

View File

@ -16,9 +16,6 @@
// under the License. // under the License.
package com.cloud.network.rules; package com.cloud.network.rules;
import java.util.List;
import com.cloud.utils.Pair;
import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;

View File

@ -28,8 +28,8 @@ import com.cloud.utils.Pair;
import com.cloud.utils.net.Ip; import com.cloud.utils.net.Ip;
public interface RulesService { public interface RulesService {
Pair<List<? extends FirewallRule>, Integer> searchStaticNatRules(Long ipId, Long id, Long vmId, Long start, Long size, String accountName, Long domainId, Long projectId, Pair<List<? extends FirewallRule>, Integer> searchStaticNatRules(Long ipId, Long id, Long vmId, Long start, Long size, String accountName, Long domainId,
boolean isRecursive, boolean listAll); Long projectId, boolean isRecursive, boolean listAll);
/** /**
* Creates a port forwarding rule between two ip addresses or between * Creates a port forwarding rule between two ip addresses or between

View File

@ -24,7 +24,6 @@ import org.apache.cloudstack.api.command.user.securitygroup.CreateSecurityGroupC
import org.apache.cloudstack.api.command.user.securitygroup.DeleteSecurityGroupCmd; import org.apache.cloudstack.api.command.user.securitygroup.DeleteSecurityGroupCmd;
import org.apache.cloudstack.api.command.user.securitygroup.RevokeSecurityGroupEgressCmd; import org.apache.cloudstack.api.command.user.securitygroup.RevokeSecurityGroupEgressCmd;
import org.apache.cloudstack.api.command.user.securitygroup.RevokeSecurityGroupIngressCmd; import org.apache.cloudstack.api.command.user.securitygroup.RevokeSecurityGroupIngressCmd;
import org.apache.cloudstack.api.command.user.vm.AddIpToVmNicCmd;
import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException; import com.cloud.exception.PermissionDeniedException;

View File

@ -17,7 +17,6 @@
package com.cloud.network.vpc; package com.cloud.network.vpc;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
public interface NetworkACL extends InternalIdentity { public interface NetworkACL extends InternalIdentity {
@ -30,6 +29,7 @@ public interface NetworkACL extends InternalIdentity {
Long getVpcId(); Long getVpcId();
@Override
long getId(); long getId();
String getName(); String getName();

View File

@ -16,12 +16,10 @@
// under the License. // under the License.
package com.cloud.network.vpc; package com.cloud.network.vpc;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import java.util.List; import java.util.List;
import org.apache.cloudstack.api.InternalIdentity;
public interface NetworkACLItem extends InternalIdentity { public interface NetworkACLItem extends InternalIdentity {
String getUuid(); String getUuid();

View File

@ -16,12 +16,13 @@
// under the License. // under the License.
package com.cloud.network.vpc; package com.cloud.network.vpc;
import com.cloud.exception.ResourceUnavailableException; import java.util.List;
import com.cloud.utils.Pair;
import org.apache.cloudstack.api.command.user.network.CreateNetworkACLCmd; import org.apache.cloudstack.api.command.user.network.CreateNetworkACLCmd;
import org.apache.cloudstack.api.command.user.network.ListNetworkACLsCmd; import org.apache.cloudstack.api.command.user.network.ListNetworkACLsCmd;
import java.util.List; import com.cloud.exception.ResourceUnavailableException;
import com.cloud.utils.Pair;
public interface NetworkACLService { public interface NetworkACLService {
/** /**

View File

@ -23,10 +23,11 @@ public interface VpcProvisioningService {
public VpcOffering getVpcOffering(long vpcOfferingId); public VpcOffering getVpcOffering(long vpcOfferingId);
public VpcOffering createVpcOffering(String name, String displayText, List<String> supportedServices, Map<String, List<String>> serviceProviders, Long serviceOfferingId); public VpcOffering createVpcOffering(String name, String displayText, List<String> supportedServices, Map<String, List<String>> serviceProviders,
Long serviceOfferingId);
List<? extends VpcOffering> listVpcOfferings(Long id, String name, String displayText, List<String> supportedServicesStr, Boolean isDefault, String keyword, String state, List<? extends VpcOffering> listVpcOfferings(Long id, String name, String displayText, List<String> supportedServicesStr, Boolean isDefault, String keyword,
Long startIndex, Long pageSizeVal); String state, Long startIndex, Long pageSizeVal);
/** /**
* @param offId * @param offId

View File

@ -46,7 +46,8 @@ public interface VpcService {
* @return * @return
* @throws ResourceAllocationException TODO * @throws ResourceAllocationException TODO
*/ */
public Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName, String displayText, String cidr, String networkDomain) throws ResourceAllocationException; public Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName, String displayText, String cidr, String networkDomain)
throws ResourceAllocationException;
/** /**
* Deletes a VPC * Deletes a VPC

View File

@ -34,8 +34,10 @@ public interface Project extends PartOf, Identity, InternalIdentity {
String getDisplayText(); String getDisplayText();
@Override
long getDomainId(); long getDomainId();
@Override
long getId(); long getId();
Date getCreated(); Date getCreated();

View File

@ -75,6 +75,7 @@ public interface GlobalLoadBalancerRule extends Identity, InternalIdentity, Cont
public int getRegion(); public int getRegion();
@Override
public long getAccountId(); public long getAccountId();
public State getState(); public State getState();

View File

@ -17,11 +17,17 @@
package com.cloud.region.ha; package com.cloud.region.ha;
import com.cloud.network.rules.LoadBalancer;
import org.apache.cloudstack.api.command.user.region.ha.gslb.*;
import java.util.List; import java.util.List;
import org.apache.cloudstack.api.command.user.region.ha.gslb.AssignToGlobalLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.region.ha.gslb.CreateGlobalLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.region.ha.gslb.DeleteGlobalLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.region.ha.gslb.ListGlobalLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.region.ha.gslb.RemoveFromGlobalLoadBalancerRuleCmd;
import org.apache.cloudstack.api.command.user.region.ha.gslb.UpdateGlobalLoadBalancerRuleCmd;
import com.cloud.network.rules.LoadBalancer;
public interface GlobalLoadBalancingRulesService { public interface GlobalLoadBalancingRulesService {
/* /*

View File

@ -25,9 +25,16 @@ public enum ResourceState {
Creating, Enabled, Disabled, PrepareForMaintenance, ErrorInMaintenance, Maintenance, Error; Creating, Enabled, Disabled, PrepareForMaintenance, ErrorInMaintenance, Maintenance, Error;
public enum Event { public enum Event {
InternalCreated("Resource is created"), Enable("Admin enables"), Disable("Admin disables"), AdminAskMaintenace("Admin asks to enter maintenance"), AdminCancelMaintenance( InternalCreated("Resource is created"),
"Admin asks to cancel maintenance"), InternalEnterMaintenance("Resource enters maintenance"), UpdatePassword("Admin updates password of host"), UnableToMigrate( Enable("Admin enables"),
"Management server migrates VM failed"), Error("An internal error happened"), DeleteHost("Admin delete a host"), Disable("Admin disables"),
AdminAskMaintenace("Admin asks to enter maintenance"),
AdminCancelMaintenance("Admin asks to cancel maintenance"),
InternalEnterMaintenance("Resource enters maintenance"),
UpdatePassword("Admin updates password of host"),
UnableToMigrate("Management server migrates VM failed"),
Error("An internal error happened"),
DeleteHost("Admin delete a host"),
/* /*
* Below events don't cause resource state to change, they are merely * Below events don't cause resource state to change, they are merely

View File

@ -16,8 +16,8 @@
// under the License. // under the License.
package com.cloud.resource; package com.cloud.resource;
import com.cloud.utils.SerialVersionUID;
import com.cloud.exception.CloudException; import com.cloud.exception.CloudException;
import com.cloud.utils.SerialVersionUID;
public class UnableDeleteHostException extends CloudException { public class UnableDeleteHostException extends CloudException {
private static final long serialVersionUID = SerialVersionUID.UnableDeleteHostException; private static final long serialVersionUID = SerialVersionUID.UnableDeleteHostException;

View File

@ -349,7 +349,8 @@ public interface ManagementService {
String[] listEventTypes(); String[] listEventTypes();
Pair<List<? extends HypervisorCapabilities>, Integer> listHypervisorCapabilities(Long id, HypervisorType hypervisorType, String keyword, Long startIndex, Long pageSizeVal); Pair<List<? extends HypervisorCapabilities>, Integer> listHypervisorCapabilities(Long id, HypervisorType hypervisorType, String keyword, Long startIndex,
Long pageSizeVal);
HypervisorCapabilities updateHypervisorCapabilities(Long id, Long maxGuestsLimit, Boolean securityGroupEnabled); HypervisorCapabilities updateHypervisorCapabilities(Long id, Long maxGuestsLimit, Boolean securityGroupEnabled);

View File

@ -24,27 +24,13 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
//FIXME - extract enum to another interface as its used both by resourceTags and resourceMetaData code //FIXME - extract enum to another interface as its used both by resourceTags and resourceMetaData code
public enum ResourceObjectType { public enum ResourceObjectType {
UserVm(true, true), UserVm(true, true), Template(true, true), ISO(true, false), Volume(true, true), Snapshot(true, false), Network(true, true), Nic(false, true), LoadBalancer(
Template(true, true), true,
ISO(true, false), true), PortForwardingRule(true, true), FirewallRule(true, true), SecurityGroup(true, false), PublicIpAddress(true, true), Project(true, false), Vpc(
Volume(true, true), true,
Snapshot(true, false), false), NetworkACL(true, false), StaticRoute(true, false), VMSnapshot(true, false), RemoteAccessVpn(true, true), Zone(false, true), ServiceOffering(
Network(true, true), false,
Nic(false, true), true), Storage(false, true);
LoadBalancer(true, true),
PortForwardingRule(true, true),
FirewallRule(true, true),
SecurityGroup(true, false),
PublicIpAddress(true, true),
Project(true, false),
Vpc(true, false),
NetworkACL(true, false),
StaticRoute(true, false),
VMSnapshot(true, false),
RemoteAccessVpn(true, true),
Zone(false, true),
ServiceOffering(false, true),
Storage(false, true);
ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) { ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) {
this.resourceTagsSupport = resourceTagsSupport; this.resourceTagsSupport = resourceTagsSupport;

View File

@ -53,6 +53,7 @@ public interface Snapshot extends ControlledEntity, Identity, InternalIdentity,
//it's a state, user can't see the snapshot from ui, while the snapshot may still exist on the storage //it's a state, user can't see the snapshot from ui, while the snapshot may still exist on the storage
Error; Error;
@Override
public String toString() { public String toString() {
return this.name(); return this.name();
} }
@ -68,6 +69,7 @@ public interface Snapshot extends ControlledEntity, Identity, InternalIdentity,
public static final long MANUAL_POLICY_ID = 0L; public static final long MANUAL_POLICY_ID = 0L;
@Override
long getAccountId(); long getAccountId();
long getVolumeId(); long getVolumeId();
@ -78,6 +80,7 @@ public interface Snapshot extends ControlledEntity, Identity, InternalIdentity,
Type getRecurringType(); Type getRecurringType();
@Override
State getState(); State getState();
HypervisorType getHypervisorType(); HypervisorType getHypervisorType();

View File

@ -21,11 +21,14 @@ import java.util.List;
public class Storage { public class Storage {
public static enum ImageFormat { public static enum ImageFormat {
QCOW2(true, true, false, "qcow2"), RAW(false, false, false, "raw"), VHD(true, true, true, "vhd"), ISO(false, false, false, "iso"), OVA(true, true, true, "ova"), VHDX( QCOW2(true, true, false, "qcow2"),
true, RAW(false, false, false, "raw"),
true, VHD(true, true, true, "vhd"),
true, ISO(false, false, false, "iso"),
"vhdx"), BAREMETAL(false, false, false, "BAREMETAL"), TAR(false, false, false, "tar"); OVA(true, true, true, "ova"),
VHDX(true, true, true, "vhdx"),
BAREMETAL(false, false, false, "BAREMETAL"),
TAR(false, false, false, "tar");
private final boolean thinProvisioned; private final boolean thinProvisioned;
private final boolean supportSparse; private final boolean supportSparse;

View File

@ -29,5 +29,6 @@ public interface StoragePoolDiscoverer extends Adapter {
Map<? extends StoragePool, Map<String, String>> find(long dcId, Long podId, URI uri, Map<String, String> details) throws DiscoveryException; Map<? extends StoragePool, Map<String, String>> find(long dcId, Long podId, URI uri, Map<String, String> details) throws DiscoveryException;
Map<? extends StoragePool, Map<String, String>> find(long dcId, Long podId, URI uri, Map<String, String> details, String username, String password) throws DiscoveryException; Map<? extends StoragePool, Map<String, String>> find(long dcId, Long podId, URI uri, Map<String, String> details, String username, String password)
throws DiscoveryException;
} }

View File

@ -154,6 +154,7 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
Long getPoolId(); Long getPoolId();
@Override
State getState(); State getState();
Date getAttached(); Date getAttached();

View File

@ -20,8 +20,13 @@ package com.cloud.storage;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import com.cloud.exception.StorageUnavailableException; import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.*; import org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.ExtractVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.MigrateVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.ResizeVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.UploadVolumeCmd;
import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InternalErrorException; import com.cloud.exception.InternalErrorException;

View File

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

View File

@ -56,6 +56,7 @@ public interface Account extends ControlledEntity, InternalIdentity, Identity {
public Long getDefaultZoneId(); public Long getDefaultZoneId();
@Override
public String getUuid(); public String getUuid();
boolean isDefault(); boolean isDefault();

View File

@ -54,8 +54,8 @@ public interface AccountService {
* *
* @return the user if created successfully, null otherwise * @return the user if created successfully, null otherwise
*/ */
UserAccount createUserAccount(String userName, String password, String firstName, String lastName, String email, String timezone, String accountName, short accountType, UserAccount createUserAccount(String userName, String password, String firstName, String lastName, String email, String timezone, String accountName,
Long domainId, String networkDomain, Map<String, String> details, String accountUUID, String userUUID); short accountType, Long domainId, String networkDomain, Map<String, String> details, String accountUUID, String userUUID);
/** /**
* Locks a user by userId. A locked user cannot access the API, but will still have running VMs/IP addresses * Locks a user by userId. A locked user cannot access the API, but will still have running VMs/IP addresses
@ -70,7 +70,8 @@ public interface AccountService {
User getSystemUser(); User getSystemUser();
User createUser(String userName, String password, String firstName, String lastName, String email, String timeZone, String accountName, Long domainId, String userUUID); User
createUser(String userName, String password, String firstName, String lastName, String email, String timeZone, String accountName, Long domainId, String userUUID);
boolean isAdmin(short accountType); boolean isAdmin(short accountType);

View File

@ -23,6 +23,7 @@ import org.apache.cloudstack.api.InternalIdentity;
public interface User extends OwnedBy, InternalIdentity { public interface User extends OwnedBy, InternalIdentity {
public static final long UID_SYSTEM = 1; public static final long UID_SYSTEM = 1;
@Override
public long getId(); public long getId();
public String getUuid(); public String getUuid();

View File

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

View File

@ -45,7 +45,8 @@ public class DiskProfile {
protected DiskProfile() { protected DiskProfile() {
} }
public DiskProfile(long volumeId, Volume.Type type, String name, long diskOfferingId, long size, String[] tags, boolean useLocalStorage, boolean recreatable, Long templateId) { public DiskProfile(long volumeId, Volume.Type type, String name, long diskOfferingId, long size, String[] tags, boolean useLocalStorage, boolean recreatable,
Long templateId) {
this.type = type; this.type = type;
this.name = name; this.name = name;
this.size = size; this.size = size;

View File

@ -31,6 +31,7 @@ public interface NicIpAlias extends ControlledEntity, Identity, InternalIdentity
active, revoked, active, revoked,
} }
@Override
long getId(); long getId();
long getNicId(); long getNicId();

View File

@ -162,6 +162,7 @@ public class NicProfile implements InternalIdentity {
return vmId; return vmId;
} }
@Override
public long getId() { public long getId() {
return id; return id;
} }

View File

@ -27,6 +27,7 @@ public interface NicSecondaryIp extends ControlledEntity, Identity, InternalIden
/** /**
* @return id in the CloudStack database * @return id in the CloudStack database
*/ */
@Override
long getId(); long getId();
long getNicId(); long getNicId();

View File

@ -40,6 +40,7 @@ import org.apache.cloudstack.api.command.user.vm.UpdateVMCmd;
import org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd; import org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd;
import org.apache.cloudstack.api.command.user.vmgroup.CreateVMGroupCmd; import org.apache.cloudstack.api.command.user.vmgroup.CreateVMGroupCmd;
import org.apache.cloudstack.api.command.user.vmgroup.DeleteVMGroupCmd; import org.apache.cloudstack.api.command.user.vmgroup.DeleteVMGroupCmd;
import com.cloud.dc.DataCenter; import com.cloud.dc.DataCenter;
import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.InsufficientCapacityException;
@ -202,11 +203,11 @@ public interface UserVmService {
* available. * available.
* @throws InsufficientResourcesException * @throws InsufficientResourcesException
*/ */
UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList, Account owner, UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList,
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod,
String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, Boolean displayVm, String keyboard, List<Long> affinityGroupIdList, Integer cpuSpeed, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, Boolean displayVm, String keyboard,
Integer memory, Integer cpuNumber, Long rootdisksize) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, List<Long> affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootdisksize) throws InsufficientCapacityException,
StorageUnavailableException, ResourceAllocationException; ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
/** /**
* Creates a User VM in Advanced Zone (Security Group feature is enabled) in * Creates a User VM in Advanced Zone (Security Group feature is enabled) in
@ -284,8 +285,8 @@ public interface UserVmService {
UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList,
List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, List<Long> securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor,
HTTPMethod httpmethod, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, HTTPMethod httpmethod, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard,
List<Long> affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootdisksize) throws InsufficientCapacityException, ConcurrentOperationException, List<Long> affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootdisksize) throws InsufficientCapacityException,
ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException; ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
/** /**
* Creates a User VM in Advanced Zone (Security Group feature is disabled) * Creates a User VM in Advanced Zone (Security Group feature is disabled)
@ -359,8 +360,8 @@ public interface UserVmService {
*/ */
UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, Account owner, UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, Account owner,
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData,
String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List<Long> affinityGroupIdList, Integer cpuSpeed, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List<Long> affinityGroupIdList,
Integer memory, Integer cpuNumber, Long rootdkisksize) Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootdkisksize)
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException; throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
@ -407,8 +408,8 @@ public interface UserVmService {
HypervisorType getHypervisorTypeOfUserVM(long vmid); HypervisorType getHypervisorTypeOfUserVM(long vmid);
UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, StorageUnavailableException, UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException,
ResourceAllocationException; StorageUnavailableException, ResourceAllocationException;
UserVm getUserVm(long vmId); UserVm getUserVm(long vmId);
@ -464,13 +465,15 @@ public interface UserVmService {
VirtualMachine migrateVirtualMachineWithVolume(Long vmId, Host destinationHost, Map<String, String> volumeToPool) throws ResourceUnavailableException, VirtualMachine migrateVirtualMachineWithVolume(Long vmId, Host destinationHost, Map<String, String> volumeToPool) throws ResourceUnavailableException,
ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException; ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException;
UserVm moveVMToUser(AssignVMCmd moveUserVMCmd) throws ResourceAllocationException, ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException; UserVm moveVMToUser(AssignVMCmd moveUserVMCmd) throws ResourceAllocationException, ConcurrentOperationException, ResourceUnavailableException,
InsufficientCapacityException;
VirtualMachine vmStorageMigration(Long vmId, StoragePool destPool); VirtualMachine vmStorageMigration(Long vmId, StoragePool destPool);
UserVm restoreVM(RestoreVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException; UserVm restoreVM(RestoreVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException;
UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException; UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException,
VirtualMachineMigrationException;
UserVm expungeVm(ExpungeVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException; UserVm expungeVm(ExpungeVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException;

View File

@ -38,15 +38,16 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I
} }
public enum State { public enum State {
Starting(true, "VM is being started. At this state, you should find host id filled which means it's being started on that host."), Running( Starting(true, "VM is being started. At this state, you should find host id filled which means it's being started on that host."),
false, Running(false, "VM is running. host id has the host that it is running on."),
"VM is running. host id has the host that it is running on."), Stopping(true, "VM is being stopped. host id has the host that it is being stopped on."), Stopped( Stopping(true, "VM is being stopped. host id has the host that it is being stopped on."),
false, Stopped(false, "VM is stopped. host id should be null."),
"VM is stopped. host id should be null."), Destroyed(false, "VM is marked for destroy."), Expunging(true, "VM is being expunged."), Migrating( Destroyed(false, "VM is marked for destroy."),
true, Expunging(true, "VM is being expunged."),
"VM is being migrated. host id holds to from host"), Error(false, "VM is in error"), Unknown(false, "VM state is unknown."), Shutdowned( Migrating(true, "VM is being migrated. host id holds to from host"),
false, Error(false, "VM is in error"),
"VM is shutdowned from inside"); Unknown(false, "VM state is unknown."),
Shutdowned(false, "VM is shutdowned from inside");
private final boolean _transitional; private final boolean _transitional;
String _description; String _description;

View File

@ -19,23 +19,19 @@ package com.cloud.vm.snapshot;
import java.util.Date; import java.util.Date;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.InternalIdentity;
import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.utils.fsm.StateMachine2; import com.cloud.utils.fsm.StateMachine2;
import com.cloud.utils.fsm.StateObject; import com.cloud.utils.fsm.StateObject;
public interface VMSnapshot extends ControlledEntity, Identity, InternalIdentity, StateObject<VMSnapshot.State> { public interface VMSnapshot extends ControlledEntity, Identity, InternalIdentity, StateObject<VMSnapshot.State> {
enum State { enum State {
Allocated("The VM snapshot is allocated but has not been created yet."), Allocated("The VM snapshot is allocated but has not been created yet."), Creating("The VM snapshot is being created."), Ready(
Creating("The VM snapshot is being created."), "The VM snapshot is ready to be used."), Reverting("The VM snapshot is being used to revert"), Expunging("The volume is being expunging"), Removed(
Ready("The VM snapshot is ready to be used."), "The volume is destroyed, and can't be recovered."), Error("The volume is in error state, and can't be recovered");
Reverting("The VM snapshot is being used to revert"),
Expunging("The volume is being expunging"),
Removed("The volume is destroyed, and can't be recovered."),
Error("The volume is in error state, and can't be recovered");
String _description; String _description;
@ -74,12 +70,14 @@ public interface VMSnapshot extends ControlledEntity, Identity, InternalIdentity
CreateRequested, OperationFailed, OperationSucceeded, RevertRequested, ExpungeRequested, CreateRequested, OperationFailed, OperationSucceeded, RevertRequested, ExpungeRequested,
} }
@Override
long getId(); long getId();
public String getName(); public String getName();
public Long getVmId(); public Long getVmId();
@Override
public State getState(); public State getState();
public Date getCreated(); public Date getCreated();
@ -102,5 +100,6 @@ public interface VMSnapshot extends ControlledEntity, Identity, InternalIdentity
public Date getRemoved(); public Date getRemoved();
@Override
public long getAccountId(); public long getAccountId();
} }

View File

@ -17,21 +17,16 @@
package org.apache.cloudstack.affinity; package org.apache.cloudstack.affinity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference; import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.api.response.ControlledEntityResponse;
import org.apache.cloudstack.api.response.ControlledViewEntityResponse; import org.apache.cloudstack.api.response.ControlledViewEntityResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
import com.cloud.network.security.SecurityGroup;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused") @SuppressWarnings("unused")
@EntityReference(value = AffinityGroup.class) @EntityReference(value = AffinityGroup.class)
@ -93,6 +88,7 @@ public class AffinityGroupResponse extends BaseResponse implements ControlledVie
this.description = description; this.description = description;
} }
@Override
public void setAccountName(String accountName) { public void setAccountName(String accountName) {
this.accountName = accountName; this.accountName = accountName;
} }
@ -106,6 +102,7 @@ public class AffinityGroupResponse extends BaseResponse implements ControlledVie
this.domainId = domainId; this.domainId = domainId;
} }
@Override
public void setDomainName(String domainName) { public void setDomainName(String domainName) {
this.domainName = domainName; this.domainName = domainName;
} }

View File

@ -16,18 +16,13 @@
// under the License. // under the License.
package org.apache.cloudstack.affinity; package org.apache.cloudstack.affinity;
import java.util.HashSet; import com.google.gson.annotations.SerializedName;
import java.util.Set;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference; import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.api.response.ControlledEntityResponse;
import org.apache.cloudstack.api.response.ControlledViewEntityResponse;
import com.cloud.network.security.SecurityGroup;
import com.cloud.serializer.Param; import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused") @SuppressWarnings("unused")
@EntityReference(value = AffinityGroup.class) @EntityReference(value = AffinityGroup.class)

View File

@ -50,6 +50,7 @@ public enum ApiErrorCode {
this.httpCode = httpCode; this.httpCode = httpCode;
} }
@Override
public String toString() { public String toString() {
return String.valueOf(this.httpCode); return String.valueOf(this.httpCode);
} }

View File

@ -26,18 +26,15 @@ import java.util.regex.Pattern;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.affinity.AffinityGroupService; import org.apache.cloudstack.affinity.AffinityGroupService;
import com.cloud.server.ResourceMetaDataService;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService; import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
import org.apache.cloudstack.network.lb.ApplicationLoadBalancerService; import org.apache.cloudstack.network.lb.ApplicationLoadBalancerService;
import org.apache.cloudstack.network.lb.InternalLoadBalancerVMService; import org.apache.cloudstack.network.lb.InternalLoadBalancerVMService;
import org.apache.cloudstack.query.QueryService; import org.apache.cloudstack.query.QueryService;
import org.apache.cloudstack.usage.UsageService; import org.apache.cloudstack.usage.UsageService;
import org.apache.log4j.Logger;
import com.cloud.configuration.ConfigurationService; import com.cloud.configuration.ConfigurationService;
import com.cloud.domain.Domain; import com.cloud.domain.Domain;
import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.ConcurrentOperationException;
@ -54,10 +51,10 @@ import com.cloud.network.StorageNetworkService;
import com.cloud.network.VpcVirtualNetworkApplianceService; import com.cloud.network.VpcVirtualNetworkApplianceService;
import com.cloud.network.as.AutoScaleService; import com.cloud.network.as.AutoScaleService;
import com.cloud.network.firewall.FirewallService; import com.cloud.network.firewall.FirewallService;
import com.cloud.network.vpc.NetworkACLService;
import com.cloud.network.lb.LoadBalancingRulesService; import com.cloud.network.lb.LoadBalancingRulesService;
import com.cloud.network.rules.RulesService; import com.cloud.network.rules.RulesService;
import com.cloud.network.security.SecurityGroupService; import com.cloud.network.security.SecurityGroupService;
import com.cloud.network.vpc.NetworkACLService;
import com.cloud.network.vpc.VpcProvisioningService; import com.cloud.network.vpc.VpcProvisioningService;
import com.cloud.network.vpc.VpcService; import com.cloud.network.vpc.VpcService;
import com.cloud.network.vpn.RemoteAccessVpnService; import com.cloud.network.vpn.RemoteAccessVpnService;
@ -66,6 +63,7 @@ import com.cloud.projects.Project;
import com.cloud.projects.ProjectService; import com.cloud.projects.ProjectService;
import com.cloud.resource.ResourceService; import com.cloud.resource.ResourceService;
import com.cloud.server.ManagementService; import com.cloud.server.ManagementService;
import com.cloud.server.ResourceMetaDataService;
import com.cloud.server.TaggedResourceService; import com.cloud.server.TaggedResourceService;
import com.cloud.storage.DataStoreProviderApiService; import com.cloud.storage.DataStoreProviderApiService;
import com.cloud.storage.StorageService; import com.cloud.storage.StorageService;
@ -349,7 +347,8 @@ public abstract class BaseCmd {
} }
public static boolean isAdmin(short accountType) { public static boolean isAdmin(short accountType) {
return ((accountType == Account.ACCOUNT_TYPE_ADMIN) || (accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN)); return ((accountType == Account.ACCOUNT_TYPE_ADMIN) || (accountType == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) ||
(accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
} }
public static boolean isRootAdmin(short accountType) { public static boolean isRootAdmin(short accountType) {
@ -397,7 +396,8 @@ public abstract class BaseCmd {
if (!enabledOnly || project.getState() == Project.State.Active) { if (!enabledOnly || project.getState() == Project.State.Active) {
return project.getProjectAccountId(); return project.getProjectAccountId();
} else { } else {
PermissionDeniedException ex = new PermissionDeniedException("Can't add resources to the project with specified projectId in state=" + project.getState() + PermissionDeniedException ex =
new PermissionDeniedException("Can't add resources to the project with specified projectId in state=" + project.getState() +
" as it's no longer active"); " as it's no longer active");
ex.addProxyObject(project.getUuid(), "projectId"); ex.addProxyObject(project.getUuid(), "projectId");
throw ex; throw ex;

View File

@ -64,6 +64,7 @@ public abstract class BaseListCmd extends BaseCmd {
return pageSize; return pageSize;
} }
@Override
public void configure() { public void configure() {
if (MAX_PAGESIZE == null) { if (MAX_PAGESIZE == null) {
if (_configService.getDefaultPageSize().longValue() != PAGESIZE_UNLIMITED) { if (_configService.getDefaultPageSize().longValue() != PAGESIZE_UNLIMITED) {

View File

@ -20,18 +20,18 @@ import org.apache.cloudstack.api.response.DomainResponse;
public abstract class BaseListDomainResourcesCmd extends BaseListCmd { public abstract class BaseListDomainResourcesCmd extends BaseListCmd {
@Parameter(name = ApiConstants.LIST_ALL, @Parameter(name = ApiConstants.LIST_ALL, type = CommandType.BOOLEAN, description = "If set to false, "
type = CommandType.BOOLEAN,
description = "If set to false, "
+ "list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false") + "list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
private Boolean listAll; private Boolean listAll;
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "list only resources belonging to the domain specified") @Parameter(name = ApiConstants.DOMAIN_ID,
type = CommandType.UUID,
entityType = DomainResponse.class,
description = "list only resources belonging to the domain specified")
private Long domainId; private Long domainId;
@Parameter(name = ApiConstants.IS_RECURSIVE, @Parameter(name = ApiConstants.IS_RECURSIVE, type = CommandType.BOOLEAN, description = "defaults to false,"
type = CommandType.BOOLEAN, + " but if true, lists all resources from the parent specified by the domainId till leaves.")
description = "defaults to false," + " but if true, lists all resources from the parent specified by the domainId till leaves.")
private Boolean recursive; private Boolean recursive;
public boolean listAll() { public boolean listAll() {

View File

@ -18,11 +18,11 @@ package org.apache.cloudstack.api;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.response.TemplatePermissionsResponse; import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.context.CallContext;
import org.apache.log4j.Logger;
import com.cloud.template.VirtualMachineTemplate; import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account; import com.cloud.user.Account;

View File

@ -16,9 +16,10 @@
// under the License. // under the License.
package org.apache.cloudstack.api; package org.apache.cloudstack.api;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.cloud.serializer.Param;
public abstract class BaseResponse implements ResponseObject { public abstract class BaseResponse implements ResponseObject {
private transient String responseName; private transient String responseName;
private transient String objectName; private transient String objectName;

View File

@ -16,10 +16,11 @@
// under the License. // under the License.
package org.apache.cloudstack.api; package org.apache.cloudstack.api;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.command.user.iso.UpdateIsoCmd; import org.apache.cloudstack.api.command.user.iso.UpdateIsoCmd;
import org.apache.cloudstack.api.response.GuestOSResponse; import org.apache.cloudstack.api.response.GuestOSResponse;
import org.apache.cloudstack.api.response.TemplateResponse; import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.log4j.Logger;
public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd { public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(UpdateIsoCmd.class.getName()); public static final Logger s_logger = Logger.getLogger(UpdateIsoCmd.class.getName());

View File

@ -18,10 +18,11 @@ package org.apache.cloudstack.api;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.response.ProjectResponse; import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse; import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.TemplateResponse; import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.InvalidParameterValueException;

View File

@ -16,8 +16,10 @@
// under the License. // under the License.
package org.apache.cloudstack.api.command.admin.account; package org.apache.cloudstack.api.command.admin.account;
import com.cloud.user.Account; import java.util.Collection;
import com.cloud.user.UserAccount; import java.util.Map;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
@ -29,10 +31,8 @@ import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse; import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.context.CallContext;
import org.apache.log4j.Logger; import com.cloud.user.Account;
import com.cloud.user.UserAccount;
import java.util.Collection;
import java.util.Map;
@APICommand(name = "createAccount", description = "Creates an account", responseObject = AccountResponse.class) @APICommand(name = "createAccount", description = "Creates an account", responseObject = AccountResponse.class)
public class CreateAccountCmd extends BaseCmd { public class CreateAccountCmd extends BaseCmd {
@ -172,8 +172,9 @@ public class CreateAccountCmd extends BaseCmd {
@Override @Override
public void execute() { public void execute() {
CallContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain Id:" + getDomainId()); CallContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain Id:" + getDomainId());
UserAccount userAccount = _accountService.createUserAccount(getUsername(), getPassword(), getFirstName(), getLastName(), getEmail(), getTimeZone(), getAccountName(), UserAccount userAccount =
getAccountType(), getDomainId(), getNetworkDomain(), getDetails(), getAccountUUID(), getUserUUID()); _accountService.createUserAccount(getUsername(), getPassword(), getFirstName(), getLastName(), getEmail(), getTimeZone(), getAccountName(), getAccountType(),
getDomainId(), getNetworkDomain(), getDetails(), getAccountUUID(), getUserUUID());
if (userAccount != null) { if (userAccount != null) {
AccountResponse response = _responseGenerator.createUserAccountResponse(userAccount); AccountResponse response = _responseGenerator.createUserAccountResponse(userAccount);
response.setResponseName(getCommandName()); response.setResponseName(getCommandName());

View File

@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.account;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
@ -30,8 +32,6 @@ import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.region.RegionService; import org.apache.cloudstack.region.RegionService;
import org.apache.log4j.Logger;
import com.cloud.event.EventTypes; import com.cloud.event.EventTypes;
import com.cloud.user.Account; import com.cloud.user.Account;
import com.cloud.user.User; import com.cloud.user.User;

View File

@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.account;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
@ -30,8 +32,6 @@ import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.region.RegionService; import org.apache.cloudstack.region.RegionService;
import org.apache.log4j.Logger;
import com.cloud.event.EventTypes; import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.ResourceUnavailableException; import com.cloud.exception.ResourceUnavailableException;

View File

@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.account;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.ApiErrorCode;
@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse; import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse; import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.region.RegionService; import org.apache.cloudstack.region.RegionService;
import org.apache.log4j.Logger;
import com.cloud.user.Account; import com.cloud.user.Account;

View File

@ -16,13 +16,14 @@
// under the License. // under the License.
package org.apache.cloudstack.api.command.admin.account; package org.apache.cloudstack.api.command.admin.account;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd; import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AccountResponse; import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse; import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.log4j.Logger;
import com.cloud.user.Account; import com.cloud.user.Account;

View File

@ -21,6 +21,8 @@ import java.util.Map;
import javax.inject.Inject; import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.ApiErrorCode;
@ -30,7 +32,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse; import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse; import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.region.RegionService; import org.apache.cloudstack.region.RegionService;
import org.apache.log4j.Logger;
import com.cloud.user.Account; import com.cloud.user.Account;

View File

@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.admin.autoscale; package org.apache.cloudstack.api.command.admin.autoscale;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
@ -25,7 +27,6 @@ import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.CounterResponse; import org.apache.cloudstack.api.response.CounterResponse;
import org.apache.log4j.Logger;
import com.cloud.event.EventTypes; import com.cloud.event.EventTypes;
import com.cloud.network.as.Counter; import com.cloud.network.as.Counter;

View File

@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.admin.autoscale; package org.apache.cloudstack.api.command.admin.autoscale;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.CounterResponse; import org.apache.cloudstack.api.response.CounterResponse;
import org.apache.cloudstack.api.response.SuccessResponse; import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.log4j.Logger;
import com.cloud.event.EventTypes; import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceInUseException; import com.cloud.exception.ResourceInUseException;

View File

@ -20,6 +20,8 @@ package org.apache.cloudstack.api.command.admin.cluster;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.ApiErrorCode;
@ -30,7 +32,6 @@ import org.apache.cloudstack.api.response.ClusterResponse;
import org.apache.cloudstack.api.response.ListResponse; import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PodResponse; import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.ZoneResponse; import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.log4j.Logger;
import com.cloud.exception.DiscoveryException; import com.cloud.exception.DiscoveryException;
import com.cloud.exception.ResourceInUseException; import com.cloud.exception.ResourceInUseException;

View File

@ -16,6 +16,8 @@
// under the License. // under the License.
package org.apache.cloudstack.api.command.admin.cluster; package org.apache.cloudstack.api.command.admin.cluster;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.ApiErrorCode;
@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ClusterResponse; import org.apache.cloudstack.api.response.ClusterResponse;
import org.apache.cloudstack.api.response.SuccessResponse; import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.log4j.Logger;
import com.cloud.user.Account; import com.cloud.user.Account;

View File

@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.cluster;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd; import org.apache.cloudstack.api.BaseListCmd;
@ -28,7 +30,6 @@ import org.apache.cloudstack.api.response.ClusterResponse;
import org.apache.cloudstack.api.response.ListResponse; import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PodResponse; import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.ZoneResponse; import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.log4j.Logger;
import com.cloud.org.Cluster; import com.cloud.org.Cluster;
import com.cloud.utils.Pair; import com.cloud.utils.Pair;

View File

@ -16,6 +16,8 @@
// under the License. // under the License.
package org.apache.cloudstack.api.command.admin.cluster; package org.apache.cloudstack.api.command.admin.cluster;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.ApiErrorCode;
@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ClusterResponse; import org.apache.cloudstack.api.response.ClusterResponse;
import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.InvalidParameterValueException;
import com.cloud.org.Cluster; import com.cloud.org.Cluster;

View File

@ -19,15 +19,20 @@ package org.apache.cloudstack.api.command.admin.config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd; import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.*; import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.ClusterResponse;
import org.apache.cloudstack.api.response.ConfigurationResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.StoragePoolResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.cloudstack.config.Configuration; import org.apache.cloudstack.config.Configuration;
import org.apache.log4j.Logger;
import com.cloud.utils.Pair; import com.cloud.utils.Pair;
@APICommand(name = "listConfigurations", description = "Lists all configurations.", responseObject = ConfigurationResponse.class) @APICommand(name = "listConfigurations", description = "Lists all configurations.", responseObject = ConfigurationResponse.class)

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