org.openrdf.elmo
Interface ResourceManager<Resource>

All Known Implementing Classes:
SesameResourceManager

public interface ResourceManager<Resource>

Manages the life-cycle of the RDF resource in side the Elmo JavaBean.

Author:
James Leigh

Method Summary
 QName createQName(Resource resource)
          Reverses createResource.
 Resource createResource(QName qname)
          Creates a new resource by URI, localeName, or encoded blankNode.
 Iterator<Resource> createRoleQuery(Class<?> concept)
          Creates a query that will return all resource that implement this concept.
 Class<?>[] getRoles(Resource resource)
          Determine what concepts and behaviours this resource represents.
 Class<?>[] mergeRole(Resource resource, Class<?> concept)
          If this concept is new to this resource merge them and return the combined set of concepts and behaviours this resource now represents, otherwise return the existing roles.
 void removeResource(Resource resource)
          Remove this resource from the repository.
 Class<?>[] removeRole(Resource resource, Class<?> concept)
          Removes a given role from the resource and returns the new role set for this resource.
 void renameResource(Resource before, Resource after)
          Change all references of before to after.
 

Method Detail

createResource

Resource createResource(QName qname)
Creates a new resource by URI, localeName, or encoded blankNode.

Parameters:
qname -
Returns:
A Resource for this name.

createQName

QName createQName(Resource resource)
Reverses createResource.

Parameters:
resource -
Returns:
String name of the resource.
See Also:
createResource(QName)

getRoles

Class<?>[] getRoles(Resource resource)
Determine what concepts and behaviours this resource represents.

Parameters:
resource -
Returns:
Array of roles for this resource.

mergeRole

Class<?>[] mergeRole(Resource resource,
                     Class<?> concept)
If this concept is new to this resource merge them and return the combined set of concepts and behaviours this resource now represents, otherwise return the existing roles.

Parameters:
resource -
concept -
Returns:
Array of roles for this resource.

removeRole

Class<?>[] removeRole(Resource resource,
                      Class<?> concept)
Removes a given role from the resource and returns the new role set for this resource.

Parameters:
resource -
concept -
Returns:
Array of roles for this resource, without the given concept

renameResource

void renameResource(Resource before,
                    Resource after)
Change all references of before to after.

Parameters:
before -
after -

removeResource

void removeResource(Resource resource)
Remove this resource from the repository.

Parameters:
resource -

createRoleQuery

Iterator<Resource> createRoleQuery(Class<?> concept)
Creates a query that will return all resource that implement this concept.

Parameters:
concept -
Returns:
collection of resources.


Copyright © 2004-2008 Aduna. All Rights Reserved.