com.platform.ego
Interface Client


public interface Client

The interface provides a mechanism to control one session with EGO.

A client can either be registered or unregistered. Unregistered clients can do information queries, such as: (i) host information, (ii) consumer information, (iii) registered client lookup. Registered clients have additional functionalities such as: (1) resource allocation (2) container execution (3) others can look up the client via VEM.

Version:
1.2.3

Method Summary
 Allocation allocate(AllocRequest req, AllocationCallbackHandler handler)
          This operation is used by an EGO client to make a request for resources.
 Allocation[] getAllocations()
          Get allocations of client.
 ClusterAdmin getClusterAdmin()
          Get admin of cluster.
 Connection getConn()
          Get connection.
 ConsumerAdmin getConsumerAdmin()
          Get admin of consumer.
 ConsumerPlan getConsumerPlan(java.lang.String consumerName, java.lang.String resourceGroupName)
          Get Consumer Plan for the given consumer and resource group.
 java.lang.String getDescription()
          Get description of client.
 ClientInfoProvider getInfoProvider()
          Get information provider.
 java.lang.String getLocation()
          Get location of client.
 java.lang.String getName()
          Get name of client.
 Service getService(java.lang.String servicename, ServiceCallbackHandler handler)
          Get an existing service.
 UserAdmin getUserAdmin()
          Get admin of user.
 java.lang.String getUserName()
          Get name of user.
 void logoff()
          Logs off EGO and removes credential.
 java.lang.String logon(java.lang.String cred)
          Logs on to EGO by credential.
 java.lang.String logon(java.lang.String username, java.lang.String passwd)
          Logs on to EGO by using name of user and password.
 java.lang.String refreshCredential()
          Refresh credential.
 void register(ClientCallbackHandler handler)
          Registers the client with EGO master.
 void reRegister()
          reRegister to EGO through WSG, Usually happens after WSG failover;
 void setPlanCacheExpiryTime(long seconds)
          Set the expiry time (in seconds) of the Consumer Plan cache.
 void unregister()
          Unregister the client with EGO master.
 void unsubscribeService(Service service)
          Unsubscribe a service.
 

Method Detail

logon

java.lang.String logon(java.lang.String username,
                       java.lang.String passwd)
                       throws EGOException,
                              javax.xml.stream.XMLStreamException,
                              org.apache.xmlbeans.XmlException
Logs on to EGO by using name of user and password.

Parameters:
username - : specifies name of user.
passwd - : specifies password of user.
Returns:
one string that includes credential.
Throws:
EGOException.
EGOException
javax.xml.stream.XMLStreamException
org.apache.xmlbeans.XmlException

logon

java.lang.String logon(java.lang.String cred)
                       throws EGOException,
                              javax.xml.stream.XMLStreamException,
                              org.apache.xmlbeans.XmlException
Logs on to EGO by credential.

Parameters:
cred - : specifies credential of user.
Returns:
one string that includes new credential.
Throws:
EGOException
javax.xml.stream.XMLStreamException
org.apache.xmlbeans.XmlException

logoff

void logoff()
            throws EGOException
Logs off EGO and removes credential.

Throws:
EGOException

register

void register(ClientCallbackHandler handler)
              throws EGOException,
                     java.net.UnknownHostException
Registers the client with EGO master.

Parameters:
handler - : one ClientCallbackHandler object that is implemented by users.
Throws:
EGOException, - UnknownHostException.
EGOException
java.net.UnknownHostException

unregister

void unregister()
                throws EGOException
Unregister the client with EGO master. After unregistering, all allocation requests and workload activities started by this client will be terminated.

Throws:
EGOException.
EGOException

allocate

Allocation allocate(AllocRequest req,
                    AllocationCallbackHandler handler)
                    throws EGOException
This operation is used by an EGO client to make a request for resources. The client must be registered before being able to use this operation.

Parameters:
req - : specifies a description of the requested allocation.
handler - : one AllocationCallbackHandler object that is implemented by users.
Returns:
an Allocation object that contains the AllocationID.
Throws:
EGOException.
EGOException

getService

Service getService(java.lang.String servicename,
                   ServiceCallbackHandler handler)
                   throws EGOException,
                          java.net.UnknownHostException
Get an existing service.

Parameters:
servicename - : specifies name of service.
handler - : one ServiceCallbackHandler object that is implemented by users.
Returns:
one Service object.
Throws:
EGOException.
EGOException
java.net.UnknownHostException

unsubscribeService

void unsubscribeService(Service service)
                        throws EGOException
Unsubscribe a service.

Parameters:
service -
Throws:
EGOException

getName

java.lang.String getName()
Get name of client.

Returns:
name of client.

getDescription

java.lang.String getDescription()
Get description of client.

Returns:
description of client.

getLocation

java.lang.String getLocation()
                             throws EGOException
Get location of client.

Returns:
location of client.
Throws:
EGOException

refreshCredential

java.lang.String refreshCredential()
                                   throws EGOException,
                                          org.apache.xmlbeans.XmlException,
                                          javax.xml.stream.XMLStreamException
Refresh credential.

Throws:
EGOException
org.apache.xmlbeans.XmlException
javax.xml.stream.XMLStreamException

getUserName

java.lang.String getUserName()
Get name of user.

Returns:
name of user.

getClusterAdmin

ClusterAdmin getClusterAdmin()
                             throws EGOException
Get admin of cluster.

Returns:
one ClusterAdmin object.
Throws:
EGOException

getConsumerAdmin

ConsumerAdmin getConsumerAdmin()
                               throws EGOException
Get admin of consumer.

Returns:
one ConsumerAdmin object.
Throws:
EGOException

getUserAdmin

UserAdmin getUserAdmin()
                       throws EGOException
Get admin of user.

Returns:
one UserAdmin object.
Throws:
EGOException

getInfoProvider

ClientInfoProvider getInfoProvider()
                                   throws EGOException
Get information provider.

Returns:
one InfoProvider object.
Throws:
EGOException

getAllocations

Allocation[] getAllocations()
Get allocations of client.

Returns:
a set of allocations.

getConsumerPlan

ConsumerPlan getConsumerPlan(java.lang.String consumerName,
                             java.lang.String resourceGroupName)
Get Consumer Plan for the given consumer and resource group.

Returns:
ConsumerPlan.

setPlanCacheExpiryTime

void setPlanCacheExpiryTime(long seconds)
Set the expiry time (in seconds) of the Consumer Plan cache. If not set, the default value of 5 minutes is used.

Parameters:
seconds -

getConn

Connection getConn()
Get connection.

Returns:
connection.

reRegister

void reRegister()
                throws EGOException,
                       java.net.UnknownHostException
reRegister to EGO through WSG, Usually happens after WSG failover;

Throws:
EGOException
java.net.UnknownHostException


Copyright (C) 1992-2007 Platform Computing Corporation