org.universAAL.support.utils.service.top
Class UtilEditorCallee

Package class diagram package UtilEditorCallee
java.lang.Object
  extended by org.universAAL.middleware.bus.member.BusMember
      extended by org.universAAL.middleware.bus.member.Callee
          extended by org.universAAL.middleware.service.ServiceCallee
              extended by org.universAAL.support.utils.service.top.UtilEditorCallee

public abstract class UtilEditorCallee
extends ServiceCallee

This is an abstract class for those who want to use the typical services of an editor (get, add, change and remove) over an ontological service. Classes extending this abstract class will be ServiceCallees which handle by default these 4 services. Those considering using UtilEditor could take advantage of this class if they want only to handle those 4 typical services profiles and no more.

Author:
alfiva

Field Summary
 
Fields inherited from class org.universAAL.middleware.bus.member.BusMember
busResourceURI, owner, theBus
 
Constructor Summary
UtilEditorCallee(ModuleContext context, String namespace, String ontologyURI, String[] path, String editedURI)
          Default constructor of the class.
 
Method Summary
abstract  boolean executeAdd(Resource input)
          When a ADD service request is received, this method is called automatically.
abstract  boolean executeChange(Resource input)
          When a CHANGE service request is received, this method is called automatically.
abstract  Resource executeGet(Resource input)
          When a GET service request is received, this method is called automatically.
abstract  boolean executeRemove(Resource input)
          When a REMOVE service request is received, this method is called automatically.
 ServiceResponse handleCall(ServiceCall call)
          The actual service method of the ServiceCallee.
 
Methods inherited from class org.universAAL.middleware.service.ServiceCallee
addNewServiceProfiles, busDyingOut, communicationChannelBroken, getMyID, handleRequest, removeMatchingProfiles
 
Methods inherited from class org.universAAL.middleware.bus.member.BusMember
close, getType, getURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UtilEditorCallee

public UtilEditorCallee(ModuleContext context,
                        String namespace,
                        String ontologyURI,
                        String[] path,
                        String editedURI)
Default constructor of the class. Takes the same parameters needed by a UtilEditor profile method, in addition to the ModuleContext.

Parameters:
context - The Module Context of uAAL
namespace - The namespace of your server, ending with the character #
ontologyURI - The MY_URI of the class of Service ontology you are going to implement
path - The property path from the root of the Service ontology concept to the exact concept you want to manage
editedURI - The MY_URI of the class of the concept ontology that you want to manage, which is at the end of the property path
Method Detail

handleCall

public ServiceResponse handleCall(ServiceCall call)
Description copied from class: ServiceCallee
The actual service method of the ServiceCallee. It is called by the bus whenever there is a call that need to be serviced by this ServiceCallee.

Specified by:
handleCall in class ServiceCallee
Parameters:
call - the call that needs to be serviced.
Returns:
the result of the call execution.

executeGet

public abstract Resource executeGet(Resource input)
When a GET service request is received, this method is called automatically. The recommended purpose is to get a Resource with only a URI and return the matching complete Resource. Because it would be pointless to call this method if the client had the complete Resource. They only have the URI.

Parameters:
input - The Resource object with the instance URI for which the GET is issued. Take into account that only the instance URI is of interest here. You can cast it to the right class as you defined it in the constructor for the managedURI parameter.
Returns:
The complete Resource object with its full properties that is to be returned.

executeAdd

public abstract boolean executeAdd(Resource input)
When a ADD service request is received, this method is called automatically.

Parameters:
input - The Resource object to add. You can cast it to the right class as you defined it in the constructor for the managedURI parameter.
Returns:
true if the addition succeeded.

executeChange

public abstract boolean executeChange(Resource input)
When a CHANGE service request is received, this method is called automatically.

Parameters:
input - The Resource object to change. It is assumed, although that is up to the implementation, that the Resource to change already existed. You can cast it to the right class as you defined it in the constructor for the managedURI parameter.
Returns:
true if the change succeeded.

executeRemove

public abstract boolean executeRemove(Resource input)
When a REMOVE service request is received, this method is called automatically.

Parameters:
input - The Resource object to remove. Take into account that only the instance URI is of interest here. It is assumed, although that is up to the implementation, that the Resource to remove already existed. You can cast it to the right class as you defined it in the constructor for the managedURI parameter.
Returns:
true if the removal succeeded.


Copyright © 2014 universAAL Consortium. All Rights Reserved.