Interface EssScript

All Superinterfaces:
EssObject
All Known Implementing Classes:
EssScriptImpl

public interface EssScript extends EssObject
A calculation or MDX script on a cube.

Both kinds live behind one set of endpoints, told apart by a file query parameter, so they are one type here too - see EssScript.ScriptType.

  • Method Details

    • getScriptType

      EssScript.ScriptType getScriptType()
      Which kind of script this is.
      Returns:
      the type, never null
    • getCube

      EssCube getCube()
      The cube this script belongs to.
      Returns:
      the cube
    • getModifiedTime

      Long getModifiedTime()
    • getSize

      Long getSize()
    • getContent

      String getContent()
      The script's text, fetched from the server.
      Returns:
      the content
    • save

      void save(String content)
      Replaces the script's text on the server.
      Parameters:
      content - the new text
    • validate

      Optional<String> validate()
      Checks the script without running it.

      Worth doing before a save as well as before a run: Essbase validates against the live outline, so it catches a member name that no longer exists.

      Returns:
      empty when the script is valid, otherwise the server's complaint
    • delete

      void delete()
    • execute

      void execute()
      Runs the script and waits for it.

      A calculation and an MDX script are both jobs, but not the same one and not parameterised the same way - a calc is identified by its bare name and an MDX script by its file name. That difference is handled here rather than by the caller.

      Throws:
      EssApiException - if the script fails, carrying the server's reason