Interface ServerInstances
-
- All Known Subinterfaces:
IntelligenceServerInstances
public interface ServerInstancesThe ServerInstances interface represents a list ofServerInstanceobjects. This interface contains methods to add, remove, and retrieve instances, along with methods to set and get the default server instances.- Since:
- MicroStrategy Web 7.5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ServerInstanceadd(java.lang.String name)Creates a newServerInstanceobject with the given name.ServerInstancecopy(ServerInstance source, java.lang.String destName)Creates a copy of a ServerInstance object with a new name, and returns the newly created object.java.util.Enumerationelements()Returns a java.util.Enumeration which can be used to iterate through the list ofServerInstanceobjects.ServerInstanceget(int i)Returns theServerInstanceobject at the given index in the collection.ServerInstancegetDefault()Returns the default server instance.ServerInstancegetItemByName(java.lang.String name)Returns theServerInstanceobject with the given name, if one exists.intgetServerType()Returns the server type that this collection of instances refers to.booleanisEmpty()Returns whether the collection is empty or not.voidremove(int i)Deletes theServerInstanceobject at the given index in the collection.voidremove(ServerInstance inst)Deletes the givenServerInstanceobject from the collection.voidsetDefault(ServerInstance inst)Sets theServerInstanceobject which is designated as the default one on the server.intsize()Returns the number of objects in the collection.
-
-
-
Method Detail
-
getServerType
int getServerType()
Returns the server type that this collection of instances refers to.- Returns:
- A value from
EnumServerTypescorresponding to the server type of the instances in the collection.
-
get
ServerInstance get(int i) throws java.lang.IndexOutOfBoundsException
Returns theServerInstanceobject at the given index in the collection.- Parameters:
i- The index of the item in the collection to obtain.- Returns:
- The
ServerInstanceobject at the given index. - Throws:
java.lang.IndexOutOfBoundsException- Thrown if an invalid index is given.
-
getItemByName
ServerInstance getItemByName(java.lang.String name) throws java.lang.IllegalArgumentException
Returns theServerInstanceobject with the given name, if one exists.- Parameters:
name- The name of the instance to return.- Returns:
- A
ServerInstanceobject with the given name. - Throws:
java.lang.IllegalArgumentException- Thrown if no object with the given name exists.
-
size
int size()
Returns the number of objects in the collection.- Returns:
- The size of the collection.
-
elements
java.util.Enumeration elements()
Returns a java.util.Enumeration which can be used to iterate through the list ofServerInstanceobjects.- Returns:
- A java.util.Enumeration object containing
ServerInstanceobjects.
-
isEmpty
boolean isEmpty()
Returns whether the collection is empty or not.- Returns:
- True if the collection is empty, false otherwise.
-
add
ServerInstance add(java.lang.String name) throws ServerConfigException, java.lang.IllegalArgumentException
Creates a newServerInstanceobject with the given name. The newly created object will be returned from this method. Note that the newly created instance will not be registered as a service - to do that, call the registerService method onServerInstance.- Parameters:
name- The name of the newly created object.- Returns:
- The newly created
ServerInstanceobject. - Throws:
ServerConfigException- Thrown if an error occurs when creating the instance.java.lang.IllegalArgumentException- Thrown if an instance with the given name already exists.
-
remove
void remove(int i) throws ServerConfigException, java.lang.IndexOutOfBoundsExceptionDeletes theServerInstanceobject at the given index in the collection.- Parameters:
i- The index of the object to remove from the list of server instances.- Throws:
ServerConfigException- Thrown if the operation fails.java.lang.IndexOutOfBoundsException- Thrown if the index is invalid.
-
remove
void remove(ServerInstance inst) throws ServerConfigException
Deletes the givenServerInstanceobject from the collection.- Parameters:
inst- TheServerInstanceobject to remove from the collection and delete permanently from the server.- Throws:
ServerConfigException- Thrown if the operation fails.
-
getDefault
ServerInstance getDefault() throws ServerConfigException
Returns the default server instance.- Returns:
- The default
ServerInstanceobject. - Throws:
ServerConfigException- Thrown if an error occurs when obtaining the default object.
-
setDefault
void setDefault(ServerInstance inst) throws ServerConfigException
Sets theServerInstanceobject which is designated as the default one on the server.- Parameters:
inst- TheServerInstanceobject to designate as the default.- Throws:
ServerConfigException- Thrown if the operation fails.
-
copy
ServerInstance copy(ServerInstance source, java.lang.String destName) throws ServerConfigException
Creates a copy of a ServerInstance object with a new name, and returns the newly created object.- Parameters:
source- TheServerInstanceobject to copy.destName- The name of the copy of the object.- Returns:
- The newly created
ServerInstanceobject - Throws:
ServerConfigException- Thrown if the operation fails.
-
-