org.figure8.join.services.scripting.ant.tasks
Class RemoteServiceTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
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 :
- url : The url for connecting to Join remote service (in
case ot no url in context),
- user : The user for connecting to Join remote service (in
case of no security token in context),
- password : The password for connecting to Join remote service
(in case of no security token in context).
- 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 |
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 |
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
RemoteServiceTask
public RemoteServiceTask()
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 AuthenticatedServiceserviceClass
- 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 :
- first check if such a token is in project context (join.security.token user property).
It assumes the login has already been done,
- if not present try getting user and password first from global system properties
(join.security.user and join.security.password) and login to the service,
- get user and password from this task attributes and login to the service.
- 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 fromtoken
- The security token to use for logging out.
Copyright © 2005-2008 Join. All Rights Reserved.