public class ServiceCallbackProxy extends Object implements DpServiceCallback
DpServiceCallback
interface and delegates calls to the registered callback POJO with annotated
methodsM_CREATE, M_DELETE, M_POST_MODIFICATION, M_PRE_LOCK_CREATE, M_PRE_MODIFICATION, M_UPDATE
Constructor and Description |
---|
ServiceCallbackProxy(Object backupObject,
String servicePoint)
Constructor for Callback proxys.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionCapability(ServiceCBType serviceCBType)
Add action capability from annotated callType used to register
capabilities on the server
|
void |
addActionMethod(String name,
Method method)
Add callback action method to proxy
|
Properties |
create(ServiceContext context,
NavuNode service,
NavuNode root,
Properties opaque)
Create callback method.
|
Properties |
delete(ServiceContext context,
NavuNode root,
Properties opaque) |
Object |
getBackupObject()
Retrieve the callback POJO
|
static ServiceCallbackProxy[] |
getServiceCallbackProxys(Object obj)
Get array of proxy objects from registered POJO callback.
|
String |
getServicePoint()
Retrieve the callback servicepoint
|
int |
mask()
Mask of flags for each method that is supported by this callback:
DpServiceCallback.M_CREATE
DpServiceCallback.M_UPDATE
DpServiceCallback.M_DELETE
DpServiceCallback.M_PRE_MODIFICATION
DpServiceCallback.M_POST_MODIFICATION
|
Properties |
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.
|
Properties |
preLockCreate(ServiceContext context,
NavuNode service,
NavuNode root,
Properties opaque)
pre lock create callback method.
|
Properties |
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.
|
String |
servicepoint()
The name of the servicepoint
|
Properties |
update(ServiceContext context,
NavuNode service,
NavuNode root,
Properties opaque) |
public Object getBackupObject()
public String getServicePoint()
public void addActionMethod(String name, Method method)
name
- canonical action namemethod
- registered callback methodpublic void addActionCapability(ServiceCBType serviceCBType)
serviceCBType
- action typepublic String servicepoint()
DpServiceCallback
servicepoint
in interface DpServiceCallback
public Properties create(ServiceContext context, NavuNode service, NavuNode root, Properties opaque) throws DpCallbackException
DpServiceCallback
create
in interface DpServiceCallback
context
- - The current ServiceContext objectservice
- - The NavuNode references the service node.root
- - This NavuNode references the ncs root.opaque
- - 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.DpCallbackException
public Properties update(ServiceContext context, NavuNode service, NavuNode root, Properties opaque) throws DpCallbackException
DpCallbackException
public Properties delete(ServiceContext context, NavuNode root, Properties opaque) throws DpCallbackException
DpCallbackException
public Properties preModification(ServiceContext context, ServiceOperationType operation, ConfPath path, Properties opaque) throws DpCallbackException
DpServiceCallback
preModification
in interface DpServiceCallback
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.DpCallbackException
public Properties postModification(ServiceContext context, ServiceOperationType operation, ConfPath path, Properties opaque) throws DpCallbackException
DpServiceCallback
postModification
in interface DpServiceCallback
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.DpCallbackException
public Properties preLockCreate(ServiceContext context, NavuNode service, NavuNode root, Properties opaque) throws DpCallbackException
DpServiceCallback
preLockCreate
in interface DpServiceCallback
context
- - The current ServiceContext objectservice
- - The NavuNode references the service node.root
- - This NavuNode references the ncs root.opaque
- - 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.DpCallbackException
public int mask()
DpServiceCallback
mask
in interface DpServiceCallback
public static ServiceCallbackProxy[] getServiceCallbackProxys(Object obj) throws DpCallbackException
obj
- registered Callback POJODpCallbackException