Class EssApplicationImpl

java.lang.Object
com.appliedolap.essbase.AbstractEssObject
com.appliedolap.essbase.impl.EssApplicationImpl
All Implemented Interfaces:
EssApplication, EssObject

public class EssApplicationImpl extends AbstractEssObject implements EssApplication
Represents an Essbase application object. An application is a container for one or more EssCubeImpl cubes.
  • Constructor Details

    • EssApplicationImpl

      public EssApplicationImpl(ApiContext api, EssServer server, com.appliedolap.essbase.client.model.Application application)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: EssObject
      Gets the name of this object. This will generally be the "nice" and "unique" name of this object, such as the application name, cube, member, variable, or whatever.
      Specified by:
      getName in interface EssObject
      Returns:
      the simple name of this object
    • getType

      public EssObject.Type getType()
      Description copied from interface: EssObject
      Gets the type of this object.
      Specified by:
      getType in interface EssObject
      Returns:
      the object type
    • getServer

      public EssServer getServer()
      Description copied from interface: EssApplication
      Get the server that contains this application.
      Specified by:
      getServer in interface EssApplication
      Returns:
      the parent server for the application
    • getCreated

      public Instant getCreated()
      Description copied from interface: EssApplication
      Gets the created time for this application.
      Specified by:
      getCreated in interface EssApplication
      Returns:
      when the application was created
    • getModified

      public Instant getModified()
      Description copied from interface: EssApplication
      Gets the modified time for this application.
      Specified by:
      getModified in interface EssApplication
      Returns:
      the modified time for this application
    • getCubes

      public List<EssCube> getCubes()
      Description copied from interface: EssApplication
      Gets the list of cubes in this application.
      Specified by:
      getCubes in interface EssApplication
      Returns:
      the list of cubes for this application, or an empty list if there are none
    • getCube

      public EssCube getCube(String cubeName)
      Description copied from interface: EssApplication
      Gets a cube with the given name.
      Specified by:
      getCube in interface EssApplication
      Parameters:
      cubeName - the name of the cube
      Returns:
      the cube
    • getApi

      public ApiContext getApi()
    • copy

      public void copy(String copyName)
      Description copied from interface: EssApplication
      Copies this application to a new application with the given name.
      Specified by:
      copy in interface EssApplication
      Parameters:
      copyName - the name of the copy
    • delete

      public void delete()
      Description copied from interface: EssApplication
      Deletes this application.
      Specified by:
      delete in interface EssApplication
    • rename

      public void rename(String newName)
      Description copied from interface: EssApplication
      Renames this application.
      Specified by:
      rename in interface EssApplication
      Parameters:
      newName - the new name for the application
    • configuration

      public EssApplicationConfig configuration()
      Description copied from interface: EssApplication
      This application's configuration, as something to read and change.
      Specified by:
      configuration in interface EssApplication
      Returns:
      the configuration, never null
    • getConfigurations

      public List<EssApplicationConfiguration> getConfigurations()
      Description copied from interface: EssApplication
      Gets the list of configuration for this application.
      Specified by:
      getConfigurations in interface EssApplication
      Returns:
      the configurations
    • getJobs

      public List<EssJob> getJobs()
      Description copied from interface: EssApplication
      Get the list of jobs associated with this application. In the Essbase REST API there is no specific endpoint for jobs related to an application, but the general jobs service can take an application name to filter on. So this implementation serves as a convenience method to get the jobs specific to this application.
      Specified by:
      getJobs in interface EssApplication
      Returns:
      list of jobs for this application, empty list if none
    • createVariable

      public EssApplicationVariable createVariable(String name, String value)
      Description copied from interface: EssApplication
      Defines a new variable on this application, visible to its cubes.

      Creation only: the server refuses a name that already exists at this level. Use EssVariable.setValue(String) on the existing one to change it.

      Specified by:
      createVariable in interface EssApplication
      Parameters:
      name - the variable name
      value - its value
      Returns:
      the created variable
    • getVariables

      public List<EssApplicationVariable> getVariables()
      Description copied from interface: EssApplication
      Gets the list of variables specific to this application
      Specified by:
      getVariables in interface EssApplication
      Returns:
      the application variables
    • getStatus

      public EssApplication.Status getStatus()
      Description copied from interface: EssApplication
      Gets the status of this application. Known statuses are simply STOPPED and STARTED; other statuses, if they exist, are not known at this time and will simply get converted to UNKNOWN.

      Note that this status represents the status when this object was instantiated. In other words, if the status of the app changes during the lifetime of this object, it won't be refreshed automatically.

      Specified by:
      getStatus in interface EssApplication
      Returns:
      the status of this application
    • refreshStatus

      public EssApplication.Status refreshStatus()
      Description copied from interface: EssApplication
      Asks the server for this application's status again, and updates this object with the answer.

      Needed because the status this object was built with is a snapshot, and an application's status changes as a side effect of ordinary work: reading a cube's dimensions starts the stopped application that owns it. So anything displaying a status alongside a tree the user is browsing will go stale simply by being browsed, and has to ask again.

      Specified by:
      refreshStatus in interface EssApplication
      Returns:
      the status as of now
    • stop

      public void stop()
      Description copied from interface: EssApplication
      Stops the application.
      Specified by:
      stop in interface EssApplication
    • start

      public void start()
      Description copied from interface: EssApplication
      Starts the application
      Specified by:
      start in interface EssApplication
    • downloadLatestLog

      public void downloadLatestLog(OutputStream outputStream)
      Description copied from interface: EssApplication
      Writes the latest application log to the given output stream.
      Specified by:
      downloadLatestLog in interface EssApplication
      Parameters:
      outputStream - the output stream
    • readLatestLog

      public List<EssLogEntry> readLatestLog()
      Description copied from interface: EssApplication
      Reads the latest application log and parses it.

      The whole log, which is a real amount of text - Sample's runs to several thousand entries after an afternoon's use - so a caller showing it should expect to filter. Use EssApplication.downloadLatestLog(OutputStream) instead to put it on disk without holding it in memory.

      Specified by:
      readLatestLog in interface EssApplication
      Returns:
      the entries, oldest first
    • downloadAllLogsAsZip

      public void downloadAllLogsAsZip(OutputStream outputStream)
      Description copied from interface: EssApplication
      Writes all logs to the given output stream.
      Specified by:
      downloadAllLogsAsZip in interface EssApplication
      Parameters:
      outputStream - the output stream
    • getPermissions

      public List<EssPermission> getPermissions()
      Description copied from interface: EssApplication
      Who holds which role on this application - Application Manager, Database Manager, Database Update, Database Access.
      Specified by:
      getPermissions in interface EssApplication
      Returns:
      the application role assignments, empty where nobody is provisioned on it specifically
    • downloadProvisionReport

      public File downloadProvisionReport(File file)
      Fetched by hand because the endpoint answers with a spreadsheet, not a model. It also answers 406 to any specific Accept - asking for JSON, CSV or Excel all fail and only */* succeeds - so the header has to be set deliberately rather than left to the generated client.
      Specified by:
      downloadProvisionReport in interface EssApplication
      Parameters:
      file - where to write it
      Returns:
      the file written
    • getSessions

      public List<EssSession> getSessions()
      Description copied from interface: EssApplication
      The sessions currently on this application, across all of its cubes.

      Filtered by the server rather than here - GET /sessions takes an application - so this is one request whatever else is running elsewhere.

      Specified by:
      getSessions in interface EssApplication
      Returns:
      the sessions
    • killSessions

      public void killSessions(boolean logoff)
      Description copied from interface: EssApplication
      Ends every session on this application.
      Specified by:
      killSessions in interface EssApplication
      Parameters:
      logoff - true to disconnect the users as well as ending their requests