Package com.tailf.dp.services
Class ServiceModificationContextImpl
Object
com.tailf.dp.services.ServiceModificationContextImpl
- All Implemented Interfaces:
ServiceContext
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 Summary
ConstructorDescriptionServiceModificationContextImpl
(DpTrans dpTrans, Dp dp, ConfEObject eObject) Internally used constructor -
Method Summary
Modifier and TypeMethodDescriptionInternal method to decode the Erlang term representation of a opaque to a Properties instancedecodeProperties
(ConfEObject eProperties) Internal method to encode the Properties opaque object to Erlang formInternal used method to get the a maapi object attached to the correct transactiongetNedIdByDeviceName
(String name) Return the operation type for current operation.Returns the path root as a NavuNode with the NavuContext attached to the ongoing Maapi transaction.Returns the current service path as a NavuNode with the NavuContext attached to the ongoing Maapi transaction.Returns a ConfPath object pointing the current service instancevoid
setTimeout
(int timeoutSeconds) The timeout for service calls (pre-modification/create/post-modification) can be controlled by /services/global-settings/service-callback-timeout.
-
Constructor Details
-
ServiceModificationContextImpl
public ServiceModificationContextImpl(DpTrans dpTrans, Dp dp, ConfEObject eObject) throws ConfException, ConfERangeException Internally used constructor- Parameters:
dpTrans
- The current dp transactiondp
- The current dp daemoneObject
- Erlang tuple received over the Dp protocol- Throws:
ConfException
ConfERangeException
-
-
Method Details
-
setTimeout
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 interfaceServiceContext
- Parameters:
timeoutSeconds
-- Throws:
IOException
DpCallbackException
-
getAttachedServiceMaapi
Internal used method to get the a maapi object attached to the correct transaction- Returns:
- Maapi attached maapi instance
- Throws:
IOException
ConfException
-
getCurrentDpTrans
-
getServiceNode
Returns the current service path as a NavuNode with the NavuContext attached to the ongoing Maapi transaction.- Specified by:
getServiceNode
in interfaceServiceContext
- Returns:
- NavuNode An object representing the service path
- Throws:
ConfException
-
getRootNode
Returns the path root as a NavuNode with the NavuContext attached to the ongoing Maapi transaction.- Specified by:
getRootNode
in interfaceServiceContext
- Returns:
- NavuNode An object representing the service path
- Throws:
ConfException
-
getServicePath
Returns a ConfPath object pointing the current service instance- Returns:
- ConfPath path to the service instance
-
encodeOpaque
Internal method to encode the Properties opaque object to Erlang form- Parameters:
p
- Properties instance representing the opaque- Returns:
- ConfEObject the encoded opaque
-
decodeOpaque
Internal method to decode the Erlang term representation of a opaque to a Properties instance- Returns:
- Properties instance representing the opaque
-
decodeProperties
-
getOperation
Return the operation type for current operation. One ofServiceOperationType.CREATE
,ServiceOperationType.UPDATE
orServiceOperationType.DELETE
- Returns:
- ServiceOperationType for current operation
-
getNedIdByDeviceName
- Specified by:
getNedIdByDeviceName
in interfaceServiceContext
- Throws:
ConfException
-