Class PInfranetConnectionImpl

java.lang.Object
com.portal.bas.PInfranetAppControllerImpl
com.portal.bas.PInfranetConnectionImpl
All Implemented Interfaces:
PInfranetAppController, PInfranetConnection, CMConnectionListener, Remote

public class PInfranetConnectionImpl extends PInfranetAppControllerImpl
Deprecated.
As of Release 6.1, PInfranetConnectionImpl is deprecated and replaced by PInfranetAppController and PCachedContext.
PInfranetConnectionImpl is the implementation portion of the PInfranetConnection distributed class. This class is imposed between the client application and a PortalContext so that the model cache may be consulted prior to reads, and updated properly after writes.
Version:
20.1.2
Author:
Larry Lynch-Freshner
  • Constructor Details

    • PInfranetConnectionImpl

      public PInfranetConnectionImpl() throws RemoteException
      Deprecated.
      Constructs an instance of PInfranetConnectionImpl from the login information stored in PortalUser.properties.
      Throws:
      RemoteException - thrown for errors
    • PInfranetConnectionImpl

      public PInfranetConnectionImpl(String name, String password, String connectInfo) throws RemoteException
      Deprecated.
      Constructs an instance of PInfranetConnectionImpl from login information.
      Parameters:
      name - the user's login name
      password - the user's password
      connectInfo - the hostname and port
      Throws:
      RemoteException - thrown for errors
    • PInfranetConnectionImpl

      public PInfranetConnectionImpl(PInfranetConnectionImpl conn) throws RemoteException
      Deprecated.
      Constructs an instance of PInfranetConnectionImpl from another connection. This creates a separate connection that shares a cache with the specified connection. Use this constructor when you need a separate connection, for example, to use for long step searches.
      Parameters:
      conn - the existing connection
      Throws:
      RemoteException - thrown for errors
  • Method Details

    • callOpcode

      public FList callOpcode(int opcode, FList in) throws RemoteException, EBufException
      Deprecated.
      Given an input flist, calls an opcode with a default value of "0" for the opcode flags.
      Parameters:
      opcode - the opcode to call
      in - the input flist
      Returns:
      The output flist model.
      Throws:
      EBufException - thrown for Portal errors
      RemoteException - thrown for remote errors
    • callOpcode

      public FList callOpcode(int opcode, PModelHandle in) throws RemoteException, EBufException
      Deprecated.
      Given an input flist model, calls an opcode with a default value of "0" for the opcode flags.
      Parameters:
      opcode - the opcode to call
      in - the input flist model
      Returns:
      The output flist model.
      Throws:
      EBufException - thrown for Portal errors
      RemoteException - thrown for remote errors
    • callOpcode

      public FList callOpcode(int opcode, PModelHandle in, int flags) throws RemoteException, EBufException
      Deprecated.
      Given an input flist model, calls an opcode, using the opcode flag values passed in.
      Parameters:
      opcode - the opcode to call
      in - the input flist model
      flags - the opcode flags
      Returns:
      The output flist model.
      Throws:
      EBufException - thrown for Portal errors
      RemoteException - thrown for remote errors
    • callOpcode

      public FList callOpcode(int opcode, FList in, int flags) throws RemoteException, EBufException
      Deprecated.
      Given an input flist, calls an opcode, using the opcode flag values passed in.
      Parameters:
      opcode - the opcode to call
      in - the input flist
      flags - the opcode flags
      Returns:
      The output flist model.
      Throws:
      EBufException - thrown for Portal errors
      RemoteException - thrown for remote errors
    • search

      public PModelHandle[] search(int opcode, FList in) throws RemoteException, EBufException
      Deprecated.
      Calls the search opcode, but returns an array of model handles.
      Parameters:
      opcode - an Portal search opcode (SEARCH, STEP_SEARCH, STEP_NEXT)
      in - the input flist
      Returns:
      An array of model handles.
      Throws:
      EBufException - thrown for Portal errors
      RemoteException - thrown for remote errors
    • openTransaction

      public void openTransaction(int flags) throws RemoteException
      Deprecated.
      Opens an Portal transaction.
      Parameters:
      flags - the transaction flags
      Throws:
      RemoteException - thrown for remote errors
    • abortTransaction

      public void abortTransaction() throws RemoteException
      Deprecated.
      Halts an Portal transaction and rolls back the logs.
      Throws:
      RemoteException - thrown for remote errors
    • commitTransaction

      public void commitTransaction() throws RemoteException
      Deprecated.
      Commits an Portal transaction.
      Throws:
      RemoteException - thrown for remote errors
    • getUserID

      public Poid getUserID() throws RemoteException
      Deprecated.
      Returns the current userid.
      Returns:
      The userid POID.
      Throws:
      RemoteException - thrown for errors
    • getCurrentDB

      public long getCurrentDB() throws RemoteException
      Deprecated.
      Returns the database number that this context is connected to.
      Returns:
      The current database number.
      Throws:
      RemoteException - thrown for errors
    • registerComponent

      public void registerComponent(PRemoteComponent comp, String controllerClass) throws RemoteException
      Deprecated.
      Registers the client portion of a component with the Portal server.
      Specified by:
      registerComponent in interface PInfranetConnection
      Overrides:
      registerComponent in class PInfranetAppControllerImpl
      Parameters:
      comp - the remote component to register
      controllerClass - the class name of the component controller
      Throws:
      RemoteException - thrown in case of failure
    • unregisterComponent

      public void unregisterComponent(PRemoteComponent comp) throws RemoteException
      Deprecated.
      Unregisters the client portion of a component with the Portal server.
      Specified by:
      unregisterComponent in interface PInfranetConnection
      Overrides:
      unregisterComponent in class PInfranetAppControllerImpl
      Parameters:
      comp - the remote component to unregister
      Throws:
      RemoteException - thrown for errors
    • lookupController

      public PComponentControllerImpl lookupController(PRemoteComponent comp)
      Deprecated.
      Looks up a controller for a given component.
      Parameters:
      comp - a PRemoteComponent component stub
      Returns:
      The controller, if any, associated with the component.
    • getOrCreateModelFrom

      public PModelHandle getOrCreateModelFrom(FList fl) throws RemoteException
      Deprecated.
      Creates a model for the specified flist, but does not put the flist in the cache unless there is no match for the newly-created model handle.
      Parameters:
      fl - the model to create a handle for
      Returns:
      A new model handle.
      Throws:
      RemoteException - thrown for errors
    • createModelFrom

      public PModelHandle createModelFrom(FList fl) throws RemoteException
      Deprecated.
      Creates a new model handle from an flist, and sets that flist in the cache.
      Parameters:
      fl - the model to create a handle from
      Returns:
      A new model handle.
      Throws:
      RemoteException - thrown for errors
    • createModelFrom

      public PModelHandle createModelFrom(SparseArray sa) throws RemoteException
      Deprecated.
      Creates a new model handle from a SparseArray.
      Parameters:
      sa - the model to create a handle from
      Returns:
      A new model handle.
      Throws:
      RemoteException - thrown for errors
    • createModelFrom

      public PModelHandle createModelFrom(Poid pd) throws RemoteException
      Deprecated.
      Creates a new model handle from a Poid.
      Parameters:
      pd - the model to create a handle from
      Returns:
      A new model handle.
      Throws:
      RemoteException - thrown for errors
    • lookupPoid

      public Poid lookupPoid(PModelHandle modl) throws RemoteException, EBufException
      Deprecated.
      Gets the POID from the cache for a model handle.
      Parameters:
      modl - the model handle to look up
      Returns:
      The model's POID.
      Throws:
      EBufException - thrown for Portal errors
      RemoteException - thrown for remote errors
    • lookupModel

      public Object lookupModel(PModelHandle modl) throws RemoteException, EBufException
      Deprecated.
      Gets the model from the cache for a model handle.
      Parameters:
      modl - the model handle to look up
      Returns:
      An Object, which is either an flist, a SparseArray, or a POID.
      Throws:
      EBufException - thrown for Portal errors
      RemoteException - thrown for remote errors
    • setModel

      public void setModel(PModelHandle modl, FList fl) throws RemoteException
      Deprecated.
      Sets an flist model in the cache and associates it with a handle.
      Parameters:
      modl - the model handle to use as a key
      fl - the flist model to store
      Throws:
      RemoteException - thrown for errors
    • setModel

      public void setModel(PModelHandle modl, SparseArray sa) throws RemoteException
      Deprecated.
      Sets a SparseArray model in the cache and associates it with a handle.
      Parameters:
      modl - the model handle to use as a key
      sa - the SparseArray model to store
      Throws:
      RemoteException - thrown for errors
    • setModel

      public void setModel(PModelHandle modl, Poid pd) throws RemoteException
      Deprecated.
      Sets a POID model in the cache and associates it with a handle.
      Parameters:
      modl - the POID's model handle to use as a key
      pd - the POID model to store
      Throws:
      RemoteException - thrown for errors
    • discardModel

      public void discardModel(PModelHandle mh) throws RemoteException
      Deprecated.
      Removes a model from the cache to free resources.
      Parameters:
      mh - a model handle
      Throws:
      RemoteException - thrown for errors
    • getModelField

      public Object getModelField(FList data, PFieldSpecification spec) throws RemoteException
      Deprecated.
      Gets a field from an flist. This version only returns a model handle for a field that is itself a model. Use this method when the returned field data will be sent to the client. In the case of compound specifications, an object array is returned.
      Parameters:
      data - the model to get a field from
      spec - a specification for which field(s) to get
      Returns:
      The contents of the field, in the form of an Integer, BigDecimal, Date, Double, byte array, String, or ModelHandle.
      Throws:
      RemoteException - thrown for errors
    • getModelField

      public Object getModelField(PModelHandle data, PFieldSpecification spec) throws RemoteException
      Deprecated.
      Gets a field from a model. This version returns a model handle only for a field that is itself a model. Use this method when the returned field data will be sent to the client. In the case of compound specifications, an object array is returned.
      Parameters:
      data - the model to get a field from
      spec - a specification for which field(s) to get
      Returns:
      The contents of the field, in the form of an Integer, BigDecimal, Date, Double, byte array, String, or ModelHandle.
      Throws:
      RemoteException - thrown for errors
    • getWholeObject

      public FList getWholeObject(PModelHandle mh) throws RemoteException, EBufException
      Deprecated.
      Forces the cache to be loaded with an entire storable class for a given model handle. Called when the caller knows it will access more than a field or two.
      Parameters:
      mh - a model handle
      Returns:
      An Flist object.
      Throws:
      EBufException - thrown for Portal errors
      RemoteException - thrown for remote errors
    • getField

      public Object getField(FList list, PDataFieldSpecification spec) throws RemoteException
      Deprecated.
      Gets a field from an flist.
      Parameters:
      list - the flist to get a field from
      spec - a specification of which field to get
      Returns:
      The field's value.
      Throws:
      RemoteException - thrown for errors
    • getField

      public Object getField(PModelHandle mh, PDataFieldSpecification spec) throws RemoteException
      Deprecated.
      Gets a field from a model.
      Parameters:
      mh - the model handle to get a field from
      spec - a specification of which field to get
      Returns:
      The field's value.
      Throws:
      RemoteException - thrown for errors
    • setField

      public void setField(PModelHandle modl, PDataFieldSpecification spec, Object val) throws RemoteException
      Deprecated.
      Sets a field in a model.
      Parameters:
      modl - the model to set a field in
      spec - a specification of which field to set
      val - the new value to set
      Throws:
      RemoteException - thrown for errors
    • setField

      public void setField(FList list, PDataFieldSpecification spec, Object val) throws RemoteException
      Deprecated.
      Sets a field in an flist.
      Parameters:
      list - the flist to set a field in
      spec - a specification of which field to set
      val - the new value to set
      Throws:
      RemoteException - thrown for errors
    • logCache

      public void logCache()
      Deprecated.
      Serves as a debug function to dump the cache to the log file.