org.figure8.join.services.scripting.ant.tasks
Class RemoteServiceTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.figure8.join.services.scripting.ant.tasks.RemoteServiceTask
Direct Known Subclasses:
BindComponentTask, LogStatusTask, SubstituteParametersTask

public abstract class RemoteServiceTask
extends org.apache.tools.ant.Task

This is an abstract Ant task providing utility methods for accessing Join remote service. This task provides 3 optional attributes :

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux

Field Summary
static java.lang.String REMOTE_URL_SUBCONTEXT
          Constant representing the subcontext url whithin Join web site for accessing remote services.
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
RemoteServiceTask()
           
 
Method Summary
 java.lang.String getPassword()
           
 java.lang.String getUrl()
           
 java.lang.String getUser()
           
protected  java.lang.String loginToRemoteService(AuthenticatedService service)
          Log to remote service if necessary before starting working with it.
protected  void releaseRemoteService(AuthenticatedService service, java.lang.String token)
          Release the connection onto remote authenticated service.
protected  AuthenticatedService retrieveRemoteService(java.lang.String name, java.lang.Class serviceClass)
          Retrieve a remote AuthenticatedService using a connection url.
 void setPassword(java.lang.String password)
           
 void setUrl(java.lang.String url)
           
 void setUser(java.lang.String user)
           
 
Methods inherited from class org.apache.tools.ant.Task
execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REMOTE_URL_SUBCONTEXT

public static final java.lang.String REMOTE_URL_SUBCONTEXT
Constant representing the subcontext url whithin Join web site for accessing remote services.

See Also:
Constant Field Values
Constructor Detail

RemoteServiceTask

public RemoteServiceTask()
Method Detail

getUrl

public java.lang.String getUrl()
Returns:
The url for connecting to Join remote service

setUrl

public void setUrl(java.lang.String url)
Parameters:
url - The url for connecting to Join remote service

getUser

public java.lang.String getUser()
Returns:
The user for connecting to Join remote service

setUser

public void setUser(java.lang.String user)
Parameters:
user - The user for connecting to Join remote service

getPassword

public java.lang.String getPassword()
Returns:
The password for connecting to Join remote service

setPassword

public void setPassword(java.lang.String password)
Parameters:
password - The password for connecting to Join remote service

retrieveRemoteService

protected AuthenticatedService retrieveRemoteService(java.lang.String name,
                                                     java.lang.Class serviceClass)
                                              throws org.apache.tools.ant.BuildException
Retrieve a remote AuthenticatedService using a connection url. The connection url retrieval strategy is the following : first check if there's an url into project user properties (join.url property), if not present check if it is defined as a global system property, finally use the url attribute of this Task.

Parameters:
name - The name of the AuthenticatedService
serviceClass - The class representing the service interface
Returns:
A handler onto remote service needing authentication
Throws:
org.apache.tools.ant.BuildException - if remote service cannot be acquired (connection problem, etc...)

loginToRemoteService

protected java.lang.String loginToRemoteService(AuthenticatedService service)
                                         throws InvalidLoginException,
                                                java.rmi.RemoteException
Log to remote service if necessary before starting working with it. This method returns the security token associated with session. It is retrieved with the following strategy :

Parameters:
service - The remote service to retrieve a security token for
Returns:
The security token for the established session
Throws:
InvalidLoginException
java.rmi.RemoteException

releaseRemoteService

protected void releaseRemoteService(AuthenticatedService service,
                                    java.lang.String token)
Release the connection onto remote authenticated service. The logout operation is only called if the token is not first retrieved from context (context tokens are permanent).

Parameters:
service - The remote service to logout from
token - The security token to use for logging out.


Copyright © 2005-2008 Join. All Rights Reserved.