nl.surfnet.coin.csa.service.impl
Class LmngServiceMock

java.lang.Object
  extended by nl.surfnet.coin.csa.service.impl.LmngServiceMock
All Implemented Interfaces:
CrmService

public class LmngServiceMock
extends Object
implements CrmService

LicensingServiceMock.java


Constructor Summary
LmngServiceMock()
           
 
Method Summary
 void evictCache()
           
 List<Account> getAccounts(boolean isInstitution)
          Get all institutions
 List<Article> getArticlesForServiceProviders(List<String> serviceProviderEntityIds)
          Get articles for the given serviceProviders.
 String getInstitutionName(String guid)
          Get the name of the institution in LMNG belonging to given GUID
 List<License> getLicensesForIdpAndSp(IdentityProvider identityProvider, String articleIdentifier)
          Gets a list with Licenses for the given identityProvider and services (lmngIdentifiers) which are valid on the given day
 List<License> getLicensesForIdpAndSps(IdentityProvider identityProvider, List<String> articleIdentifiers)
           
 Article getService(String guid)
          Get LMNG article by article ID
 String getServiceName(String lmngId)
          Get the name of the service/product in LMNG belonging to given GUID
 String performQuery(String rawQuery)
          Convenience method to run various queries
 void setDebug(boolean debug)
           
 void setEndpoint(String endpoint)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LmngServiceMock

public LmngServiceMock()
Method Detail

setDebug

public void setDebug(boolean debug)

setEndpoint

public void setEndpoint(String endpoint)

performQuery

public String performQuery(String rawQuery)
Description copied from interface: CrmService
Convenience method to run various queries

Specified by:
performQuery in interface CrmService
Parameters:
rawQuery - the fetch string
Returns:
the raw response

evictCache

public void evictCache()
Specified by:
evictCache in interface CrmService

getInstitutionName

public String getInstitutionName(String guid)
Description copied from interface: CrmService
Get the name of the institution in LMNG belonging to given GUID

Specified by:
getInstitutionName in interface CrmService
Parameters:
guid - guid of the IDP to check
Returns:
the name of the institution in LMNG

getServiceName

public String getServiceName(String lmngId)
Description copied from interface: CrmService
Get the name of the service/product in LMNG belonging to given GUID

Specified by:
getServiceName in interface CrmService
Returns:

getService

public Article getService(String guid)
Description copied from interface: CrmService
Get LMNG article by article ID

Specified by:
getService in interface CrmService
Parameters:
guid - guid of the article
Returns:
the article found or null

getAccounts

public List<Account> getAccounts(boolean isInstitution)
Description copied from interface: CrmService
Get all institutions

Specified by:
getAccounts in interface CrmService
Returns:
all accounts of the institutions / serviceproviders known in LMNG

getLicensesForIdpAndSp

public List<License> getLicensesForIdpAndSp(IdentityProvider identityProvider,
                                            String articleIdentifier)
Description copied from interface: CrmService
Gets a list with Licenses for the given identityProvider and services (lmngIdentifiers) which are valid on the given day

Specified by:
getLicensesForIdpAndSp in interface CrmService
Parameters:
identityProvider - the identityProvider to get the licenses for
articleIdentifier - lmngIdentifier (belonging to SP's) where the licenses are for.
Returns:
a (possible) list of licenses

getLicensesForIdpAndSps

public List<License> getLicensesForIdpAndSps(IdentityProvider identityProvider,
                                             List<String> articleIdentifiers)
                                      throws LmngException
Specified by:
getLicensesForIdpAndSps in interface CrmService
Throws:
LmngException

getArticlesForServiceProviders

public List<Article> getArticlesForServiceProviders(List<String> serviceProviderEntityIds)
Description copied from interface: CrmService
Get articles for the given serviceProviders.

Specified by:
getArticlesForServiceProviders in interface CrmService
Parameters:
serviceProviderEntityIds - list of ID's of serviceproviders to get the lmng article for
Returns:
a list of possible articles


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