Interface ServerInstances
-
- All Known Subinterfaces:
IntelligenceServerInstances
public interface ServerInstances
The ServerInstances interface represents a list ofServerInstance
objects. 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 ServerInstance
add(java.lang.String name)
Creates a newServerInstance
object with the given name.ServerInstance
copy(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.Enumeration
elements()
Returns a java.util.Enumeration which can be used to iterate through the list ofServerInstance
objects.ServerInstance
get(int i)
Returns theServerInstance
object at the given index in the collection.ServerInstance
getDefault()
Returns the default server instance.ServerInstance
getItemByName(java.lang.String name)
Returns theServerInstance
object with the given name, if one exists.int
getServerType()
Returns the server type that this collection of instances refers to.boolean
isEmpty()
Returns whether the collection is empty or not.void
remove(int i)
Deletes theServerInstance
object at the given index in the collection.void
remove(ServerInstance inst)
Deletes the givenServerInstance
object from the collection.void
setDefault(ServerInstance inst)
Sets theServerInstance
object which is designated as the default one on the server.int
size()
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
EnumServerTypes
corresponding to the server type of the instances in the collection.
-
get
ServerInstance get(int i) throws java.lang.IndexOutOfBoundsException
Returns theServerInstance
object at the given index in the collection.- Parameters:
i
- The index of the item in the collection to obtain.- Returns:
- The
ServerInstance
object 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 theServerInstance
object with the given name, if one exists.- Parameters:
name
- The name of the instance to return.- Returns:
- A
ServerInstance
object 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 ofServerInstance
objects.- Returns:
- A java.util.Enumeration object containing
ServerInstance
objects.
-
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 newServerInstance
object 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
ServerInstance
object. - 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.IndexOutOfBoundsException
Deletes theServerInstance
object 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 givenServerInstance
object from the collection.- Parameters:
inst
- TheServerInstance
object 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
ServerInstance
object. - Throws:
ServerConfigException
- Thrown if an error occurs when obtaining the default object.
-
setDefault
void setDefault(ServerInstance inst) throws ServerConfigException
Sets theServerInstance
object which is designated as the default one on the server.- Parameters:
inst
- TheServerInstance
object 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
- TheServerInstance
object to copy.destName
- The name of the copy of the object.- Returns:
- The newly created
ServerInstance
object - Throws:
ServerConfigException
- Thrown if the operation fails.
-
-