org.gcube.common.informationsystem.publisher.impl.registrations.handlers
Class BaseISPublisherHandler

java.lang.Object
  extended by org.gcube.common.informationsystem.publisher.impl.registrations.handlers.BaseISPublisherHandler
All Implemented Interfaces:
Runnable, ISPublisherHandler
Direct Known Subclasses:
CreateResourceHandler, RemoveResourceHandler, UpdateResourceHandler

public abstract class BaseISPublisherHandler
extends Object
implements ISPublisherHandler

Base implementation of a ISPublisherHandler

Author:
Manuele Simi (ISTI-CNR)

Field Summary
protected static org.gcube.common.core.utils.logging.GCUBELog logger
           
 
Constructor Summary
BaseISPublisherHandler()
           
 
Method Summary
 void execute()
          Executes the handler
 Future<?> getFutureTask()
          Gets the Future task that is currently executing the handler (if any)
abstract  String getResourceID()
          Gets the identifier of the resource managed by the handler
 void run()
          
 void setFutureTask(Future<?> future)
          The Future task that is currently executing the handler (if any)
protected abstract  void submitRequest()
          Submits the request for changing the resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.gcube.common.core.utils.logging.GCUBELog logger
Constructor Detail

BaseISPublisherHandler

public BaseISPublisherHandler()
Method Detail

run

public void run()

Specified by:
run in interface Runnable

execute

public void execute()
             throws Exception
Executes the handler

Specified by:
execute in interface ISPublisherHandler
Throws:
Exception - if an error occurs during the execution of the handler

submitRequest

protected abstract void submitRequest()
                               throws Exception
Submits the request for changing the resource

Throws:
Exception

getResourceID

public abstract String getResourceID()
Gets the identifier of the resource managed by the handler

Specified by:
getResourceID in interface ISPublisherHandler
Returns:
the identifier

getFutureTask

public Future<?> getFutureTask()
Gets the Future task that is currently executing the handler (if any)

Specified by:
getFutureTask in interface ISPublisherHandler
Returns:
the future task

setFutureTask

public void setFutureTask(Future<?> future)
The Future task that is currently executing the handler (if any)

Specified by:
setFutureTask in interface ISPublisherHandler
Parameters:
future - the future task


Copyright © 2013. All Rights Reserved.