org.openanzo.services.impl
Class WSAuthenticationService

java.lang.Object
  extended by org.openanzo.services.impl.WSBaseService
      extended by org.openanzo.services.impl.WSAuthenticationService
All Implemented Interfaces:
IAuthenticationService, IService

public class WSAuthenticationService
extends WSBaseService
implements IAuthenticationService

Implementation of IAuthenticationService that uses WebService/Soap to talk to a remote Anzo Server.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
WSAuthenticationService(java.util.Properties properties)
          Create new WSAuthenticationService with configuration properties provided in properties object
WSAuthenticationService(java.lang.String serviceHostName, int servicePort, java.lang.String serviceUser, java.lang.String servicePassword, int serviceTimeout)
          Create new WSAuthenticationService with given configuration properties
 
Method Summary
 org.openrdf.model.URI authenticateUser(java.lang.String userId, java.lang.String password)
          Authenticates the user with a given userId and password against the Anzo Server's authentication service, and returns the user's URI in Anzo.
 java.util.Set<org.openrdf.model.URI> getRolesForGraph(org.openrdf.model.URI namedGraphUri)
          Get the roles that can read a given NamedGraph
 java.util.Set<org.openrdf.model.URI> getRolesForUser(org.openrdf.model.URI userId)
          Get roles that given user is a member
 java.util.Set<org.openrdf.model.URI> getUsersForGraph(org.openrdf.model.URI namedGraphUri)
          Get the users that can read a given NamedGraph
 org.openrdf.model.URI getUserUri(java.lang.String userId)
          Get the User's URI based on userId
 
Methods inherited from class org.openanzo.services.impl.WSBaseService
getServiceHostName, getServicePassword, getServicePort, getServiceUser, setServiceHostName, setServicePassword, setServicePort, setServiceUser
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openanzo.services.IService
getServicePassword, getServiceUser, setServicePassword, setServiceUser
 

Constructor Detail

WSAuthenticationService

public WSAuthenticationService(java.lang.String serviceHostName,
                               int servicePort,
                               java.lang.String serviceUser,
                               java.lang.String servicePassword,
                               int serviceTimeout)
Create new WSAuthenticationService with given configuration properties

Parameters:
serviceHostName - Hostname for Anzo server
servicePort - Port for Anzo server
serviceUser - Username for Anzo server
servicePassword - Password for Anzo server
serviceTimeout - Number of milliseconds to wait before timing out call to server

WSAuthenticationService

public WSAuthenticationService(java.util.Properties properties)
Create new WSAuthenticationService with configuration properties provided in properties object

Parameters:
properties - Properties object containing configuration properties
Method Detail

authenticateUser

public org.openrdf.model.URI authenticateUser(java.lang.String userId,
                                              java.lang.String password)
                                       throws AnzoException
Description copied from interface: IAuthenticationService
Authenticates the user with a given userId and password against the Anzo Server's authentication service, and returns the user's URI in Anzo.

Specified by:
authenticateUser in interface IAuthenticationService
Parameters:
userId - The id the user is authenticating against
password - The password for the id the user is authenticating against
Returns:
The uri for the user in Anzo.
Throws:
AnzoException - is raised if authentication fails.

getUserUri

public org.openrdf.model.URI getUserUri(java.lang.String userId)
                                 throws AnzoException
Description copied from interface: IAuthenticationService
Get the User's URI based on userId

Specified by:
getUserUri in interface IAuthenticationService
Parameters:
userId - The id the user is authenticating against
Returns:
The uri for the user in Anzo.
Throws:
AnzoException - if getting URI of id fails

getRolesForUser

public java.util.Set<org.openrdf.model.URI> getRolesForUser(org.openrdf.model.URI userId)
                                                     throws AnzoException
Description copied from interface: IAuthenticationService
Get roles that given user is a member

Specified by:
getRolesForUser in interface IAuthenticationService
Parameters:
userId - The URI of the user to get roles
Returns:
Set of roles that user is a member
Throws:
AnzoException - if getting roles for user fails

getUsersForGraph

public java.util.Set<org.openrdf.model.URI> getUsersForGraph(org.openrdf.model.URI namedGraphUri)
                                                      throws AnzoException
Description copied from interface: IAuthenticationService
Get the users that can read a given NamedGraph

Specified by:
getUsersForGraph in interface IAuthenticationService
Parameters:
namedGraphUri - URI of NamedGraph
Returns:
Set of user's URIS that can read the NamedGraph
Throws:
AnzoException - if getting users for graph fails

getRolesForGraph

public java.util.Set<org.openrdf.model.URI> getRolesForGraph(org.openrdf.model.URI namedGraphUri)
                                                      throws AnzoException
Description copied from interface: IAuthenticationService
Get the roles that can read a given NamedGraph

Specified by:
getRolesForGraph in interface IAuthenticationService
Parameters:
namedGraphUri - URI of NamedGraph
Returns:
Set of roles's URIS that can read the NamedGraph
Throws:
AnzoException - if getting roles for graph fails


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.