eu.unicore.hila.common
Class BaseResource

java.lang.Object
  extended by eu.unicore.hila.common.BaseResource
All Implemented Interfaces:
Resource

public abstract class BaseResource
extends Object
implements Resource

Author:
bjoernh 13.08.2009 10:49:26

Field Summary
protected  Location location
           
 
Constructor Summary
BaseResource(Location _location)
           
 
Method Summary
static Location findParentLocationOfType(Class<? extends Resource> _type, Location _child, Class<? extends Resource> _stopAtType)
          Extract a Location of type _class from the deeper _location, e.g.
 Resource getChild(String childPath)
           
 Location getLocation()
           
 Metadata getMetadata()
           
 String getName()
          The last element of the URI, either the last name before a final "/" or the last name after the "/", i.e.
 Resource getParent()
           
 boolean ok()
          Test whether a resource is ok, i.e. accessible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.unicore.hila.Resource
getChildren
 

Field Detail

location

protected final Location location
Constructor Detail

BaseResource

public BaseResource(Location _location)
Method Detail

getLocation

public final Location getLocation()
Specified by:
getLocation in interface Resource
See Also:
Resource.getLocation()

getChild

public Resource getChild(String childPath)
                  throws HiLAException
Specified by:
getChild in interface Resource
Throws:
HiLAException
See Also:
Resource.getChild(java.lang.String)

getMetadata

public Metadata getMetadata()
                     throws HiLAException
Specified by:
getMetadata in interface Resource
Throws:
HiLAException
See Also:
Resource.getMetadata()

getName

public String getName()
Description copied from interface: Resource
The last element of the URI, either the last name before a final "/" or the last name after the "/", i.e. would both return "home" as the name.

Specified by:
getName in interface Resource
Returns:
name of the Resource.
See Also:
Resource.getName()

getParent

public Resource getParent()
                   throws HiLAException
Specified by:
getParent in interface Resource
Throws:
HiLAException
See Also:
Resource.getParent()

findParentLocationOfType

public static Location findParentLocationOfType(Class<? extends Resource> _type,
                                                Location _child,
                                                Class<? extends Resource> _stopAtType)
                                         throws HiLALocationPatternException
Extract a Location of type _class from the deeper _location, e.g. the parent Site Location of a Task (in the Grid API hila-grid-api).

Parameters:
_child - Location of the Resource.
_type - the ResourceType we're looking for.
_stopAtType - stop search at this type, if it cannot be expected that a resource of type _class can be found as a parent of _child
Returns:
The Storage location.
Throws:
HiLAException
HiLALocationPatternException

ok

public boolean ok()
Description copied from interface: Resource
Test whether a resource is ok, i.e. accessible.

Specified by:
ok in interface Resource
Returns:
true, if the ressource is accessible, false otherwise
See Also:
Resource.ok()


Copyright © 2010-2013 UNICORE. All Rights Reserved.