org.ow2.dragon.api.service.deployment
Interface TechServiceManager

All Known Implementing Classes:
TechServiceManagerImpl

@Transactional
public interface TechServiceManager

A manager of tech services. Provides methods to create, retrieve, delete or update tech services, add or remove related docs, categories. Method arguments must be non null, unless the contrary is explicitly specified.

Author:
ambarthe, ofabre - eBM Websourcing

Method Summary
 void addCategory(java.lang.String techServiceId, java.lang.String categoryId, java.lang.String categoryValueId)
          Add a category to the given tech service.
 void addCategory(java.lang.String techServiceId, java.lang.String categoryId, java.lang.String categoryValue, java.lang.String categoryDesc)
          Add a category to the given tech service.
 java.lang.String createTechService(TechnicalServiceTO techServiceTO)
          Add a new tech service in registry.
 java.util.List<TechnicalServiceTO> getAllTechServices(RequestOptionsTO requestOptionsTO)
          Return the list of all tech services in the registry
 java.util.List<KeyedRefTO> getCategoriesForTechServ(java.lang.String techServiceId)
          Return a List of KeyedRefTO that maps service related categories
 EndpointTO getEndpoint(java.lang.String techServiceName, java.lang.String endpointName)
          Retrieve the endpoint with the given name, which is part of the tech service with the given name.
 java.io.InputStream getRelatedDocContent(java.lang.String relatedDocId)
          Return the content of the specified related document as an InputStream
 java.lang.String getRelatedDocContentAsString(java.lang.String relatedDocId)
          Return the content of the specified related document as a String
 java.util.List<SimpleFileTO> getRelatedDocsForTechServ(java.lang.String techServiceId)
          Return a List of SimpleFileTO that maps service related docs
 TechnicalServiceTO getTechService(java.lang.String techServiceId, java.lang.String user)
          Retrieve an technical service matching the given ID
 java.util.List<TechnicalServiceTO> getTechServicesByTag(java.lang.String tag)
          Get all Technical Services tagged by the String tag.
 java.util.List<TechnicalServiceTO> loadServicesFromWSDL(java.lang.String[] servicesId, RequestOptionsTO requestOptionsTO)
          Retrieve a list of tech services matching the given IDs
 java.lang.String registerRelatedDoc(java.lang.String serviceId, java.lang.String mimetype, byte[] docContent, java.lang.String fileName)
          Registers a new document in the registry (supported types are: DOC, PDF, XML, HTML, XLS, PPT, TXT, RTF, ODT, ODS, ODP).
 void removeCategories(java.lang.String techServiceId, java.util.List<java.lang.String> categoryIds)
          Remove the selected categories linked to a technical service
 void removeComment(java.lang.String serviceId, java.lang.String commentId)
          Remove a Comment from the endpoint.
 void removeRelatedDoc(java.lang.String serviceId, java.lang.String documentId)
          Remove a related document from the registry associate to the given service.
 void removeTag(java.lang.String tag, java.lang.String serviceId)
          Remove a String tag from the Technical Service.
 void removeTechService(java.lang.String techServiceId)
          Remove the tech services matching the given ID from the registry
 java.util.List<TechnicalServiceTO> searchTechService(java.lang.String searchCriteria, java.util.List<ServiceSearchProperties> searchedProperties, RequestOptionsTO iOptions)
          Retrieve a list of tech services matching the given criteria for the given properties
 void updateComments(java.lang.String serviceId, CommentTO comment)
          Update the Comments of a techService.
 float updateGlobalRating(java.lang.String serviceId)
          Calculate the global rating of a technical service.
 java.lang.String updateTechService(TechnicalServiceTO techServiceTO)
          Update the tech service in the registry.
 

Method Detail

createTechService

java.lang.String createTechService(TechnicalServiceTO techServiceTO)
                                   throws DeploymentException
Add a new tech service in registry. Not implemented yet

Parameters:
techServiceTO - the tech service to add
Returns:
the ID of the added tech service
Throws:
DeploymentException - if an error occurs during tech service creation

getAllTechServices

@Transactional(readOnly=true)
java.util.List<TechnicalServiceTO> getAllTechServices(RequestOptionsTO requestOptionsTO)
Return the list of all tech services in the registry

Parameters:
requestOptionsTO - sort, pagination and case sensitive parameters , could be null
Returns:
the List of all TechnicalServiceTO in the registry, not null, can be empty

getEndpoint

@Transactional(readOnly=true)
EndpointTO getEndpoint(java.lang.String techServiceName,
                                     java.lang.String endpointName)
                       throws DeploymentException
Retrieve the endpoint with the given name, which is part of the tech service with the given name.

Parameters:
techServiceName - A tech service name
endpointName - An endpoint name
Returns:
the EndpointTO with the given name, which is part of the tech service with the given name. Can be null
Throws:
DeploymentException - if an error occurs during endpoint retrieval

getTechService

@Transactional(readOnly=true)
TechnicalServiceTO getTechService(java.lang.String techServiceId,
                                                java.lang.String user)
                                  throws DeploymentException
Retrieve an technical service matching the given ID

Parameters:
techServiceId - a tech service ID
user - a user login. Will be used to retrieve related rating for this service. Can be null
Returns:
an TechnicalServiceTO matching the given ID
Throws:
DeploymentException - if no TechnicalService can be found for the given Id

loadServicesFromWSDL

@Transactional(readOnly=true)
java.util.List<TechnicalServiceTO> loadServicesFromWSDL(java.lang.String[] servicesId,
                                                                      RequestOptionsTO requestOptionsTO)
                                                        throws DeploymentException
Retrieve a list of tech services matching the given IDs

Parameters:
servicesId - a List of String service IDs
requestOptionsTO - sort, pagination and case sensitive parameters
Returns:
a List of TechnicalServiceTO matching the given IDs
Throws:
DeploymentException - if an error occurs during tech services retrieval

removeTechService

void removeTechService(java.lang.String techServiceId)
                       throws DeploymentException
Remove the tech services matching the given ID from the registry

Parameters:
techServiceId - a tech service ID
Throws:
DeploymentException - if no service found for the given techService id

searchTechService

@Transactional(readOnly=true)
java.util.List<TechnicalServiceTO> searchTechService(java.lang.String searchCriteria,
                                                                   java.util.List<ServiceSearchProperties> searchedProperties,
                                                                   RequestOptionsTO iOptions)
                                                     throws DeploymentException
Retrieve a list of tech services matching the given criteria for the given properties

Parameters:
searchCriteria - the search criteria (a String containing criteria separated with whitespaces), mustn't be empty
searchedProperties - the searched properties as a list of ServiceSearchProperties, mustn't be empty
iOptions - sort, pagination and case sensitive parameters. Could be null
Returns:
a List of TechnicalServiceTO matching the given criteria for the given properties
Throws:
DeploymentException - if you try to search services without specifying search criteria

updateTechService

java.lang.String updateTechService(TechnicalServiceTO techServiceTO)
                                   throws DeploymentException
Update the tech service in the registry.

Parameters:
techServiceTO - the tech service to update
Returns:
the ID of the updated tech service
Throws:
DeploymentException - if no service found for the given techServ id to update

getRelatedDocsForTechServ

java.util.List<SimpleFileTO> getRelatedDocsForTechServ(java.lang.String techServiceId)
                                                       throws DeploymentException
Return a List of SimpleFileTO that maps service related docs

Parameters:
techServiceId - a service id
Returns:
List of SimpleFileTO that maps service related docs
Throws:
DeploymentException - if an error occurs during related docs retrieval

getCategoriesForTechServ

java.util.List<KeyedRefTO> getCategoriesForTechServ(java.lang.String techServiceId)
                                                    throws DeploymentException
Return a List of KeyedRefTO that maps service related categories

Parameters:
techServiceId - a service id
Returns:
List of KeyedRefTO that maps service related categories
Throws:
DeploymentException - if the given service doesn't exist

getRelatedDocContentAsString

java.lang.String getRelatedDocContentAsString(java.lang.String relatedDocId)
                                              throws DeploymentException
Return the content of the specified related document as a String

Parameters:
relatedDocId - a document id
Returns:
the content of the specified related document as a String
Throws:
DeploymentException - if an error occurs during related doc content retrieval

getRelatedDocContent

java.io.InputStream getRelatedDocContent(java.lang.String relatedDocId)
                                         throws DeploymentException
Return the content of the specified related document as an InputStream

Parameters:
relatedDocId - a document id
Returns:
the content of the specified related document as an InputStream
Throws:
DeploymentException - if no document found for the given id or if the document content can't be loaded

registerRelatedDoc

java.lang.String registerRelatedDoc(java.lang.String serviceId,
                                    java.lang.String mimetype,
                                    byte[] docContent,
                                    java.lang.String fileName)
                                    throws DeploymentException
Registers a new document in the registry (supported types are: DOC, PDF, XML, HTML, XLS, PPT, TXT, RTF, ODT, ODS, ODP). Indexes its content. Links it to the given service (denoted by the given serviceId).

Parameters:
serviceId - a TechnicalService identifier
mimetype - a mimetype (supported Mimetypes are : application/msword, application/pdf, text/html, text/xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, text/plain, application/rtf, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.presentation). See ContentType for supported content types
docContent - the content of the document as a byte array.
fileName - the file name, could be null
Returns:
the created file identifier
Throws:
DeploymentException - if no TechnicalService found for the given serviceId or if the document can't be registered or indexed

removeRelatedDoc

void removeRelatedDoc(java.lang.String serviceId,
                      java.lang.String documentId)
                      throws DeploymentException
Remove a related document from the registry associate to the given service. Service and document are denoted by the given identifiers

Parameters:
serviceId - a service identifier
documentId - a document identifier
Throws:
DeploymentException - if no service or document found for the given ids

removeCategories

void removeCategories(java.lang.String techServiceId,
                      java.util.List<java.lang.String> categoryIds)
                      throws DeploymentException
Remove the selected categories linked to a technical service

Parameters:
techServiceId - a service identifier
categoryIds - ids of categories to remove, can be empty
Throws:
DeploymentException - if no service found for the given id or if no category found for the given ids

addCategory

void addCategory(java.lang.String techServiceId,
                 java.lang.String categoryId,
                 java.lang.String categoryValueId)
                 throws DeploymentException
Add a category to the given tech service. The added category is of the type of the category denoted by the categoryId argument and the selected value is denoted by the categoryValueId argument.

Parameters:
techServiceId - a TechnicalService id
categoryId - a Category id
categoryValueId - an identifier of a CategoryValue containing category info to add.
Throws:
DeploymentException - if at least one of the given id doesn't exist in database or if you try to add the same category twice

addCategory

void addCategory(java.lang.String techServiceId,
                 java.lang.String categoryId,
                 java.lang.String categoryValue,
                 java.lang.String categoryDesc)
                 throws DeploymentException
Add a category to the given tech service. The added category is of the type of the category denoted by the categoryId argument and the selected value is denoted by the categoryValueId argument.

Parameters:
techServiceId - a TechnicalService id
categoryId - a Category id
categoryValue - a category value (UDDI: categoryValue)
categoryDesc - a category description (UDDI: categoryName). Could be null
Throws:
DeploymentException - if at least one of the given id doesn't exist in database or if you try to add the same category twice

updateGlobalRating

float updateGlobalRating(java.lang.String serviceId)
Calculate the global rating of a technical service.

Parameters:
serviceId - the id of this service.

updateComments

void updateComments(java.lang.String serviceId,
                    CommentTO comment)
Update the Comments of a techService.

Parameters:
serviceId - The technical Service ID.
comment - The comment to add to this technical Service.

getTechServicesByTag

java.util.List<TechnicalServiceTO> getTechServicesByTag(java.lang.String tag)
Get all Technical Services tagged by the String tag.

Parameters:
tag - the tag.
Returns:
Techservices related to tag.

removeTag

void removeTag(java.lang.String tag,
               java.lang.String serviceId)
Remove a String tag from the Technical Service.

Parameters:
serviceId - The technical Service ID
tag - The tag to remove from.

removeComment

void removeComment(java.lang.String serviceId,
                   java.lang.String commentId)
Remove a Comment from the endpoint.

Parameters:
serviceId - The technical Service ID.
commentID - The EndPoint ID.


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.