Class ServiceModificationContextImpl

Object
com.tailf.dp.services.ServiceModificationContextImpl
All Implemented Interfaces:
ServiceContext

public class ServiceModificationContextImpl extends Object
Internal class implementing the service context for PRE/POST MODIFICATION callbacks. In this case NavuContext for NavuNodes should always attach to the base transaction. In contrast to the transInTrans for fastmap CREATE callbacks.
  • Constructor Details

  • Method Details

    • setTimeout

      public void setTimeout(int timeoutSeconds) throws DpCallbackException, IOException
      The timeout for service calls (pre-modification/create/post-modification) can be controlled by /services/global-settings/service-callback-timeout. Normally this is set to cover the longest possible execution time for any service call. In some rare cases it may still be necessary for a a service method to have longer execution time, and then this function can be used to extend (or shorten) the timeout for the current service invocation. The timeout is given in seconds from the point in time when the function is called.
      Specified by:
      setTimeout in interface ServiceContext
      Parameters:
      timeoutSeconds -
      Throws:
      IOException
      DpCallbackException
    • getAttachedServiceMaapi

      public Maapi getAttachedServiceMaapi() throws IOException, ConfException
      Internal used method to get the a maapi object attached to the correct transaction
      Returns:
      Maapi attached maapi instance
      Throws:
      IOException
      ConfException
    • getCurrentDpTrans

      public DpTrans getCurrentDpTrans()
    • getServiceNode

      public NavuNode getServiceNode() throws ConfException
      Returns the current service path as a NavuNode with the NavuContext attached to the ongoing Maapi transaction.
      Specified by:
      getServiceNode in interface ServiceContext
      Returns:
      NavuNode An object representing the service path
      Throws:
      ConfException
    • getRootNode

      public NavuNode getRootNode() throws ConfException
      Returns the path root as a NavuNode with the NavuContext attached to the ongoing Maapi transaction.
      Specified by:
      getRootNode in interface ServiceContext
      Returns:
      NavuNode An object representing the service path
      Throws:
      ConfException
    • getServicePath

      public ConfPath getServicePath()
      Returns a ConfPath object pointing the current service instance
      Returns:
      ConfPath path to the service instance
    • encodeOpaque

      public ConfEObject encodeOpaque(Properties p)
      Internal method to encode the Properties opaque object to Erlang form
      Parameters:
      p - Properties instance representing the opaque
      Returns:
      ConfEObject the encoded opaque
    • decodeOpaque

      public Properties decodeOpaque()
      Internal method to decode the Erlang term representation of a opaque to a Properties instance
      Returns:
      Properties instance representing the opaque
    • decodeProperties

      public Properties decodeProperties(ConfEObject eProperties)
    • getOperation

      public ServiceOperationType getOperation()
      Return the operation type for current operation. One of ServiceOperationType.CREATE, ServiceOperationType.UPDATE or ServiceOperationType.DELETE
      Returns:
      ServiceOperationType for current operation
    • getNedIdByDeviceName

      public String getNedIdByDeviceName(String name) throws ConfException
      Specified by:
      getNedIdByDeviceName in interface ServiceContext
      Throws:
      ConfException