public class Authenticate
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
Authenticate.HostPort
A convenience inner class that stores the host and the port associated
with a server.
|
Modifier and Type | Field and Description |
---|---|
static int |
GRID_FTP_STANDARD_PORT
The standard port at which Grid FTP runs.
|
private AuthenticateRequest |
mAuthRequest
The object containing the authenticate request.
|
private org.ietf.jgss.GSSCredential |
mCredential
The credential to be used while authentication to jobmanager.
|
private LogManager |
mLogger
The handle to the LogManager object.
|
private PoolInfoProvider |
mPoolHandle
The handle to the Pool Info Provider.
|
private PegasusProperties |
mProps
The handle to the PegasusProperties object.
|
private int |
mTimeout
The timeout value that is to be used in milliseconds
|
static int |
TIMEOUT_VALUE
The timeout in seconds.
|
Constructor and Description |
---|
Authenticate(PegasusProperties properties,
PoolInfoProvider poolHandle)
The overloaded constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(AuthenticateRequest ar)
Authenticates against a resource referred to in the authenticate request
object.
|
boolean |
authenticateJobManager(java.lang.String contact)
It authenticates against the jobmanager specifyied.
|
private java.lang.String |
combine(java.lang.String host,
int port)
A small helper method that returns the standard host and port
combination to be used for logging purposes.
|
private Authenticate.HostPort |
getHostPort(java.lang.String urlPrefix)
Determines the hostname from the urlPrefix string in the pool file.
|
boolean |
gridFTPAlive(java.lang.String host,
int port)
It checks with a grid ftp server running at a particular host
and port, to see if it is up or not.
|
static void |
main(java.lang.String[] args) |
private boolean |
parseGridFTPResponse(java.lang.String response,
char type)
The parses the grid ftp server response and returns if the response
was valid or not.
|
boolean |
removeResource(AuthenticateRequest ar)
It tries to remove a resource from the soft state of the pool.
|
void |
setCredential(org.ietf.jgss.GSSCredential credential)
Sets the credential that has to be used for authentication.
|
public static final int GRID_FTP_STANDARD_PORT
public static final int TIMEOUT_VALUE
private int mTimeout
private AuthenticateRequest mAuthRequest
private PoolInfoProvider mPoolHandle
private LogManager mLogger
private PegasusProperties mProps
private org.ietf.jgss.GSSCredential mCredential
public Authenticate(PegasusProperties properties, PoolInfoProvider poolHandle)
properties
- the PegasusProperties
to be used.public void setCredential(org.ietf.jgss.GSSCredential credential)
credential
- the credential to be set.public boolean authenticate(AuthenticateRequest ar)
public boolean removeResource(AuthenticateRequest ar)
ar
- the AuthenticateRequest containing the resource infopublic boolean authenticateJobManager(java.lang.String contact)
contact
- the jobmanager contact.public boolean gridFTPAlive(java.lang.String host, int port)
host
- the host at which the gridftp server is running .port
- the port at which server is running on the host.private boolean parseGridFTPResponse(java.lang.String response, char type)
response
- the response got from the grid ftp server.type
- c response when first connected to server.
q response when sent the quit command.private java.lang.String combine(java.lang.String host, int port)
host
- the host.port
- the port.private Authenticate.HostPort getHostPort(java.lang.String urlPrefix)
urlPrefix
- the protocol, hostname and port combination.public static void main(java.lang.String[] args)