org.figure8.join.services.remoting.xmlrpc
Class DefaultXmlRpcHandler

java.lang.Object
  extended by org.figure8.join.services.remoting.xmlrpc.DefaultXmlRpcHandler
All Implemented Interfaces:
XmlRpcHandler

public class DefaultXmlRpcHandler
extends java.lang.Object
implements XmlRpcHandler

This is the default implementation of XmlRcpHandler

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux

Constructor Summary
DefaultXmlRpcHandler()
          Creates a new instance of DefaultXmlRpcHandler
 
Method Summary
 boolean bindComponent(java.lang.String token, java.lang.String typeKey, java.lang.String versionInfo, long size, java.lang.String assemblyKey)
          Bind a component to a given assembly.
 boolean createResourceVersion(java.lang.String token, java.lang.String versionName, java.lang.String versionDescription, java.lang.String resourceTypeKey)
          Create a new resource version for a specified resource type.
 java.util.List getDeliverableTypes(java.lang.String token)
          Retrieve all the deliverable categories (or types) managed within the project.
 java.util.List getDeliverableTypesForDelivery(java.lang.String token)
          Get the deliverable categories where authenticated user can supply deliverables for.
 java.util.List getReleases(java.lang.String token)
          Retrieve all the releases managed within the project.
 java.lang.String login(java.lang.String username, java.lang.String password)
          Authenticates a remote user onto Join application.
 boolean logout(java.lang.String token)
          Logs out from Join application the user corresponding to the supplied token.
 void setArtifactService(ArtifactService service)
           
 boolean setAssemblyStatus(java.lang.String token, java.lang.String statusKey, java.lang.String assemblyKey)
          Set the specified status to a specified Assembly.
 boolean setBuildStatus(java.lang.String token, java.lang.String statusKey, java.lang.String buildKey)
          Set the specified status to a specified Build.
 boolean setDeploymentStatus(java.lang.String token, java.lang.String statusKey, java.lang.String deploymentId)
          Set the specified status to a specified Deployment.
 void setProcessControlService(ProcessControlService service)
           
 void setResourceService(ResourceService service)
           
 boolean supplyDeliverable(java.lang.String token, java.lang.String releaseName, java.lang.String typeKey, java.lang.String versionInfo, java.lang.String comments, byte[] content)
          Supply a new deliverable using the remote wrapper.
 boolean updateResource(java.lang.String token, java.lang.String resourceName, java.lang.String versionName)
          Update an existing resource with an existing reosurce version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultXmlRpcHandler

public DefaultXmlRpcHandler()
Creates a new instance of DefaultXmlRpcHandler

Method Detail

setArtifactService

public void setArtifactService(ArtifactService service)
Parameters:
service - The ArtifactService implementation to use

setResourceService

public void setResourceService(ResourceService service)
Parameters:
service - The ResourceService implementation to use

setProcessControlService

public void setProcessControlService(ProcessControlService service)
Parameters:
service - The ProcessControlService implementation to use

login

public java.lang.String login(java.lang.String username,
                              java.lang.String password)
                       throws InvalidLoginException,
                              java.rmi.RemoteException
Authenticates a remote user onto Join application. In case of successfull authentication, this method returns a token that should be used later as a parameter for calling services required authorization.

Specified by:
login in interface XmlRpcHandler
Parameters:
username - Login of user for authentication
password - Password of corresponding user
Returns:
An authentication token to reuse later during service call
Throws:
InvalidLoginException - if user cannot be logged
java.rmi.RemoteException - if an exception occurs during the remote conversation

logout

public boolean logout(java.lang.String token)
               throws java.rmi.RemoteException
Logs out from Join application the user corresponding to the supplied token.

Specified by:
logout in interface XmlRpcHandler
Parameters:
token - An authentication token obtained with login() method.
Returns:
Wether this operation is successfull
Throws:
java.rmi.RemoteException - if an exception occurs during the remote conversation

getReleases

public java.util.List getReleases(java.lang.String token)
                           throws InvalidSessionException,
                                  java.rmi.RemoteException
Retrieve all the releases managed within the project.

Specified by:
getReleases in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
Returns:
An array representing RemoteRelease objects
Throws:
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation

getDeliverableTypes

public java.util.List getDeliverableTypes(java.lang.String token)
                                   throws InvalidSessionException,
                                          java.rmi.RemoteException
Retrieve all the deliverable categories (or types) managed within the project.

Specified by:
getDeliverableTypes in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
Returns:
An array representing RemoteDeliverableType objects
Throws:
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation

getDeliverableTypesForDelivery

public java.util.List getDeliverableTypesForDelivery(java.lang.String token)
                                              throws InvalidSessionException,
                                                     java.rmi.RemoteException
Get the deliverable categories where authenticated user can supply deliverables for.

Specified by:
getDeliverableTypesForDelivery in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
Returns:
An array representing RemoteDeliverableType objects for deliverables supplying
Throws:
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation

supplyDeliverable

public boolean supplyDeliverable(java.lang.String token,
                                 java.lang.String releaseName,
                                 java.lang.String typeKey,
                                 java.lang.String versionInfo,
                                 java.lang.String comments,
                                 byte[] content)
                          throws InvalidParameterException,
                                 DuplicateEntityException,
                                 InvalidSessionException,
                                 java.rmi.RemoteException
Supply a new deliverable using the remote wrapper. This wrapper must contains release and type informations. This delivery may include a File object as deliverable content if deliverables from this type are not retrieved using direct VCS or SCM connection.

Specified by:
supplyDeliverable in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
releaseName - The unique name of Release to supply a deliverable for
typeKey - The unique key of deliverable type this delivery will be bound to
versionInfo - The version info (or VCS tag info) for this delivery
comments - The comments on deliverable creation
content - The deliverable content if not VCS deliverable
Returns:
Wether this operation is successfull
Throws:
InvalidParameterException - if deliverable is already registered or parameter is missing
DuplicateEntityException - if another deliverable with same key already exists
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation

bindComponent

public boolean bindComponent(java.lang.String token,
                             java.lang.String typeKey,
                             java.lang.String versionInfo,
                             long size,
                             java.lang.String assemblyKey)
                      throws InvalidParameterException,
                             InvalidSessionException,
                             java.rmi.RemoteException
Bind a component to a given assembly.

Specified by:
bindComponent in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
typeKey - The unique key of component type this component will be bound to
versionInfo - The version info for this component
size - The size in bytes of this component
assemblyKey - The key of assembly to bind component to
Returns:
Wether this operation is successfull
Throws:
InvalidParameterException - if parameter is missing
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation

setBuildStatus

public boolean setBuildStatus(java.lang.String token,
                              java.lang.String statusKey,
                              java.lang.String buildKey)
                       throws InvalidSessionException,
                              java.rmi.RemoteException
Set the specified status to a specified Build.

Specified by:
setBuildStatus in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
statusKey - Unique key idenitifer of the status to set to build
buildKey - The unique key idenitifer of Build to update status
Returns:
Wether this operation is successfull
Throws:
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation

setAssemblyStatus

public boolean setAssemblyStatus(java.lang.String token,
                                 java.lang.String statusKey,
                                 java.lang.String assemblyKey)
                          throws InvalidSessionException,
                                 java.rmi.RemoteException
Set the specified status to a specified Assembly.

Specified by:
setAssemblyStatus in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
statusKey - Unique key idenitifer of the status to set to assembly
assemblyKey - The unique key idenitifer of Assembly to update status
Returns:
Wether this operation is successfull
Throws:
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation

setDeploymentStatus

public boolean setDeploymentStatus(java.lang.String token,
                                   java.lang.String statusKey,
                                   java.lang.String deploymentId)
                            throws InvalidSessionException,
                                   java.lang.NumberFormatException,
                                   java.rmi.RemoteException
Set the specified status to a specified Deployment.

Specified by:
setDeploymentStatus in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
statusKey - Unique key idenitifer of the status to set to deployment
deploymentId - The unique identifier of Deployment to retrieve status for
Returns:
Wether this operation is successfull
Throws:
InvalidSessionException - if user has no valid session on server-side
java.lang.NumberFormatException - if deploymentId does not represent a long
java.rmi.RemoteException - if an exception occurs during the remote conversation

createResourceVersion

public boolean createResourceVersion(java.lang.String token,
                                     java.lang.String versionName,
                                     java.lang.String versionDescription,
                                     java.lang.String resourceTypeKey)
                              throws InvalidParameterException,
                                     DuplicateEntityException,
                                     InvalidSessionException,
                                     java.rmi.RemoteException
Create a new resource version for a specified resource type. This operation reqires a valid authentication done first and the permissions corresponding to Joiner security role.

Specified by:
createResourceVersion in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
versionName - The name of the resource version to create
versionDescription - The description of resource version to create
resourceTypeKey - The key of resource type this version applies to
Returns:
Wether this operation is successfull
Throws:
InvalidParameterException - if parameter is missing
DuplicateEntityException - if another version with same name already exists
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation

updateResource

public boolean updateResource(java.lang.String token,
                              java.lang.String resourceName,
                              java.lang.String versionName)
                       throws InvalidParameterException,
                              InvalidSessionException,
                              java.rmi.RemoteException
Update an existing resource with an existing reosurce version. Resource and version are specified using their names that should be unique within Join system. This operations requires a valid authentication done first and the persmissions corresponding to Joiner security role.

Specified by:
updateResource in interface XmlRpcHandler
Parameters:
token - Authentication token provided earlier by login() method
resourceName - The unique name of the resource to update
versionName - The unique name of the version to update resource with
Returns:
Wether this operation is successfull
Throws:
InvalidParameterException - if one of supplied parameters is invalid
InvalidSessionException - if user has no valid session on server-side
java.rmi.RemoteException - if an exception occurs during the remote conversation


Copyright © 2005-2008 Join. All Rights Reserved.