com.telelogic.cs.api

Class PackageEvent



  • public class PackageEvent
    extends TriggerEvent
    Sent during any package installation or un-installation.

    A package trigger is defined within the scripts directory of a package. The code will look for a script named "install.js" during package install and "uninstall.js" on package uninstall.

    Since:
    5.3
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String TYPE 
    • Constructor Summary

      Constructors 
      Constructor and Description
      PackageEvent(User triggerUser, User adminUser, java.lang.StringBuilder statusLog, java.lang.StringBuilder infoLog, java.lang.StringBuilder errorLog) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      User getAdminUser()
      Gets information about the admin user for the database the trigger fired in.
      java.lang.StringBuilder getErrorLog()
      Package installation and uninstallation normally doesn't write to the normal event.log.
      java.lang.StringBuilder getInfoLog()
      Package installation and uninstallation normally doesn't write to the normal event.log.
      java.lang.StringBuilder getStatusLog()
      Package installation and uninstallation normally doesn't write to the normal event.log.
      java.lang.String getTriggerType()
      Gets the type of this trigger, that is the type of action the spawned this trigger.
      User getTriggerUser()
      Gets information about this user that performed the action that fired this trigger.
      boolean isPostTrigger()
      Gets if this trigger is a post-trigger or not, true if a post-trigger false otherwise.
      boolean isPreTrigger()
      Gets if this trigger is a pre-trigger or not, true if a pre-trigger false otherwise.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PackageEvent

        public PackageEvent(User triggerUser,
                            User adminUser,
                            java.lang.StringBuilder statusLog,
                            java.lang.StringBuilder infoLog,
                            java.lang.StringBuilder errorLog)
    • Method Detail

      • getAdminUser

        public User getAdminUser()
        Description copied from class: TriggerEvent
        Gets information about the admin user for the database the trigger fired in. Can be used in triggers to perform operations as an admin when triggers should run without security restrictions.
        Specified by:
        getAdminUser in class TriggerEvent
        Returns:
        details about the admin user.
      • getTriggerType

        public java.lang.String getTriggerType()
        Description copied from class: TriggerEvent
        Gets the type of this trigger, that is the type of action the spawned this trigger. Can be used to determine what kind of trigger is firing if the same trigger script is reused for multiple trigger types.
        Specified by:
        getTriggerType in class TriggerEvent
        Returns:
        a name for the type of operation this trigger is for.
      • getTriggerUser

        public User getTriggerUser()
        Description copied from class: TriggerEvent
        Gets information about this user that performed the action that fired this trigger.
        Specified by:
        getTriggerUser in class TriggerEvent
        Returns:
        details about the trigger user.
      • isPostTrigger

        public boolean isPostTrigger()
        Description copied from class: TriggerEvent
        Gets if this trigger is a post-trigger or not, true if a post-trigger false otherwise.
        Specified by:
        isPostTrigger in class TriggerEvent
        Returns:
        True if a post-trigger, false otherwise.
      • isPreTrigger

        public boolean isPreTrigger()
        Description copied from class: TriggerEvent
        Gets if this trigger is a pre-trigger or not, true if a pre-trigger false otherwise.
        Specified by:
        isPreTrigger in class TriggerEvent
        Returns:
        True if a pre-trigger, false otherwise.
      • getStatusLog

        public java.lang.StringBuilder getStatusLog()
        Package installation and uninstallation normally doesn't write to the normal event.log. It has its own set of logs, status, info and error. This method returns the status log which is just a StringBuilder which gets converted at the end of the package install event. Package uninstall does not have a status log, this will return null when called during package uninstallation.
        Returns:
        The status log for the package event.
      • getInfoLog

        public java.lang.StringBuilder getInfoLog()
        Package installation and uninstallation normally doesn't write to the normal event.log. It has its own set of logs, status, info and error. This method returns the info log which is just a StringBuilder which gets converted at the end of the package install/uninstall event.
        Returns:
        The info log for the package event.
      • getErrorLog

        public java.lang.StringBuilder getErrorLog()
        Package installation and uninstallation normally doesn't write to the normal event.log. It has its own set of logs, status, info and error. This method returns the error log which is just a StringBuilder which gets converted at the end of the package install/uninstall event.
        Returns:
        The error log for the package event.

© Copyright IBM Corporation 2000, 2009
US Government Users Restricted Rights--Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Notices