org.modelbus.core.lib
Interface IServicesHelper

All Superinterfaces:
IModelBusHelper

public interface IServicesHelper
extends IModelBusHelper

The interface IServicesHelper provides an API to work with services related to the ModelBus. To instantiate the helper class, you call ModelBusCoreLib.getServicesHelper():

 {
        @code
        IServicesHelper helper = ModelBusCoreLib.getServicesHelper();
 }
 
 
To work with the repository, you have to declare a session:
 Session session = new Session();
 session.setId("abcdefghijklmno123456789");
 Property propertyUserName = new Property();
 propertyUserName.setKey("username");
 propertyUserName.setValue("Admin");
 Property propertyPassword = new Property();
 propertyPassword.setKey("password");
 propertyPassword.setValue("ModelBus");
 session.getProperties().add(propertyUserName);
 session.getProperties().add(propertyPassword);
 


Field Summary
 
Fields inherited from interface org.modelbus.core.lib.IModelBusHelper
MODE_CXF, MODE_DOSGI
 
Method Summary
 Status getStatus(Session session, boolean includeServices)
           
 boolean publishService(Session session, ModelBusServiceConfiguration configuration)
           
 boolean unpublishService(Session session, ModelBusServiceConfiguration configuration)
           
 
Methods inherited from interface org.modelbus.core.lib.IModelBusHelper
forcesSecureConnection, getMode, setForceSecureConnection, setMode
 

Method Detail

getStatus

Status getStatus(Session session,
                 boolean includeServices)
                 throws RepositoryAuthentificationException
Parameters:
session - the current session for authentication
includeServices - flag whether the state of services registered to the ModelBus should be included
Returns:
Model representing the current ModelBus state
Throws:
RepositoryAuthentificationException

publishService

boolean publishService(Session session,
                       ModelBusServiceConfiguration configuration)
                       throws RepositoryAuthentificationException,
                              InvalidServiceDescriptionException
Parameters:
session - The current user session
configuration - the configuration of a particular service
Returns:
flag indicating whether the service has been published successfully
Throws:
RepositoryAuthentificationException
InvalidServiceDescriptionException

unpublishService

boolean unpublishService(Session session,
                         ModelBusServiceConfiguration configuration)
                         throws RepositoryAuthentificationException,
                                RepositoryRuntimeException,
                                InvalidServiceDescriptionException
Parameters:
session - The current user session
configuration - the configuration of a particular service
Returns:
flag indicating whether the service has been unpublished successfully
Throws:
RepositoryAuthentificationException
InvalidServiceDescriptionException
RepositoryRuntimeException