Package com.tailf.dp.annotations
Class ServiceCallbackProxy
Object
com.tailf.dp.annotations.ServiceCallbackProxy
- All Implemented Interfaces:
DpServiceCallback
Callback proxy for Service Callbacks.
Implements the
DpServiceCallback
interface and delegates calls to the registered callback POJO with annotated
methods-
Field Summary
Fields inherited from interface com.tailf.dp.DpServiceCallback
M_CREATE, M_POST_MODIFICATION, M_PRE_MODIFICATION
-
Constructor Summary
ConstructorDescriptionServiceCallbackProxy
(Object backupObject, String servicePoint) Constructor for Callback proxys. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionCapability
(ServiceCBType serviceCBType) Add action capability from annotated callType used to register capabilities on the servervoid
addActionMethod
(String name, Method method) Add callback action method to proxycreate
(ServiceContext context, NavuNode service, NavuNode root, Properties opaque) Create callback method.delete
(ServiceContext context, NavuNode root, Properties opaque) Retrieve the callback POJOstatic ServiceCallbackProxy[]
Get array of proxy objects from registered POJO callback.Retrieve the callback servicepointint
mask()
Mask of flags for each method that is supported by this callback:DpServiceCallback.M_CREATE
DpServiceCallback.M_PRE_MODIFICATION
DpServiceCallback.M_POST_MODIFICATION
postModification
(ServiceContext context, ServiceOperationType operation, ConfPath path, Properties opaque) Post modification callback If registered this method will be called after a CREATE, UPDATE or DELETE of the service.preModification
(ServiceContext context, ServiceOperationType operation, ConfPath path, Properties opaque) Pre modification callback If registered this method will be called before a CREATE, UPDATE or DELETE of the service.The name of the servicepointupdate
(ServiceContext context, NavuNode service, NavuNode root, Properties opaque)
-
Constructor Details
-
ServiceCallbackProxy
Constructor for Callback proxys. Used internally.- Parameters:
backupObject
- registered callback POJOservicePoint
- string describing the servicepoint for this callback
-
-
Method Details
-
getBackupObject
Retrieve the callback POJO- Returns:
- Object registered callback object
-
getServicePoint
Retrieve the callback servicepoint- Returns:
- servicepoint string
-
addActionMethod
Add callback action method to proxy- Parameters:
name
- canonical action namemethod
- registered callback method
-
addActionCapability
Add action capability from annotated callType used to register capabilities on the server- Parameters:
serviceCBType
- action type
-
servicepoint
Description copied from interface:DpServiceCallback
The name of the servicepoint- Specified by:
servicepoint
in interfaceDpServiceCallback
-
preModification
public Properties preModification(ServiceContext context, ServiceOperationType operation, ConfPath path, Properties opaque) throws DpCallbackException Description copied from interface:DpServiceCallback
Pre modification callback If registered this method will be called before a CREATE, UPDATE or DELETE of the service. This is also called with a service context that is of the original transaction. This implies that changes written into this transaction will stay persistent outside of the fastmap algorithm. I.e. will be left untouched by the fastmap algorithm. This can be useful e.g. for allocations that should be stored and existing also when the service instance is removed.- Specified by:
preModification
in interfaceDpServiceCallback
- Parameters:
context
- - The current ServiceContext objectoperation
- - Type of operation (CREATE,UPDATE,DELETE)path
- - ConfPath object referring to the services pathopaque
- - Parameter contains a Properties object. This object may be used to transfer additional information between consecutive calls to the create callback. It is always null in the first call. I.e. when the service is first created.- Returns:
- Properties - the returning opaque instance
- Throws:
DpCallbackException
-
postModification
public Properties postModification(ServiceContext context, ServiceOperationType operation, ConfPath path, Properties opaque) throws DpCallbackException Description copied from interface:DpServiceCallback
Post modification callback If registered this method will be called after a CREATE, UPDATE or DELETE of the service. This is also called with a service context that is of the original transaction. This implies that changes written into this transaction will stay persistent outside of the fastmap algorithm. I.e. will be left untouched by the fastmap algorithm. This can be useful e.g. for allocations that should be stored and existing also when the service instance is removed.- Specified by:
postModification
in interfaceDpServiceCallback
- Parameters:
context
- - The current ServiceContext objectoperation
- - Type of operation (CREATE,UPDATE,DELETE)path
- - ConfPath object referring to the services pathopaque
- - Parameter contains a Properties object. This object may be used to transfer additional information between consecutive calls to the create callback. It is always null in the first call. I.e. when the service is first created.- Returns:
- Properties - the returning opaque instance
- Throws:
DpCallbackException
-
mask
public int mask()Description copied from interface:DpServiceCallback
Mask of flags for each method that is supported by this callback:- Specified by:
mask
in interfaceDpServiceCallback
-
getServiceCallbackProxys
public static ServiceCallbackProxy[] getServiceCallbackProxys(Object obj) throws DpCallbackException Get array of proxy objects from registered POJO callback. Used internally at callback registration- Parameters:
obj
- registered Callback POJO- Returns:
- array of ServCallbackProxy
- Throws:
DpCallbackException
-