org.apache.lens.client
Class LensConnection

java.lang.Object
  extended by org.apache.lens.client.LensConnection

public class LensConnection
extends Object

Top level client connection class which is used to connect to a lens server.


Constructor Summary
LensConnection(LensConnectionParams params)
          Construct a connection to lens server specified by connection parameters.
LensConnection(LensConnectionParams params, LensSessionHandle sessionHandle)
          Construct a connection to lens server specified by connection parameters with an already established session
 
Method Summary
 APIResult addResourceToConnection(String type, String resourcePath)
          Adds the resource to connection.
 APIResult attachDatabaseToSession()
          Attach database to session.
 APIResult close()
          Close.
 List<String> getConnectionParams()
           
 List<String> getConnectionParams(String key)
          Gets the connection params.
 boolean isOpen()
          Check if the connection is opened.
 List<String> listResourcesFromConnection(String type)
          List resources from session
 LensSessionHandle open(String password)
          Open.
 APIResult removeResourceFromConnection(String type, String resourcePath)
          Removes the resource from connection.
 APIResult setConnectionParams(String key, String value)
          Sets the connection params.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LensConnection

public LensConnection(LensConnectionParams params)
Construct a connection to lens server specified by connection parameters.

Parameters:
params - parameters to be used for creating a connection

LensConnection

public LensConnection(LensConnectionParams params,
                      LensSessionHandle sessionHandle)
Construct a connection to lens server specified by connection parameters with an already established session

Parameters:
params - parameters to be used for creating a connection
Method Detail

isOpen

public boolean isOpen()
Check if the connection is opened. Please note that,lens connections are persistent connections. But a session mapped by ID running on the lens server.

Returns:
true if connected to server

open

public LensSessionHandle open(String password)
Open.

Parameters:
password - the password
Returns:
the lens session handle

attachDatabaseToSession

public APIResult attachDatabaseToSession()
Attach database to session.

Returns:
the API result

close

public APIResult close()
Close.

Returns:
the API result

addResourceToConnection

public APIResult addResourceToConnection(String type,
                                         String resourcePath)
Adds the resource to connection.

Parameters:
type - the type
resourcePath - the resource path
Returns:
the API result

removeResourceFromConnection

public APIResult removeResourceFromConnection(String type,
                                              String resourcePath)
Removes the resource from connection.

Parameters:
type - the type
resourcePath - the resource path
Returns:
the API result

listResourcesFromConnection

public List<String> listResourcesFromConnection(String type)
List resources from session

Parameters:
type - type of resource
Returns:
List of resources

setConnectionParams

public APIResult setConnectionParams(String key,
                                     String value)
Sets the connection params.

Parameters:
key - the key
value - the value
Returns:
the API result

getConnectionParams

public List<String> getConnectionParams()

getConnectionParams

public List<String> getConnectionParams(String key)
Gets the connection params.

Parameters:
key - the key
Returns:
the connection params

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.