net.handle.hdllib
Class Resolver

java.lang.Object
  extended by net.handle.hdllib.Resolver

public class Resolver
extends java.lang.Object

Class used for high level interaction with handles. Configuration information for this resolver is located in the .handle/resolver.xml file under the home directory of the user running this code as determined by the user.home system property. The following is an example of an override in the resolver.xml file:

 
  
   
     >
    
      admin_read="true"
      admin_write="true"
      public_read="true"
      public_write="false"
      ttl="86400"
      ttl_type="relative" 
      encoding="text"  
      >
      http://www.handle.net/
    
   
  
 
 


Constructor Summary
Resolver()
          Construct a Resolver object with the default settings
 
Method Summary
 boolean checkAuthentication(AuthenticationInfo authInfo)
          Verify that the given authentication object is valid and checks out when tested via handle resolution.
 void checkConfiguration()
          Check if the configuration file has been modified, and if so, reload it
 java.io.File getConfigFile()
          Return the file that contains the XML resolver configuration
 HandleResolver getResolver()
          Get the underlying resolver being used
 net.cnri.simplexml.XTag getXMLForValue(HandleValue value)
           
 HandleValue[] resolveHandle(java.lang.String handle)
          Resolve the given handle
 HandleValue[] resolveHandle(java.lang.String handle, java.lang.String[] typeList)
          Resolve the given handle to its values that have the given types.
 HandleValue[] resolveHandle(java.lang.String handle, java.lang.String[] typeList, boolean secure)
          Resolve the given handle to its values that have the given types.
 HandleValue[] resolveHandle(java.lang.String handle, java.lang.String[] typeList, int[] indexes, boolean secure)
          Resolve the given handle to its values that have the given types or indexes.
 java.security.PublicKey[] resolvePublicKeys(java.lang.String handle)
           
 void setVerifyMessages(boolean verify)
          Set whether or not messages sent through this resolver will require digital signatures on all responses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resolver

public Resolver()
Construct a Resolver object with the default settings

Method Detail

getConfigFile

public java.io.File getConfigFile()
Return the file that contains the XML resolver configuration


checkConfiguration

public void checkConfiguration()
Check if the configuration file has been modified, and if so, reload it


resolveHandle

public HandleValue[] resolveHandle(java.lang.String handle)
                            throws HandleException
Resolve the given handle

Throws:
HandleException

resolveHandle

public HandleValue[] resolveHandle(java.lang.String handle,
                                   java.lang.String[] typeList)
                            throws HandleException
Resolve the given handle to its values that have the given types.

Throws:
HandleException

resolveHandle

public HandleValue[] resolveHandle(java.lang.String handle,
                                   java.lang.String[] typeList,
                                   boolean secure)
                            throws HandleException
Resolve the given handle to its values that have the given types. If the secure value is true then ensure the resolution can be trusted using digital signatures.

Throws:
HandleException

resolveHandle

public HandleValue[] resolveHandle(java.lang.String handle,
                                   java.lang.String[] typeList,
                                   int[] indexes,
                                   boolean secure)
                            throws HandleException
Resolve the given handle to its values that have the given types or indexes. If the secure value is true then ensure the resolution can be trusted using digital signatures.

Throws:
HandleException

setVerifyMessages

public void setVerifyMessages(boolean verify)
Set whether or not messages sent through this resolver will require digital signatures on all responses.


getResolver

public HandleResolver getResolver()
Get the underlying resolver being used


resolvePublicKeys

public java.security.PublicKey[] resolvePublicKeys(java.lang.String handle)
                                            throws HandleException
Throws:
HandleException

getXMLForValue

public net.cnri.simplexml.XTag getXMLForValue(HandleValue value)

checkAuthentication

public boolean checkAuthentication(AuthenticationInfo authInfo)
                            throws java.lang.Exception
Verify that the given authentication object is valid and checks out when tested via handle resolution. This performs the same verification procedure as a server in order to verify that the entity that is authenticating with the given object is who they claim to be.

Throws:
java.lang.Exception