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

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

public class LmngServiceImpl
extends Object
implements CrmService

Implementation of a licensing service that get's it information from a webservice interface on LMNG


Constructor Summary
LmngServiceImpl()
           
 
Method Summary
 void evictCache()
           
 List<Account> getAccounts(boolean isInstitution)
          Get all institutions
 List<Article> getArticlesForServiceProviders(List<String> serviceProvidersEntityIds)
          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 guid)
          Get the name of the service/product in LMNG belonging to given GUID
protected  String getWebServiceResult(String soapRequest)
          Get the response from the webservice call (using credentials and endpoint address from this class settings) after execututing the given soapRequest string.
 String performQuery(String rawQuery)
          Convenience method to run various queries
 void setDebug(boolean debug)
           
 void setEndpoint(String endpoint)
           
 void setLmngIdentifierDao(LmngIdentifierDao lmngIdentifierDao)
           
 void setLmngUtil(CrmUtil lmngUtil)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LmngServiceImpl

public LmngServiceImpl()
Method Detail

getLicensesForIdpAndSp

@Cacheable(value="crm")
public List<License> getLicensesForIdpAndSp(IdentityProvider identityProvider,
                                                      String articleIdentifier)
                                     throws LmngException
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
Throws:
LmngException - If connection or call fails (rethrows all exceptions)

getLicensesForIdpAndSps

@Cacheable(value="crm")
public List<License> getLicensesForIdpAndSps(IdentityProvider identityProvider,
                                                       List<String> articleIdentifiers)
                                      throws LmngException
Specified by:
getLicensesForIdpAndSps in interface CrmService
Throws:
LmngException

getArticlesForServiceProviders

@Cacheable(value="crm")
public List<Article> getArticlesForServiceProviders(List<String> serviceProvidersEntityIds)
                                             throws LmngException
Description copied from interface: CrmService
Get articles for the given serviceProviders.

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

getServiceName

@Cacheable(value="crm")
public String getServiceName(String guid)
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

@Cacheable(value="crm")
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

getInstitutionName

@Cacheable(value="crm")
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

getWebServiceResult

protected String getWebServiceResult(String soapRequest)
                              throws IOException,
                                     KeyManagementException,
                                     UnrecoverableKeyException,
                                     NoSuchAlgorithmException,
                                     KeyStoreException
Get the response from the webservice call (using credentials and endpoint address from this class settings) after execututing the given soapRequest string.

Parameters:
soapRequest - A string representation of the soap request
Returns:
an inputstream of the webservice response
Throws:
IOException
KeyStoreException
NoSuchAlgorithmException
UnrecoverableKeyException
KeyManagementException

setEndpoint

public void setEndpoint(String endpoint)

setDebug

public void setDebug(boolean debug)

setLmngIdentifierDao

public void setLmngIdentifierDao(LmngIdentifierDao lmngIdentifierDao)

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

@CacheEvict(value="crm",
            allEntries=true)
public void evictCache()
Specified by:
evictCache in interface CrmService

setLmngUtil

public void setLmngUtil(CrmUtil lmngUtil)


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