org.eclipse.stp.core.saf.handler
Class AbstractExternalServiceHandler

java.lang.Object
  extended byorg.eclipse.stp.core.saf.handler.AbstractHandler
      extended byorg.eclipse.stp.core.saf.handler.AbstractExternalServiceHandler
All Implemented Interfaces:
IExternalServiceHandler, IHandler

public abstract class AbstractExternalServiceHandler
extends AbstractHandler
implements IExternalServiceHandler

This class is to be extended by all ExternalService handler contributions.


Constructor Summary
AbstractExternalServiceHandler()
           
 
Method Summary
 boolean canCreateExternalServiceBinding()
          Queries if the external service handler provides support for creating an external service binding using the method createExternalServiceBindingFor().
 boolean canCreateExternalServiceFor(java.lang.Object service)
          Queries if an external service of the kind supported by this handler can be created for the specified model object.
 boolean canCreateManyExternalServiceBindings()
          Queries if the external service handler provides support for creating more than one binding instance for an external service.
 boolean isInterfaceKindSupported(IInterfaceHandler interfaceHandler)
          Queries if an external service of the kind supported by this handler supports interfaces of the kind specified by the given interface handler in its interface set.
 org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation removeKind(org.eclipse.stp.core.sca.ExternalService theExternalService)
          Removes a given binding kind from the external service.
 
Methods inherited from class org.eclipse.stp.core.saf.handler.AbstractHandler
getDescription, getDescriptiveKindName, getKind, getLargeIcon, getName, getSmallIcon, initialize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.stp.core.saf.handler.IExternalServiceHandler
createExternalServiceBindingFor, createExternalServiceFor
 
Methods inherited from interface org.eclipse.stp.core.saf.handler.IHandler
getDescription, getDescriptiveKindName, getKind, getLargeIcon, getName, getSmallIcon
 

Constructor Detail

AbstractExternalServiceHandler

public AbstractExternalServiceHandler()
Method Detail

canCreateExternalServiceFor

public boolean canCreateExternalServiceFor(java.lang.Object service)
Description copied from interface: IExternalServiceHandler
Queries if an external service of the kind supported by this handler can be created for the specified model object. If this method returns true, the handler's IExternalServiceHandler.createExternalServiceFor(Object,IContainer,IUIContext) method may be called to create an external service for the model object.

This method should be quick to execute, because it may be called to populate a context menu or a user dialog.

Specified by:
canCreateExternalServiceFor in interface IExternalServiceHandler
Parameters:
service - an object representing a service that may be imported
Returns:
true if the handler can create an ExternalService object from the specified model object; false otherwise

canCreateExternalServiceBinding

public boolean canCreateExternalServiceBinding()
Description copied from interface: IExternalServiceHandler
Queries if the external service handler provides support for creating an external service binding using the method createExternalServiceBindingFor().

Specified by:
canCreateExternalServiceBinding in interface IExternalServiceHandler
Returns:
true if support is provided for creating a binding; false otherwise

canCreateManyExternalServiceBindings

public boolean canCreateManyExternalServiceBindings()
Description copied from interface: IExternalServiceHandler
Queries if the external service handler provides support for creating more than one binding instance for an external service.

Specified by:
canCreateManyExternalServiceBindings in interface IExternalServiceHandler
Returns:
true if support is provided for creating more than one binding of the supported kind; false otherwise

isInterfaceKindSupported

public boolean isInterfaceKindSupported(IInterfaceHandler interfaceHandler)
                                 throws SAFException
Description copied from interface: IExternalServiceHandler
Queries if an external service of the kind supported by this handler supports interfaces of the kind specified by the given interface handler in its interface set.

Specified by:
isInterfaceKindSupported in interface IExternalServiceHandler
Parameters:
interfaceHandler - the interface handler that will be used to manipulate the interface. The implementation of this method can obtain the interface kind by invoking IHandler.getKind() when performing the evaluation.
Returns:
true if the external service supports interfaces of the specified interface kind; false otherwise
Throws:
SAFException - An unexpected exception occurred in the handler.

removeKind

public final org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation removeKind(org.eclipse.stp.core.sca.ExternalService theExternalService)
                                                                                 throws SAFException,
                                                                                        InvalidOperationException
Description copied from interface: IExternalServiceHandler
Removes a given binding kind from the external service. Generally, existing interfaces will be preserved. No clean-up is done on existing binding-related files. If the external service does not contain the given binding type, this method performs no work.

Specified by:
removeKind in interface IExternalServiceHandler
Parameters:
theExternalService - the external service being modified
Returns:
an IDataModelOperation instance that, once executed by the caller, resets the extenal service point kind
Throws:
InvalidOperationException - The external service kind cannot be removed.
SAFException - No handler for the specified kind is found, or the handler throws an exception.