nl.uva.vlet.vrs
Class VRSContext

java.lang.Object
  extended by nl.uva.vlet.vrs.VRSContext

public class VRSContext
extends java.lang.Object

VRS context class.

This context is under contruction as not all VRS classes support alternate contexts other then the 'default' (fetched by calling getDefault()). Most VRS classes use the same (shared) VRSContext. It is recommended to use one shared context for all classes in the same application. Different contexts are now under construction in Grid Service containers to maintain different caller Contexts. TODO: Security (Applet/servlet) Context !


Constructor Summary
VRSContext()
          TODO: Contructs new VRSContext.
VRSContext(boolean initialize)
          TODO: Contructs new Default VRSContext with optional initialization.
 
Method Summary
 void Debug(java.lang.String msg)
           
static VRSContext getDefault()
          Get default VRS environment.
 GlobusCredential getGlobusCredentail()
           
 GridProxy getGridProxy()
           
 java.lang.String getProxyAsString()
           
 Registry getRegistry()
           
 ServerInfo getServerInfoFor(VRL loc, boolean autoCreate)
          Get ServerInfo object used by this context.
 VNode getVirtualRoot()
          Returns Virtual Root of top level Resource Tree.
 VRL getVirtualRootLocation()
          Returns Virtual Root VRL of top level Resource Tree.
 void init()
           
 VNode openLocation(VRL vrl)
          Perform openLocation using this VRSContext.
static void setDefault(VRSContext context)
          Set default VRS Context environment.
 void setGlobusCredential(GlobusCredential cred)
           
 void setGridProxy(GridProxy prox)
           
 void setProxyFromString(java.lang.String proxyStr)
           
 void setRegistry(Registry registry)
          Sets the VRS Registry, may be done only once.
 void setVirtualRoot(VNode vnode)
          Set new virtual root, make sure to do this directly after creating a new VRSContext, before doing any other calls.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VRSContext

public VRSContext()
TODO: Contructs new VRSContext. This will also initialize the Core VRS class Registry and GridProxy.

Throws:
VlException

VRSContext

public VRSContext(boolean initialize)
TODO: Contructs new Default VRSContext with optional initialization. This constructor can be used to create a VRSContext without any default initialization. Use Setters methods to configure the context manually.

Private Constructor: Currently not possible to create custom VRSContexts as this isn't yet fully support throughout the VRS.
Use getDefault() for now.

Throws:
VlException
Method Detail

getDefault

public static VRSContext getDefault()
Get default VRS environment. It is recommended to share one VRSContext between classes in the same Application. Customized VRSContexts are currently under construction for Applet/Servlet/Grid Service environments.

Returns:
global VRSContext object
Throws:
VlException

setDefault

public static void setDefault(VRSContext context)
Set default VRS Context environment. By setting this default environment, default resource loaders and URL.connect() and VRL.connect() methods are influenced. Also this new context is used when creating new VFSClient objects(). Object which where create before setting this method will NOT be updated with the new context.

It is recommended to share one VRSContext between classes in the same Application. Customized VRSContexts are currently under construction for Applet/Servlet/Grid Service environments.

Throws:
VlException

init

public void init()

getGlobusCredentail

public GlobusCredential getGlobusCredentail()

setGlobusCredential

public void setGlobusCredential(GlobusCredential cred)

getGridProxy

public GridProxy getGridProxy()

setGridProxy

public void setGridProxy(GridProxy prox)

setRegistry

public void setRegistry(Registry registry)
                 throws InitializationException
Sets the VRS Registry, may be done only once.

Throws:
InitializationException

getProxyAsString

public java.lang.String getProxyAsString()
                                  throws VlException
Throws:
VlException

setProxyFromString

public void setProxyFromString(java.lang.String proxyStr)
                        throws VlException
Throws:
VlException

getRegistry

public Registry getRegistry()

getVirtualRootLocation

public VRL getVirtualRootLocation()
                           throws VlException
Returns Virtual Root VRL of top level Resource Tree. Currently returns the MyVLe object

Throws:
VlException

getVirtualRoot

public VNode getVirtualRoot()
                     throws VlException
Returns Virtual Root of top level Resource Tree. Currently returns the MyVLe object

Throws:
VlException

setVirtualRoot

public void setVirtualRoot(VNode vnode)
Set new virtual root, make sure to do this directly after creating a new VRSContext, before doing any other calls.


getServerInfoFor

public ServerInfo getServerInfoFor(VRL loc,
                                   boolean autoCreate)
                            throws VlException
Get ServerInfo object used by this context. TODO: ServerInfo class still stores the ServerInfo in static hasthable which means all Contexts share the same ServerInfo.

Parameters:
loc -
autoCreate -
Returns:
Throws:
VlException

openLocation

public VNode openLocation(VRL vrl)
                   throws VlException
Perform openLocation using this VRSContext. Replaces static Registry.openLocation();

Throws:
VlException

Debug

public void Debug(java.lang.String msg)