Package net.handle.hdllib
Class Resolver
java.lang.Object
net.handle.hdllib.Resolver
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:
<hsconfig>
<local_handles>
<handle handle="200/0"
case_sensitive="false"
override_type="on_failure" <!-- could also be "always" - determines when the override is applied -->
>
<hdlvalue
type="URL" <!-- default is empty -->
admin_read="true"
admin_write="true"
public_read="true"
public_write="false"
ttl="86400"
ttl_type="relative" <!-- could also be "absolute" -->
encoding="text" <!-- encoding for data value; could also be "hex" -->
>
http://www.handle.net/
</hdlvalue>
</handle>
</local_handles>
</hsconfig>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAuthentication
(AuthenticationInfo authInfo) Verify that the given authentication object is valid and checks out when tested via handle resolution.void
Check if the configuration file has been modified, and if so, reload itReturn the file that contains the XML resolver configurationGet the underlying resolver being usedgetXMLForValue
(HandleValue value) resolveHandle
(String handle) Resolve the given handleresolveHandle
(String handle, String[] typeList) Resolve the given handle to its values that have the given types.resolveHandle
(String handle, String[] typeList, boolean secure) Resolve the given handle to its values that have the given types.resolveHandle
(String handle, String[] typeList, int[] indexes, boolean secure) Resolve the given handle to its values that have the given types or indexes.resolvePublicKeys
(String handle) void
setVerifyMessages
(boolean verify) Set whether or not messages sent through this resolver will require digital signatures on all responses.
-
Constructor Details
-
Resolver
public Resolver()Construct a Resolver object with the default settings
-
-
Method Details
-
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
Resolve the given handle- Throws:
HandleException
-
resolveHandle
Resolve the given handle to its values that have the given types.- Throws:
HandleException
-
resolveHandle
public HandleValue[] resolveHandle(String handle, 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(String handle, 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
Get the underlying resolver being used -
resolvePublicKeys
- Throws:
HandleException
-
getXMLForValue
-
checkAuthentication
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:
Exception
-