Interface ServerMachine

  • All Superinterfaces:
    EnumWebPersistableState, Persistable

    public interface ServerMachine
    extends Persistable
    The ServerMachine interface represents one machine with one or more MicroStrategy Server products on it. Note that most of the methods on this interface will work without authentication. The only exception is that the getInstances method will require credentials if the machine is remote.
    Since:
    MicroStrategy Web 7.5.0
    • Method Detail

      • getMachineName

        java.lang.String getMachineName()
        Returns the name of the machine. In the case of a local machine (i.e. if connectLocal was used to obtain the ServerMachine interface), this property will be an empty string.
        Returns:
        The name of the machine.
      • serverExists

        boolean serverExists​(int serverType)
        Returns whether the given server type exists on the given machine.
        Parameters:
        serverType - The type of server to search for, from EnumServerTypes.
        Returns:
        True if the given server type exists on the server, false otherwise.
      • getInstanceNames

        SimpleList getInstanceNames​(int serverType)
                             throws ServerConfigException
        Returns the list of instance names of the given type available on the server.
        Parameters:
        serverType - The type of server to return the instances for, from EnumServerTypes.
        Returns:
        A SimpleList object containing the names of all instances of the given type.
        Throws:
        ServerConfigException - Thrown if an error occurs.
      • getDefaultInstanceName

        java.lang.String getDefaultInstanceName​(int serverType)
                                         throws ServerConfigException
        Returns the name of the default instance for the given server type.
        Parameters:
        serverType - The type of server to return the default instance for, from EnumServerTypes.
        Returns:
        A String, which is the name of the default instance.
        Throws:
        ServerConfigException - Thrown if an error occurs.
      • getInstanceStatus

        InstanceStatus getInstanceStatus​(java.lang.String instanceName,
                                         int serverType)
                                  throws ServerConfigException
        Obtains the status of the given instance, and returns a InstanceStatus object describing that status.
        Parameters:
        instanceName - The name of the instance to retrieve the status for.
        serverType - The type of server instance the status is being retrieved for, from EnumServerTypes.
        Returns:
        An InstanceStatus object, which can be used to query the status of the given instance.
        Throws:
        ServerConfigException - Thrown if an error occurs when gathering the status.
      • setCredentials

        void setCredentials​(java.lang.String l,
                            java.lang.String p)
                     throws ServerConfigException
        Sets the credentials to use for all requests concerning this machine.
        Parameters:
        l - The login to use for authentication on this machine.
        p - The password to use for authentication on this machine.
        Throws:
        ServerConfigException - Thrown if an error occurs.
      • hasCredentials

        boolean hasCredentials()
        Returns whether there have been credentials set on this ServerMachine. Certain operations do not require credentials. In addition, if the machine is local, then permissions may not be needed as well.
        Returns:
        True if credentials have been set on the machine, false otherwise.