more changes

This commit is contained in:
Alex Huang 2010-08-18 12:28:30 -07:00
parent b250b985ec
commit 20ffe6f13d
7 changed files with 137 additions and 0 deletions

View File

@ -0,0 +1,37 @@
/**
*
*/
package com.cloud.domain;
import java.util.Date;
import com.cloud.user.OwnedBy;
/**
* Domain defines the Domain object.
*/
public interface Domain extends OwnedBy {
public static final long ROOT_DOMAIN = 1L;
long getId();
Long getParent();
void setParent(Long parent);
String getName();
void setName(String name);
Date getRemoved();
String getPath();
void setPath(String path);
int getLevel();
int getChildCount();
long getNextChildSeq();
}

View File

@ -0,0 +1,15 @@
/**
*
*/
package com.cloud.domain;
/**
* PartOf must be implemented by all objects that belongs
* in a domain.
*/
public interface PartOf {
/**
* @return domain id that the object belongs to.
*/
long getDomainId();
}

View File

@ -0,0 +1,16 @@
/**
*
*/
package com.cloud.template;
/**
* BasedOn is implemented by all objects that are based on a certain template.
*/
public interface BasedOn {
/**
* @return the template id that the volume is based on.
*/
Long getTemplateId();
}

View File

@ -0,0 +1,14 @@
/**
*
*/
package com.cloud.user;
/**
* OwnedBy must be inheritted by all objects that can be owned by an account.
*/
public interface OwnedBy {
/**
* @return account id that owns this object.
*/
long getAccountId();
}

View File

@ -0,0 +1,23 @@
/**
*
*/
package com.cloud.vm;
import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
import com.cloud.utils.Pair;
import com.cloud.utils.component.Adapter;
/**
* NetworkConcierge reserves network settings for a VM based
* on the NetworkCharacteristics given. A Concierge must
* return a unique name so we know to call it to release
* the reservation.
*
*/
public interface NetworkConcierge extends Adapter {
String getUniqueName();
Pair<String, NetworkTO> reserve(long vmId, NetworkCharacteristics ch) throws InsufficientVirtualNetworkCapcityException;
boolean release(String uniqueName, String uniqueId);
}

View File

@ -0,0 +1,18 @@
/**
*
*/
package com.cloud.vm;
import java.util.Collection;
import java.util.List;
import com.cloud.offering.DiskOffering;
import com.cloud.offering.NetworkOffering;
import com.cloud.offering.ServiceOffering;
import com.cloud.user.Account;
import com.cloud.utils.Ternary;
import com.cloud.utils.component.Adapter;
public interface NetworkProfiler extends Adapter {
Ternary<VmCharacteristics, List<NetworkCharacteristics>, List<DiskCharacteristics>> convert(VirtualMachine vm, ServiceOffering serviceOffering, List<NetworkOffering> networkOfferings, Collection<DiskOffering> diskOfferings, Account owner);
}

View File

@ -0,0 +1,14 @@
/**
*
*/
package com.cloud.vm;
/**
* RunningOn must be implemented by objects that runs on hosts.
*
*/
public interface RunningOn {
Long getHostId();
}