org.fcrepo.server.security.xacml.util
Class RELSRelationshipResolver

java.lang.Object
  extended by org.fcrepo.server.security.xacml.util.RelationshipResolverBase
      extended by org.fcrepo.server.security.xacml.util.RELSRelationshipResolver
All Implemented Interfaces:
RelationshipResolver

public class RELSRelationshipResolver
extends RelationshipResolverBase
implements RelationshipResolver

A RelationshipResolver that resolves relationships via Management.getRelationships(org.fcrepo.server.Context, String, String).

Author:
Edwin Shin

Field Summary
 
Fields inherited from class org.fcrepo.server.security.xacml.util.RelationshipResolverBase
childRelationships, DEFAULT_RELATIONSHIP, parentRelationships, REPOSITORY
 
Constructor Summary
RELSRelationshipResolver()
           
RELSRelationshipResolver(Map<String,String> options)
           
 
Method Summary
 String buildRESTParentHierarchy(String pid)
          Generates a REST based representation of an object and its parents.
 Set<String> getAttributesFromQuery(String query, String queryLang, String variable)
          Get attributes defined by a query.
protected  Set<String> getParents(String pid)
           
 Map<String,Set<String>> getRelationships(String subject)
          Retrieves the relationships for this subject.
 Map<String,Set<String>> getRelationships(String subject, String relationship)
          Retrieves relationships for this subject, relationship and object.
 
Methods inherited from class org.fcrepo.server.security.xacml.util.RelationshipResolverBase
getFedoraResourceURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RELSRelationshipResolver

public RELSRelationshipResolver()

RELSRelationshipResolver

public RELSRelationshipResolver(Map<String,String> options)
Method Detail

getRelationships

public Map<String,Set<String>> getRelationships(String subject,
                                                String relationship)
                                         throws MelcoeXacmlException
Description copied from interface: RelationshipResolver
Retrieves relationships for this subject, relationship and object. Return empty map if none found. Null means any.

Specified by:
getRelationships in interface RelationshipResolver
Returns:
Throws:
MelcoeXacmlException

getRelationships

public Map<String,Set<String>> getRelationships(String subject)
                                         throws MelcoeXacmlException
Description copied from interface: RelationshipResolver
Retrieves the relationships for this subject. Values for each relationship are placed in a map. Return empty map if none found

Specified by:
getRelationships in interface RelationshipResolver
Parameters:
subject - the subject to return relationships for - either ns:pid, ns:pid/datastream or the info:fedora/ forms
Returns:
The map of relationships and values.
Throws:
MelcoeXacmlException

buildRESTParentHierarchy

public String buildRESTParentHierarchy(String pid)
                                throws MelcoeXacmlException
Description copied from interface: RelationshipResolver
Generates a REST based representation of an object and its parents. For example, given the parameter b, and if b belongs to collection a, then we will end up with /a/b

Specified by:
buildRESTParentHierarchy in interface RelationshipResolver
Parameters:
pid - the pid whose parents we need to find
Returns:
the REST representation of the pid and its parents
Throws:
MelcoeXacmlException

getParents

protected Set<String> getParents(String pid)
                          throws MelcoeXacmlException
Throws:
MelcoeXacmlException

getAttributesFromQuery

public Set<String> getAttributesFromQuery(String query,
                                          String queryLang,
                                          String variable)
                                   throws MelcoeXacmlException
Description copied from interface: RelationshipResolver
Get attributes defined by a query. The values returned are defined by the variable defined in the query Only distinct values are returned.

Specified by:
getAttributesFromQuery in interface RelationshipResolver
Parameters:
query - The query to run
queryLang - Language of the query - itql, sparql, spo
variable - - the output variable to return (for spo, specify "s", "p" or "o")
Returns:
Throws:
MelcoeXacmlException


Copyright © 2012 DuraSpace. All Rights Reserved.