de.esprit.netsuite.server.abo

## Interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,A extends AliveBusinessObject>

- All Superinterfaces:
    ClientObject<C>, java.lang.Cloneable, java.lang.Comparable, CrossPlatformObject<C,S>, DeepCloneable, Dumpable, LastAccessed, PermissionControlled, RemoteLockable, Renderable, java.io.Serializable, ServerObject<S>
  All Known Implementing Classes:
    AbstractABO, AbstractDBRecordABO, AbstractLoadMeterABO, AbstractPersistentABO, AbstractSingletonABO, ClientMeterABO, CoServerConnectionABO, MessageMeterABO, RequestMeterABO, ServerStatisticABO, SimpleTrackABO, TankABO, TaskMeterABO

      public interface AliveBusinessObject<C extends ClientContext,S extends ServerContext,A extends AliveBusinessObject>
      extends CrossPlatformObject<C,S>, LastAccessed, Dumpable, Renderable, DeepCloneable, RemoteLockable, java.lang.Comparable, PermissionControlled

  Alive business objects (ABOs) are server side singletons, stored in special server side cache. Clients which access an ABO will receive notification events whenever the ABO was changed on the server. Thus all clients always have the same view of the ABO.
  Author:
    Rainer Buesch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChangeListener(ABOChangeEvent.Listener l)` Note that each ABO is responsible for receiving and processing its own change events from the server.
    `void` | `copyABOValues(A inst)` Updates the values of this instance from another one.
    `A` | `create()` Initializes this instance with values.
    `ABOEditDialog` | `createEditDialog(javax.swing.JDialog parent, ABOList list)`
    `boolean` | `delete()` Deletes this ABO instance on the server.
    `void` | `drop()` Deregisters the accessor from the access list.
    `A` | `fetch(boolean withLock, java.lang.Object... pkValues)` Fetches a new ABO instance by primary key values.
    `A[]` | `findCachedABOs(ABOFilter filter)` Returns all cached ABOs of this type that match the filter condition.
    `PrimaryKey` | `getPrimaryKey()` Returns the primary key of this instance.
    `int` | `getUpdateCount()` Tells how many server side updates have yet been performed on this instance.
    `A` | `instantiateOnServer(java.lang.Object... pkValues)`
    `boolean` | `isCacheResident()` This flag causes the ABO to remain in the `ABOServerCache` even if the last accessing client drops it.
    `boolean` | `isOnline()` Tells whether this ABO is receiving events.
    `boolean` | `isVisibleInClientMonitor()` Tells whether this ABO shows up in the clients ActivityMonitor
    `void` | `refetch()` Re-fetches the values of this ABO instance and makes it online again.
    `void` | `removeChangeListener(ABOChangeEvent.Listener l)`
    `void` | `update()` Updates this instance with the current values.
    `void` | `update(boolean isResetOnFailure)` Updates the ABO on the server.

    - ### Methods inherited from interface de.esprit.netsuite.netdata.CrossPlatformObject

      `isOnClient, isOnServer, setClientContext, setServerContext`

    - ### Methods inherited from interface de.esprit.netsuite.client.ClientObject

      `getClientContext`

    - ### Methods inherited from interface de.esprit.netsuite.server.ServerObject

      `getServerContext`

    - ### Methods inherited from interface de.esprit.common.type.Dumpable

      `toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from interface de.esprit.common.type.DeepCloneable

      `deepClone`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.LastAccessed

      `getLastAccessedTs, getLastAccessorId, setLastAccessorId`

    - ### Methods inherited from interface de.esprit.common.gui.Renderable

      `getRenderColor, getRenderIcon, getRenderText`

    - ### Methods inherited from interface de.esprit.netsuite.server.lock.RemoteLockable

      `getResourceName, getResourceType, isLockedByMe, setLocked`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

    - ### Methods inherited from interface de.esprit.netsuite.server.permission.PermissionControlled

      `getPermissionDefinition`

- - ### Method Detail

    - #### isCacheResident

          boolean isCacheResident()

      This flag causes the ABO to remain in the `ABOServerCache` even if the last accessing client drops it. Is false by default.

    - #### isOnline

          boolean isOnline()

      Tells whether this ABO is receiving events. After a `drop()` call the abo receives no more update notifications from the server an thus is considered to be offline. A `refetch()` call will bring it online again.

    - #### create

          A create()
                                               throws java.lang.Exception

      Initializes this instance with values. The returned instance contains the primary key as well as default values which have eventually been assigned by the database.
      Throws:
        `java.lang.Exception`

    - #### fetch

          A fetch(boolean withLock,
                java.lang.Object... pkValues)
                                              throws java.lang.Exception

      Fetches a new ABO instance by primary key values.
      Throws:
        `java.lang.Exception`

    - #### refetch

          void refetch()
                       throws java.lang.Exception

      Re-fetches the values of this ABO instance and makes it online again. This may be useful, if an ABO has been dropped and was offline for a while.
      Throws:
        `java.lang.Exception`

    - #### update

          void update()
                      throws java.lang.Exception

      Updates this instance with the current values.
      Throws:
        `java.lang.Exception`
      See Also:
        `update(boolean)`

    - #### update

          void update(boolean isResetOnFailure)
                      throws java.lang.Exception

      Updates the ABO on the server. If this fails and the isResetOnFailure flag is true, then the ABO values are automatically resetted to the original current values on the server.
      Parameters:
        `isResetOnFailure` - tells whether a reset should happen on update failure
      Throws:
        `java.lang.Exception`

    - #### delete

          boolean delete()
                         throws java.lang.Exception

      Deletes this ABO instance on the server. If the instance is `AbstractPersistentABO`, then it is removed totally from the database.
      Returns:
        true if the ABO was found in the server cache an deletion was successful.
      Throws:
        `java.lang.Exception`

    - #### drop

          void drop()

      Deregisters the accessor from the access list. Thus the ABO won't receive `ABOChangeEvent`s any more. If this was the last accessor and the ABO is not cache resistent it will be removed from the server cache.

    - #### getPrimaryKey

          PrimaryKey getPrimaryKey()

      Returns the primary key of this instance. The primary key is never null but it can have no values.

    - #### copyABOValues

          void copyABOValues(A inst)

      Updates the values of this instance from another one. The primary keys of both must match.

    - #### instantiateOnServer

          A instantiateOnServer(java.lang.Object... pkValues)
                                                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### createEditDialog

          ABOEditDialog createEditDialog(javax.swing.JDialog parent,
                                       ABOList list)

    - #### findCachedABOs

          A[] findCachedABOs(ABOFilter filter)
                                                         throws java.lang.Exception

      Returns all cached ABOs of this type that match the filter condition.
      Throws:
        `java.lang.Exception`

    - #### isVisibleInClientMonitor

          boolean isVisibleInClientMonitor()

      Tells whether this ABO shows up in the clients ActivityMonitor

    - #### addChangeListener

          void addChangeListener(ABOChangeEvent.Listener l)

      Note that each ABO is responsible for receiving and processing its own change events from the server. You may register here to get these events passed if you are explicitly interested in them.

    - #### removeChangeListener

          void removeChangeListener(ABOChangeEvent.Listener l)

    - #### getUpdateCount

          int getUpdateCount()

      Tells how many server side updates have yet been performed on this instance.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.