nl.surfnet.sab
Class SabClient

java.lang.Object
  extended by nl.surfnet.sab.SabClient
All Implemented Interfaces:
Sab

public class SabClient
extends Object
implements Sab

Client implementation for SAB. Depends on an actual 'transport' for communication, most probably HttpClientTransport.


Field Summary
protected static org.joda.time.format.DateTimeFormatter XML_DATE_TIME_FORMAT
           
 
Constructor Summary
SabClient()
           
 
Method Summary
 String createRequest(String userId, String messageId)
          Create request string from template
 SabRoleHolder getRoles(String userId)
          Get the Role/organisation info for the given userId
 boolean hasRoleForOrganisation(String userId, String role, String organisation)
          Returns whether the given user has the given role for the given organisation
 void setTransport(SabTransport transport)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_DATE_TIME_FORMAT

protected static final org.joda.time.format.DateTimeFormatter XML_DATE_TIME_FORMAT
Constructor Detail

SabClient

public SabClient()
Method Detail

hasRoleForOrganisation

public boolean hasRoleForOrganisation(String userId,
                                      String role,
                                      String organisation)
Description copied from interface: Sab
Returns whether the given user has the given role for the given organisation

Specified by:
hasRoleForOrganisation in interface Sab
Returns:
boolean

getRoles

public SabRoleHolder getRoles(String userId)
                       throws IOException
Description copied from interface: Sab
Get the Role/organisation info for the given userId

Specified by:
getRoles in interface Sab
Parameters:
userId - the userId to query for
Returns:
SabRoleHolder
Throws:
IOException - when IO fails or an error occurs (for example authentication failure)

createRequest

public String createRequest(String userId,
                            String messageId)
Create request string from template

Parameters:
userId - the userId to use
messageId - the messageId to use
Returns:
Serialized XML

setTransport

public void setTransport(SabTransport transport)


Copyright © 2012-2013 SURFnet bv, The Netherlands. All Rights Reserved.