no.ubicollab.osgi
Class CollaborationImpl

java.lang.Object
  extended by no.ubicollab.osgi.CollaborationImpl
All Implemented Interfaces:
CollaborationService

public class CollaborationImpl
extends java.lang.Object
implements CollaborationService


Constructor Summary
CollaborationImpl()
           
 
Method Summary
 boolean addPersonToCollabInst(java.lang.String collabInstId, java.lang.String username)
          Adds a specified person to the specified collaboration instance
 boolean addResourceToCollabInst(java.lang.String collabInstId, java.lang.String descriptionUrl, java.lang.String username, java.lang.String appName, java.lang.String fileName)
           
 boolean addServiceToCollabInst(java.lang.String collabInstId, java.lang.String descriptionUrl)
          Adds a specified service to the specified collaboration instance
 java.lang.String createCollaborationInstance(java.lang.String username, java.lang.String collabInstName)
          Creates a collaboration instance with the specified collabInstName, and where the creator is specified by username.
 java.lang.String[] getAllCollaborationInstances()
          Gets a list of all registered collaboration instances
 java.lang.String[] getAllPersons()
          Gets a list of all registered persons
 java.lang.String[] getAllPersonsInCollabInst(java.lang.String collabInstId)
          Gets a list of all persons in the specified collaboration instance
 java.lang.String[] getAllServices()
          Gets a list of all registered services
 java.lang.String[] getAllServicesInCollabInst(java.lang.String collabInstId)
          Gets a list of all services in the specified collaboration instance
 java.lang.String getCollabInstName(java.lang.String collabInstId)
          Gets the name of the specified collaboration instance
 java.lang.String[] getInfoAboutService(java.lang.String url)
          Gets all registered information about the specified service
 java.lang.String getPersonsFullName(java.lang.String username)
          Gets the full name of the specified person
 boolean removeCollaborationInstance(java.lang.String collabInstId, java.lang.String username)
          Removes a specified collaboration instance, if the username specified matches the collaboration instance's owner.
 boolean removePersonFromCollabInst(java.lang.String collabInstId, java.lang.String username)
          Removes a specified person from the specified collaboration instance
 boolean removeResourceFromCollabInst(java.lang.String collabInstId, java.lang.String descriptionUrl, java.lang.String username, java.lang.String appName, java.lang.String fileName)
           
 boolean removeServiceFromCollabInst(java.lang.String collabInstId, java.lang.String descriptionUrl)
          Removes a specified service from the specified collaboration instance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollaborationImpl

public CollaborationImpl()
Method Detail

createCollaborationInstance

public java.lang.String createCollaborationInstance(java.lang.String username,
                                                    java.lang.String collabInstName)
Description copied from interface: CollaborationService
Creates a collaboration instance with the specified collabInstName, and where the creator is specified by username.

Specified by:
createCollaborationInstance in interface CollaborationService
Parameters:
username - The username of the collaboration instance's creator
collabInstName - The name of the collaboration instance to create
Returns:
A unique hash representing the collab inst id

removeCollaborationInstance

public boolean removeCollaborationInstance(java.lang.String collabInstId,
                                           java.lang.String username)
Description copied from interface: CollaborationService
Removes a specified collaboration instance, if the username specified matches the collaboration instance's owner.

Specified by:
removeCollaborationInstance in interface CollaborationService
Parameters:
collabInstId - The id of the collaboration instance to remove
username - The username of the person calling the method
Returns:
True if the specified collab inst was removed, false otherwise

addPersonToCollabInst

public boolean addPersonToCollabInst(java.lang.String collabInstId,
                                     java.lang.String username)
Description copied from interface: CollaborationService
Adds a specified person to the specified collaboration instance

Specified by:
addPersonToCollabInst in interface CollaborationService
Parameters:
collabInstId - The id of the collaboration instance to add to
username - The username of the person to add
Returns:
True if the person was added to the collab inst, false otherwise

removePersonFromCollabInst

public boolean removePersonFromCollabInst(java.lang.String collabInstId,
                                          java.lang.String username)
Description copied from interface: CollaborationService
Removes a specified person from the specified collaboration instance

Specified by:
removePersonFromCollabInst in interface CollaborationService
Parameters:
collabInstId - The id of the collaboration instance to remove from
username - The username of the person to remove
Returns:
True if the person was removed from the collab inst, false otherwise

addServiceToCollabInst

public boolean addServiceToCollabInst(java.lang.String collabInstId,
                                      java.lang.String descriptionUrl)
Description copied from interface: CollaborationService
Adds a specified service to the specified collaboration instance

Specified by:
addServiceToCollabInst in interface CollaborationService
Parameters:
collabInstId - The id of the collaboration instance to add to
descriptionUrl - The descriptionUrl of the service to add
Returns:
True if the service was added to the collab inst, false otherwise

removeServiceFromCollabInst

public boolean removeServiceFromCollabInst(java.lang.String collabInstId,
                                           java.lang.String descriptionUrl)
Description copied from interface: CollaborationService
Removes a specified service from the specified collaboration instance

Specified by:
removeServiceFromCollabInst in interface CollaborationService
Parameters:
collabInstId - The id of the collaboration instance to remove from
descriptionUrl - The descriptionUrl of the service to remove
Returns:
True if the service was removed from the collab inst, false otherwise

addResourceToCollabInst

public boolean addResourceToCollabInst(java.lang.String collabInstId,
                                       java.lang.String descriptionUrl,
                                       java.lang.String username,
                                       java.lang.String appName,
                                       java.lang.String fileName)
Specified by:
addResourceToCollabInst in interface CollaborationService
Returns:

removeResourceFromCollabInst

public boolean removeResourceFromCollabInst(java.lang.String collabInstId,
                                            java.lang.String descriptionUrl,
                                            java.lang.String username,
                                            java.lang.String appName,
                                            java.lang.String fileName)
Specified by:
removeResourceFromCollabInst in interface CollaborationService
Returns:

getAllCollaborationInstances

public java.lang.String[] getAllCollaborationInstances()
Description copied from interface: CollaborationService
Gets a list of all registered collaboration instances

Specified by:
getAllCollaborationInstances in interface CollaborationService
Returns:
A String[] with the id's of all registered collaboration instances

getAllPersons

public java.lang.String[] getAllPersons()
Description copied from interface: CollaborationService
Gets a list of all registered persons

Specified by:
getAllPersons in interface CollaborationService
Returns:
A String[] with the usernames of all registered persons

getAllServices

public java.lang.String[] getAllServices()
Description copied from interface: CollaborationService
Gets a list of all registered services

Specified by:
getAllServices in interface CollaborationService
Returns:
A String[] with the descriptionUrl's of all registered services

getAllPersonsInCollabInst

public java.lang.String[] getAllPersonsInCollabInst(java.lang.String collabInstId)
Description copied from interface: CollaborationService
Gets a list of all persons in the specified collaboration instance

Specified by:
getAllPersonsInCollabInst in interface CollaborationService
Parameters:
collabInstId - The id of the collaboration instance
Returns:
A String[] with the usernames of all persons in the collaboration instance

getAllServicesInCollabInst

public java.lang.String[] getAllServicesInCollabInst(java.lang.String collabInstId)
Description copied from interface: CollaborationService
Gets a list of all services in the specified collaboration instance

Specified by:
getAllServicesInCollabInst in interface CollaborationService
Parameters:
collabInstId - The id of the collaboration instance
Returns:
A String[] with the descriptionUrl's of all services in the collaboration instance

getCollabInstName

public java.lang.String getCollabInstName(java.lang.String collabInstId)
Description copied from interface: CollaborationService
Gets the name of the specified collaboration instance

Specified by:
getCollabInstName in interface CollaborationService
Parameters:
collabInstId - The id of the collaboration instance
Returns:
The name of the collaboration instance

getPersonsFullName

public java.lang.String getPersonsFullName(java.lang.String username)
Description copied from interface: CollaborationService
Gets the full name of the specified person

Specified by:
getPersonsFullName in interface CollaborationService
Parameters:
username - The person's username
Returns:
The person's full name

getInfoAboutService

public java.lang.String[] getInfoAboutService(java.lang.String url)
Description copied from interface: CollaborationService
Gets all registered information about the specified service

Specified by:
getInfoAboutService in interface CollaborationService
Parameters:
url - The descriptionUrl of the service
Returns:
A String[] with a length of 10, with the fields: dbId, tagId, uuId, name, type, protocol, descriptionUrl, serviceUrl, owner, discovered.