Bus

org.topcased.bus.core
Class ServicesManager

java.lang.Object
  extended by org.topcased.bus.core.ServicesManager

public class ServicesManager
extends java.lang.Object

Manage services of bus


Field Summary
static java.lang.String ATT_CATEGORY_TYPE
          Attribut of ontologyType : category
static java.lang.String ATT_CLASS_SERVICE
          Attribut of service : class
static java.lang.String ATT_DESCRIPTION_PARAM
          Attribute of parameter : description
static java.lang.String ATT_ID_PARAM
          Attribute of parameter : id
static java.lang.String ATT_ID_SERVICE
          Attribut of service : id
static java.lang.String ATT_ID_TYPE
          Attribut of ontologyType : id
static java.lang.String ATT_KIND_PARAM
          Attribute of parameter : kind
static java.lang.String ATT_NAME_PARAM
          Attribute of parameter : name
static java.lang.String ATT_NAME_SERVICE
          Attribut of service : name
static java.lang.String ATT_NAME_TYPE
          Attribut of ontologyType : name
static java.lang.String ATT_PARENTID_TYPE
          Attribut of ontologyType : parentId
static java.lang.String LIST_INPUT_PARAM
          List of input parameters
static java.lang.String OUTPUT_PARAM
          Output parameter
static java.lang.String SERVICES_EXTENSION_POINT
          Extension point name
static java.lang.String TAG_PARAM
          TAG : parameter
static java.lang.String TAG_SERVICE
          TAG : service
static java.lang.String TAG_TYPE
          TAG : ontologyType
 
Method Summary
 java.util.Map<java.lang.String,Service> getActiveServices(java.util.Map<java.lang.String,Service> listService)
          Return a list of all services which are activated ????
 java.util.Set<java.lang.String> getAllParametersIds()
          Gets all parameters ids
 java.util.Map<java.lang.String,Parameter> getAllParametersIn()
          Gets all parameters IDs with their description
 java.util.Map<java.lang.String,Parameter> getAllParametersOut()
          Gets all output parameters IDs with their description
 java.util.Map<java.lang.String,Service> getAllServices()
          Get all service ids with their description
 java.util.Set<java.lang.String> getAllServicesIds()
          Gets all services ids
 java.util.Map<java.lang.String,Type> getAllType()
          Gets all types IDs with their description
 java.util.Set<java.lang.String> getAllTypesIds()
          Gets all types ids
static ServicesManager getInstance()
          Returns the shared instance
 java.util.Map<java.lang.String,Parameter> getListInput(java.util.Map<java.lang.String,Service> listService)
          Get a Map of all Input parameters which exist in the Services list
 java.util.Set<java.lang.String> getListInputParamId(java.util.Map<java.lang.String,Service> listService)
          Gets list of parameters ID from a list of services.
 java.util.Map<java.lang.String,Parameter> getListOutput(java.util.Map<java.lang.String,Service> listService)
          Gets a Map of all Output parameters which exists in the Service list
 java.util.Set<java.lang.String> getListOutputParamId(java.util.Map<java.lang.String,Service> listService)
          Gets list of parameters ID from a list of services.
 java.util.Map<java.lang.String,Type> getListType(java.util.Map<java.lang.String,Service> listService)
          Gets a Map of all Type which exist in the Services list
 java.util.Set<java.lang.String> getListTypeId(java.util.Map<java.lang.String,Service> listService)
          Gets the list of parameters ID from a list of services.
 java.util.Map<java.lang.String,Service> getRegisteredServicesOnBus()
           
 IService getService(java.lang.String serviceId)
          Returns IService from Service Id.
 java.util.Map<java.lang.String,Service> getService(java.lang.String typeService, java.util.Set<java.lang.String> listInputKind, java.lang.String outputKind)
          Returns Map corresponding to typeService, listInputKind, outputKind in all services on the bus
 java.util.Map<java.lang.String,Service> getServicesPerInput(java.lang.String inputKind, java.util.Map<java.lang.String,Service> listService)
          Gets all services which exist with this "input" in the listService
 java.util.Map<java.lang.String,Service> getServicesPerOutput(java.lang.String outputKind, java.util.Map<java.lang.String,Service> listService)
          Get all services which exist with this "output" in the listService
 java.util.Map<java.lang.String,Service> getServicesPerType(java.lang.String typeName, java.util.Map<java.lang.String,Service> listService)
          Gets all services which exist for the type "typeName" in the listService
 java.util.Map<java.lang.String,Service> getServicesWithCriteria(java.util.Map<java.lang.String,Service> listService, java.lang.String typeName, java.lang.String paramInputKind, java.lang.String paramOutputKind)
          Gets all services which have this "typeName", this "paramInputKind" and this "paramOutputKind" in parameters It is a filter on "type", on "input" and on "output"
static boolean isBasicService(java.lang.String serviceId)
          This function is used to determine whether a service is a basic one or not
 Parameter parameterId2Parameter(java.lang.String paramId)
          Gives the Parameter corrresponding to a precise parameter id from the private Map parameters
 java.util.Map<java.lang.String,Parameter> parameterId2ParameterMap(java.lang.String parameterId)
          Gives a Map (parameterId,Paramter) corrresponding to a precise service id from the private Map "paramters"
 java.util.Map<java.lang.String,Parameter> parameterIds2ParameterMap(java.util.Set<java.lang.String> paramIds)
          Gives Map (key=paramId, value=Parameter) corresponding to the Set of parameterIds
 java.util.Map<java.lang.String,Parameter> parameterKind2ParameterMap(java.lang.String parameterKind, java.util.Map<java.lang.String,Parameter> listParam)
          Returns the Map (key=parameter id; value=Parameter) of (In or Out) parameter corresponding to the parameterKind
 java.util.Map<java.lang.String,Parameter> serviceId2ParamInMap(java.lang.String serviceId)
          Returns the Map (key=parameter id; value=Parameter) of input parameter corresponding to the service id
 java.util.Map<java.lang.String,Parameter> serviceId2ParamOutMap(java.lang.String serviceId)
          Returns the Map (key=parameter id; value=Parameter) of input parameter corresponding to the service id
 Service serviceId2Service(java.lang.String serviceId)
          Gives the Service corrresponding to an accurate service id from the private Map services
 java.util.Map<java.lang.String,Service> serviceId2ServiceMap(java.lang.String serviceId)
          Gives a Map (serviceId,Service) corrresponding to a precise service id from the private Map "services"
 java.util.Map<java.lang.String,Type> serviceId2TypeMap(java.lang.String serviceId)
          Returns the Map (key=type id; value=Type) corresponding to the service id
 java.util.Map<java.lang.String,Service> serviceIds2ServiceMap(java.util.Set<java.lang.String> serviceIds)
          Gives Map (key=serviceId, value=Service) corresponding to the Set of serviceId
 java.util.Map<java.lang.String,Service> serviceMapNotBasic(java.util.Map<java.lang.String,Service> serviceMap)
          Gives Map (key=serviceId, value=Service) from service Map without basic services
 void setEmptyParameters()
          Clears the private Map "parameters"
 void setEmptyServices()
          Clears the private Map "services"
 void setEmptyTypes()
          Clears the private Map "types"
 Type typeId2Type(java.lang.String typeId)
          Gives the Type corrresponding to a precise type id from the private Map types
 java.util.Map<java.lang.String,Type> typeId2TypeMap(java.lang.String typeId)
          Gives a Map (typeId,Type) corrresponding to a precise service id from the private Map "types"
 java.util.Map<java.lang.String,Type> typeIds2TypeMap(java.util.Set<java.lang.String> typeIds)
          Gives Map (key=typeId, value=Type) corresponding to the Set of typeId
 java.util.Map<java.lang.String,Type> typeName2TypeMap(java.lang.String typeName, java.util.Map<java.lang.String,Type> listType)
          Returns the Map (key=type id; value=Type) corresponding to the typeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICES_EXTENSION_POINT

public static final java.lang.String SERVICES_EXTENSION_POINT
Extension point name

See Also:
Constant Field Values

TAG_SERVICE

public static final java.lang.String TAG_SERVICE
TAG : service

See Also:
Constant Field Values

ATT_ID_SERVICE

public static final java.lang.String ATT_ID_SERVICE
Attribut of service : id

See Also:
Constant Field Values

ATT_NAME_SERVICE

public static final java.lang.String ATT_NAME_SERVICE
Attribut of service : name

See Also:
Constant Field Values

ATT_CLASS_SERVICE

public static final java.lang.String ATT_CLASS_SERVICE
Attribut of service : class

See Also:
Constant Field Values

TAG_TYPE

public static final java.lang.String TAG_TYPE
TAG : ontologyType

See Also:
Constant Field Values

ATT_ID_TYPE

public static final java.lang.String ATT_ID_TYPE
Attribut of ontologyType : id

See Also:
Constant Field Values

ATT_NAME_TYPE

public static final java.lang.String ATT_NAME_TYPE
Attribut of ontologyType : name

See Also:
Constant Field Values

ATT_PARENTID_TYPE

public static final java.lang.String ATT_PARENTID_TYPE
Attribut of ontologyType : parentId

See Also:
Constant Field Values

ATT_CATEGORY_TYPE

public static final java.lang.String ATT_CATEGORY_TYPE
Attribut of ontologyType : category

See Also:
Constant Field Values

TAG_PARAM

public static final java.lang.String TAG_PARAM
TAG : parameter

See Also:
Constant Field Values

ATT_ID_PARAM

public static final java.lang.String ATT_ID_PARAM
Attribute of parameter : id

See Also:
Constant Field Values

ATT_NAME_PARAM

public static final java.lang.String ATT_NAME_PARAM
Attribute of parameter : name

See Also:
Constant Field Values

ATT_DESCRIPTION_PARAM

public static final java.lang.String ATT_DESCRIPTION_PARAM
Attribute of parameter : description

See Also:
Constant Field Values

ATT_KIND_PARAM

public static final java.lang.String ATT_KIND_PARAM
Attribute of parameter : kind

See Also:
Constant Field Values

LIST_INPUT_PARAM

public static final java.lang.String LIST_INPUT_PARAM
List of input parameters

See Also:
Constant Field Values

OUTPUT_PARAM

public static final java.lang.String OUTPUT_PARAM
Output parameter

See Also:
Constant Field Values
Method Detail

getInstance

public static ServicesManager getInstance()
Returns the shared instance

Returns:
the singleton

setEmptyServices

public void setEmptyServices()
Clears the private Map "services"


setEmptyTypes

public void setEmptyTypes()
Clears the private Map "types"


setEmptyParameters

public void setEmptyParameters()
Clears the private Map "parameters"


getAllServicesIds

public java.util.Set<java.lang.String> getAllServicesIds()
Gets all services ids

Returns:
Set : set of services Id

getAllTypesIds

public java.util.Set<java.lang.String> getAllTypesIds()
Gets all types ids

Returns:
Set : set of types Id

getAllParametersIds

public java.util.Set<java.lang.String> getAllParametersIds()
Gets all parameters ids

Returns:
Set : set of parameters Id

getAllServices

public java.util.Map<java.lang.String,Service> getAllServices()
Get all service ids with their description

Returns:
Map : key=services Id; value=Service

getAllParametersIn

public java.util.Map<java.lang.String,Parameter> getAllParametersIn()
Gets all parameters IDs with their description

Returns:
Map : key=parameters in Id; value=Parameter

getAllParametersOut

public java.util.Map<java.lang.String,Parameter> getAllParametersOut()
Gets all output parameters IDs with their description

Returns:
Map : key=parameters out Id; value=Parameter

getAllType

public java.util.Map<java.lang.String,Type> getAllType()
Gets all types IDs with their description

Returns:
Map : key=types in Id; value=Type

serviceId2Service

public Service serviceId2Service(java.lang.String serviceId)
Gives the Service corrresponding to an accurate service id from the private Map services

Parameters:
serviceId - : service Id
Returns:
Service corresponding to service id

typeId2Type

public Type typeId2Type(java.lang.String typeId)
Gives the Type corrresponding to a precise type id from the private Map types

Parameters:
typeId - : type id
Returns:
Type corresponding to type id

parameterId2Parameter

public Parameter parameterId2Parameter(java.lang.String paramId)
Gives the Parameter corrresponding to a precise parameter id from the private Map parameters

Parameters:
paramId - : parameter id
Returns:
Parameter corresponding to parameter id

serviceId2ServiceMap

public java.util.Map<java.lang.String,Service> serviceId2ServiceMap(java.lang.String serviceId)
Gives a Map (serviceId,Service) corrresponding to a precise service id from the private Map "services"

Parameters:
serviceId -
Returns:
key=serviceId, value=Service : only one line

typeId2TypeMap

public java.util.Map<java.lang.String,Type> typeId2TypeMap(java.lang.String typeId)
Gives a Map (typeId,Type) corrresponding to a precise service id from the private Map "types"

Parameters:
typeId -
Returns:
key=typeId, value=Type : only one line

parameterId2ParameterMap

public java.util.Map<java.lang.String,Parameter> parameterId2ParameterMap(java.lang.String parameterId)
Gives a Map (parameterId,Paramter) corrresponding to a precise service id from the private Map "paramters"

Parameters:
parameterId -
Returns:
key=parameterId, value=Paramter : only one line

serviceIds2ServiceMap

public java.util.Map<java.lang.String,Service> serviceIds2ServiceMap(java.util.Set<java.lang.String> serviceIds)
Gives Map (key=serviceId, value=Service) corresponding to the Set of serviceId

Parameters:
serviceIds - : Set (value = serviceId)
Returns:
Map (key=serviceId, value=Service)

serviceMapNotBasic

public java.util.Map<java.lang.String,Service> serviceMapNotBasic(java.util.Map<java.lang.String,Service> serviceMap)
Gives Map (key=serviceId, value=Service) from service Map without basic services

Parameters:
serviceMap - (key=serviceId, value=Service)
Returns:
Map (key=serviceId, value=Service) without basics Services

typeIds2TypeMap

public java.util.Map<java.lang.String,Type> typeIds2TypeMap(java.util.Set<java.lang.String> typeIds)
Gives Map (key=typeId, value=Type) corresponding to the Set of typeId

Parameters:
typeIds - : Set (value = typeId)
Returns:
Map (key=typeId, value=Type)

parameterIds2ParameterMap

public java.util.Map<java.lang.String,Parameter> parameterIds2ParameterMap(java.util.Set<java.lang.String> paramIds)
Gives Map (key=paramId, value=Parameter) corresponding to the Set of parameterIds

Parameters:
paramIds - : Set (value = paramId)
Returns:
Map (key=paramId, value=Parameter)

serviceId2TypeMap

public java.util.Map<java.lang.String,Type> serviceId2TypeMap(java.lang.String serviceId)
Returns the Map (key=type id; value=Type) corresponding to the service id

Parameters:
serviceId - : service id
Returns:
Map : key=type id; value=Type

serviceId2ParamOutMap

public java.util.Map<java.lang.String,Parameter> serviceId2ParamOutMap(java.lang.String serviceId)
Returns the Map (key=parameter id; value=Parameter) of input parameter corresponding to the service id

Parameters:
serviceId - : service id
Returns:
Map : key=parameter id; value=Parameter

serviceId2ParamInMap

public java.util.Map<java.lang.String,Parameter> serviceId2ParamInMap(java.lang.String serviceId)
Returns the Map (key=parameter id; value=Parameter) of input parameter corresponding to the service id

Parameters:
serviceId - : service id
Returns:
Map : key=parameter id; value=Parameter

typeName2TypeMap

public java.util.Map<java.lang.String,Type> typeName2TypeMap(java.lang.String typeName,
                                                             java.util.Map<java.lang.String,Type> listType)
Returns the Map (key=type id; value=Type) corresponding to the typeName

Parameters:
typeName - : type name
listType - : key=type id; value=Type
Returns:
Map (key=type id; value=Type)

parameterKind2ParameterMap

public java.util.Map<java.lang.String,Parameter> parameterKind2ParameterMap(java.lang.String parameterKind,
                                                                            java.util.Map<java.lang.String,Parameter> listParam)
Returns the Map (key=parameter id; value=Parameter) of (In or Out) parameter corresponding to the parameterKind

Parameters:
parameterKind - : parameter kind
listParam - : key=parameter id; value=Parameter
Returns:
Map (key=parameter id; value=Parameter)

getService

public IService getService(java.lang.String serviceId)
Returns IService from Service Id.

Parameters:
serviceId - the id of a service
Returns:
the associated service or null if the service is not found.

getService

public java.util.Map<java.lang.String,Service> getService(java.lang.String typeService,
                                                          java.util.Set<java.lang.String> listInputKind,
                                                          java.lang.String outputKind)
Returns Map corresponding to typeService, listInputKind, outputKind in all services on the bus

Parameters:
typeService - : service type
listInputKind - : kind input list (value = String)
outputKind - : kind output
Returns:
Map (key = IdService, value = Service) of all services corresponding to criteria : typeService, listInputKind, outputKind

getServicesWithCriteria

public java.util.Map<java.lang.String,Service> getServicesWithCriteria(java.util.Map<java.lang.String,Service> listService,
                                                                       java.lang.String typeName,
                                                                       java.lang.String paramInputKind,
                                                                       java.lang.String paramOutputKind)
Gets all services which have this "typeName", this "paramInputKind" and this "paramOutputKind" in parameters It is a filter on "type", on "input" and on "output"

Parameters:
listService - : Map where the filter is realized
typeName - : type name
paramInputKind - : input kind
paramOutputKind - : output kind
Returns:
a Map of all services which have this "typeName", this "paramInputKind" and this "paramOutputKind" : key = service id, value = Service

getListTypeId

public java.util.Set<java.lang.String> getListTypeId(java.util.Map<java.lang.String,Service> listService)
Gets the list of parameters ID from a list of services.
This list corresponds to all parameter used like input parameters in this "listService"

Parameters:
listService - : key=service id, value=Service
Returns:
Set of parameterId which are used like parameters input : value = parameter id

getListInputParamId

public java.util.Set<java.lang.String> getListInputParamId(java.util.Map<java.lang.String,Service> listService)
Gets list of parameters ID from a list of services.
This list corresponds to all parameters used like input parameters in this "listService"

Parameters:
listService - : key=service id, value=Service
Returns:
Set of parameterId which are used like parameters input : value = parameter id

getListOutputParamId

public java.util.Set<java.lang.String> getListOutputParamId(java.util.Map<java.lang.String,Service> listService)
Gets list of parameters ID from a list of services.
This list corresponds to all parameters used like input parameters in this "listService"

Parameters:
listService - : key=service id, value=Service
Returns:
Set of parameterId which are used like parameters input : value = parameter id

getListType

public java.util.Map<java.lang.String,Type> getListType(java.util.Map<java.lang.String,Service> listService)
Gets a Map of all Type which exist in the Services list

Parameters:
listService - : Services list
Returns:
a Map of all type . (key=idType, value=Type)

getListInput

public java.util.Map<java.lang.String,Parameter> getListInput(java.util.Map<java.lang.String,Service> listService)
Get a Map of all Input parameters which exist in the Services list

Parameters:
listService - : Services list
Returns:
a Map of all input parameter. (key=idParameter, value=Parameter)

getListOutput

public java.util.Map<java.lang.String,Parameter> getListOutput(java.util.Map<java.lang.String,Service> listService)
Gets a Map of all Output parameters which exists in the Service list

Parameters:
listService - : Services list
Returns:
a Map of all Output. (key=idParameter, value=Parameter)

getServicesPerType

public java.util.Map<java.lang.String,Service> getServicesPerType(java.lang.String typeName,
                                                                  java.util.Map<java.lang.String,Service> listService)
Gets all services which exist for the type "typeName" in the listService

Parameters:
typeName - : type name
listService - : services list (key=service id, value=Service)
Returns:
a Map of services. (key=service id, value=Service)

getServicesPerInput

public java.util.Map<java.lang.String,Service> getServicesPerInput(java.lang.String inputKind,
                                                                   java.util.Map<java.lang.String,Service> listService)
Gets all services which exist with this "input" in the listService

Parameters:
inputKind - : kind parameter input
listService - : services list (key=service id, value=Service)
Returns:
a Map of services. (key=service id, value=Service)

getServicesPerOutput

public java.util.Map<java.lang.String,Service> getServicesPerOutput(java.lang.String outputKind,
                                                                    java.util.Map<java.lang.String,Service> listService)
Get all services which exist with this "output" in the listService

Parameters:
outputKind - : kind parameter output
listService - : Services list (key=service id, value=Service)
Returns:
a Map of services. (key=service id, value=Service)

getRegisteredServicesOnBus

public java.util.Map<java.lang.String,Service> getRegisteredServicesOnBus()
Returns:
a Map of all Services using Services extension Point Full Map is the list for Administrator of project

getActiveServices

public java.util.Map<java.lang.String,Service> getActiveServices(java.util.Map<java.lang.String,Service> listService)
Return a list of all services which are activated ???? c'est le meme que getUsersAvailableServicesOnProject???

Parameters:
listService -
Returns:
a Map of all services which are activated

isBasicService

public static boolean isBasicService(java.lang.String serviceId)
This function is used to determine whether a service is a basic one or not

Parameters:
serviceId - the id of the service
Returns:
true is the service is a basic one, false otherwise

Bus

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.