org.ow2.dragon.service.deployment
Class TechServiceManagerImpl

java.lang.Object
  extended by org.ow2.dragon.service.deployment.TechServiceManagerImpl
All Implemented Interfaces:
TechServiceManager

public class TechServiceManagerImpl
extends java.lang.Object
implements TechServiceManager

Author:
ofabre - eBM WebSourcing

Constructor Summary
TechServiceManagerImpl()
           
 
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 options)
          Retrieve a list of tech services matching the given criteria for the given properties
 void setBindingDAO(BindingDAO bindingDAO)
           
 void setCommentDAO(CommentDAO commentDAO)
           
 void setEndpointDAO(EndpointDAO endpointDAO)
           
 void setMetadataService(MetadataService metadataService)
           
 void setServiceInterfaceDAO(ServiceInterfaceDAO serviceInterfaceDAO)
           
 void setServiceSpecificationDAO(ServiceSpecificationDAO serviceSpecificationDAO)
           
 void setTechnicalServiceUnifiedDAO(GenericUnifiedDAO<TechnicalService,java.lang.String> technicalServiceUnifiedDAO)
           
 void setTransfertObjectAssembler(TransfertObjectAssembler transfertObjectAssembler)
           
 void setUniversalUnifiedDAO(UniversalUnifiedDAO universalUnifiedDAO)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TechServiceManagerImpl

public TechServiceManagerImpl()
Method Detail

setCommentDAO

public void setCommentDAO(CommentDAO commentDAO)

createTechService

public java.lang.String createTechService(TechnicalServiceTO techServiceTO)
                                   throws DeploymentException
Description copied from interface: TechServiceManager
Add a new tech service in registry. Not implemented yet

Specified by:
createTechService in interface TechServiceManager
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

public java.util.List<TechnicalServiceTO> getAllTechServices(RequestOptionsTO requestOptionsTO)
Description copied from interface: TechServiceManager
Return the list of all tech services in the registry

Specified by:
getAllTechServices in interface TechServiceManager
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

public EndpointTO getEndpoint(java.lang.String techServiceName,
                              java.lang.String endpointName)
                       throws DeploymentException
Description copied from interface: TechServiceManager
Retrieve the endpoint with the given name, which is part of the tech service with the given name.

Specified by:
getEndpoint in interface TechServiceManager
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

public TechnicalServiceTO getTechService(java.lang.String techServiceId,
                                         java.lang.String user)
                                  throws DeploymentException
Description copied from interface: TechServiceManager
Retrieve an technical service matching the given ID

Specified by:
getTechService in interface TechServiceManager
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

public java.util.List<TechnicalServiceTO> loadServicesFromWSDL(java.lang.String[] servicesId,
                                                               RequestOptionsTO requestOptionsTO)
                                                        throws DeploymentException
Description copied from interface: TechServiceManager
Retrieve a list of tech services matching the given IDs

Specified by:
loadServicesFromWSDL in interface TechServiceManager
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

public void removeTechService(java.lang.String techServiceId)
                       throws DeploymentException
Description copied from interface: TechServiceManager
Remove the tech services matching the given ID from the registry

Specified by:
removeTechService in interface TechServiceManager
Parameters:
techServiceId - a tech service ID
Throws:
DeploymentException - if no service found for the given techService id

searchTechService

public java.util.List<TechnicalServiceTO> searchTechService(java.lang.String searchCriteria,
                                                            java.util.List<ServiceSearchProperties> searchedProperties,
                                                            RequestOptionsTO options)
                                                     throws DeploymentException
Description copied from interface: TechServiceManager
Retrieve a list of tech services matching the given criteria for the given properties

Specified by:
searchTechService in interface TechServiceManager
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
options - 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

setBindingDAO

public void setBindingDAO(BindingDAO bindingDAO)

setMetadataService

public void setMetadataService(MetadataService metadataService)

setServiceInterfaceDAO

public void setServiceInterfaceDAO(ServiceInterfaceDAO serviceInterfaceDAO)

setServiceSpecificationDAO

public void setServiceSpecificationDAO(ServiceSpecificationDAO serviceSpecificationDAO)

setTechnicalServiceUnifiedDAO

public void setTechnicalServiceUnifiedDAO(GenericUnifiedDAO<TechnicalService,java.lang.String> technicalServiceUnifiedDAO)

setTransfertObjectAssembler

public void setTransfertObjectAssembler(TransfertObjectAssembler transfertObjectAssembler)

updateTechService

public java.lang.String updateTechService(TechnicalServiceTO techServiceTO)
                                   throws DeploymentException
Description copied from interface: TechServiceManager
Update the tech service in the registry.

Specified by:
updateTechService in interface TechServiceManager
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

getRelatedDocContentAsString

public java.lang.String getRelatedDocContentAsString(java.lang.String relatedDocId)
                                              throws DeploymentException
Description copied from interface: TechServiceManager
Return the content of the specified related document as a String

Specified by:
getRelatedDocContentAsString in interface TechServiceManager
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

public java.io.InputStream getRelatedDocContent(java.lang.String relatedDocId)
                                         throws DeploymentException
Description copied from interface: TechServiceManager
Return the content of the specified related document as an InputStream

Specified by:
getRelatedDocContent in interface TechServiceManager
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

getRelatedDocsForTechServ

public java.util.List<SimpleFileTO> getRelatedDocsForTechServ(java.lang.String techServiceId)
                                                       throws DeploymentException
Description copied from interface: TechServiceManager
Return a List of SimpleFileTO that maps service related docs

Specified by:
getRelatedDocsForTechServ in interface TechServiceManager
Parameters:
techServiceId - a service id
Returns:
List of SimpleFileTO that maps service related docs
Throws:
DeploymentException - if an error occurs during related docs retrieval

registerRelatedDoc

public java.lang.String registerRelatedDoc(java.lang.String serviceId,
                                           java.lang.String mimetype,
                                           byte[] docContent,
                                           java.lang.String fileName)
                                    throws DeploymentException
Description copied from interface: TechServiceManager
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).

Specified by:
registerRelatedDoc in interface TechServiceManager
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

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

Specified by:
removeRelatedDoc in interface TechServiceManager
Parameters:
serviceId - a service identifier
documentId - a document identifier
Throws:
DeploymentException - if no service or document found for the given ids

addCategory

public void addCategory(java.lang.String techServiceId,
                        java.lang.String categoryId,
                        java.lang.String categoryValue,
                        java.lang.String categoryDesc)
                 throws DeploymentException
Description copied from interface: TechServiceManager
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.

Specified by:
addCategory in interface TechServiceManager
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

addCategory

public void addCategory(java.lang.String techServiceId,
                        java.lang.String categoryId,
                        java.lang.String categoryValueId)
                 throws DeploymentException
Description copied from interface: TechServiceManager
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.

Specified by:
addCategory in interface TechServiceManager
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

removeCategories

public void removeCategories(java.lang.String techServiceId,
                             java.util.List<java.lang.String> categoryIds)
                      throws DeploymentException
Description copied from interface: TechServiceManager
Remove the selected categories linked to a technical service

Specified by:
removeCategories in interface TechServiceManager
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

updateGlobalRating

public float updateGlobalRating(java.lang.String serviceId)
Description copied from interface: TechServiceManager
Calculate the global rating of a technical service.

Specified by:
updateGlobalRating in interface TechServiceManager
Parameters:
serviceId - the id of this service.

updateComments

public void updateComments(java.lang.String serviceId,
                           CommentTO comment)
Description copied from interface: TechServiceManager
Update the Comments of a techService.

Specified by:
updateComments in interface TechServiceManager
Parameters:
serviceId - The technical Service ID.
comment - The comment to add to this technical Service.

getTechServicesByTag

public java.util.List<TechnicalServiceTO> getTechServicesByTag(java.lang.String tag)
Description copied from interface: TechServiceManager
Get all Technical Services tagged by the String tag.

Specified by:
getTechServicesByTag in interface TechServiceManager
Parameters:
tag - the tag.
Returns:
Techservices related to tag.

removeTag

public void removeTag(java.lang.String tag,
                      java.lang.String serviceId)
Description copied from interface: TechServiceManager
Remove a String tag from the Technical Service.

Specified by:
removeTag in interface TechServiceManager
Parameters:
tag - The tag to remove from.
serviceId - The technical Service ID

removeComment

public void removeComment(java.lang.String serviceId,
                          java.lang.String commentId)
Description copied from interface: TechServiceManager
Remove a Comment from the endpoint.

Specified by:
removeComment in interface TechServiceManager
Parameters:
serviceId - The technical Service ID.

setUniversalUnifiedDAO

public void setUniversalUnifiedDAO(UniversalUnifiedDAO universalUnifiedDAO)

getCategoriesForTechServ

public java.util.List<KeyedRefTO> getCategoriesForTechServ(java.lang.String techServiceId)
                                                    throws DeploymentException
Description copied from interface: TechServiceManager
Return a List of KeyedRefTO that maps service related categories

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

setEndpointDAO

public void setEndpointDAO(EndpointDAO endpointDAO)


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.