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

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

public class LmngUtil
extends Object
implements CrmUtil

Utility class for LMNG. This class contains some static methods used in the LmngServiceImpl


Field Summary
static String ENDPOINT_PLACEHOLDER
           
static String INSTITUTION_IDENTIFIER_PLACEHOLDER
           
static String QUERY_PLACEHOLDER
           
static String UID_PLACEHOLDER
           
 
Constructor Summary
LmngUtil()
           
 
Method Summary
 String getLmngRequestEnvelope()
           
 String getLmngSoapRequestForAllAccount(boolean isInstitution, String endpoint)
           
 String getLmngSoapRequestForIdpAndSp(String institutionId, List<String> serviceIds, Date validOn, String endpoint)
           
 String getLmngSoapRequestForSps(Collection<String> serviceIds, String endpoint)
           
 boolean isValidGuid(String guid)
           
 List<Account> parseAccountsResult(String webserviceResult, boolean writeResponseToFile)
          Parse the result to an account(list)
 List<Article> parseArticlesResult(String webserviceResult, boolean writeResponseToFile)
          Parse the result to an article(list)
 List<License> parseLicensesResult(String webserviceResult, boolean writeResponseToFile)
          Parse the result to a license(list)
 String parseResultInstitute(String webserviceResult, boolean writeResponseToFile)
           
 void writeIO(String filename, String content)
          Write the given content to a file with the given filename (and add a datetime prefix).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENDPOINT_PLACEHOLDER

public static final String ENDPOINT_PLACEHOLDER
See Also:
Constant Field Values

UID_PLACEHOLDER

public static final String UID_PLACEHOLDER
See Also:
Constant Field Values

QUERY_PLACEHOLDER

public static final String QUERY_PLACEHOLDER
See Also:
Constant Field Values

INSTITUTION_IDENTIFIER_PLACEHOLDER

public static final String INSTITUTION_IDENTIFIER_PLACEHOLDER
See Also:
Constant Field Values
Constructor Detail

LmngUtil

public LmngUtil()
Method Detail

parseArticlesResult

public List<Article> parseArticlesResult(String webserviceResult,
                                         boolean writeResponseToFile)
                                  throws ParserConfigurationException,
                                         SAXException,
                                         IOException,
                                         ParseException
Parse the result to an article(list)

Specified by:
parseArticlesResult in interface CrmUtil
Throws:
ParserConfigurationException
SAXException
IOException
ParseException

parseLicensesResult

public List<License> parseLicensesResult(String webserviceResult,
                                         boolean writeResponseToFile)
                                  throws ParserConfigurationException,
                                         SAXException,
                                         IOException,
                                         ParseException
Parse the result to a license(list)

Specified by:
parseLicensesResult in interface CrmUtil
Throws:
ParserConfigurationException
SAXException
IOException
ParseException

parseAccountsResult

public List<Account> parseAccountsResult(String webserviceResult,
                                         boolean writeResponseToFile)
                                  throws ParserConfigurationException,
                                         SAXException,
                                         IOException,
                                         ParseException
Parse the result to an account(list)

Specified by:
parseAccountsResult in interface CrmUtil
Throws:
ParserConfigurationException
SAXException
IOException
ParseException

parseResultInstitute

public String parseResultInstitute(String webserviceResult,
                                   boolean writeResponseToFile)
                            throws ParserConfigurationException,
                                   SAXException,
                                   IOException,
                                   ParseException
Specified by:
parseResultInstitute in interface CrmUtil
Throws:
ParserConfigurationException
SAXException
IOException
ParseException

writeIO

public void writeIO(String filename,
                    String content)
Write the given content to a file with the given filename (and add a datetime prefix). For debugging purposes

Specified by:
writeIO in interface CrmUtil
Parameters:
filename -
content -

isValidGuid

public boolean isValidGuid(String guid)
Specified by:
isValidGuid in interface CrmUtil

getLmngSoapRequestForIdpAndSp

public String getLmngSoapRequestForIdpAndSp(String institutionId,
                                            List<String> serviceIds,
                                            Date validOn,
                                            String endpoint)
                                     throws IOException
Specified by:
getLmngSoapRequestForIdpAndSp in interface CrmUtil
Throws:
IOException

getLmngSoapRequestForSps

public String getLmngSoapRequestForSps(Collection<String> serviceIds,
                                       String endpoint)
                                throws IOException
Specified by:
getLmngSoapRequestForSps in interface CrmUtil
Throws:
IOException

getLmngSoapRequestForAllAccount

public String getLmngSoapRequestForAllAccount(boolean isInstitution,
                                              String endpoint)
                                       throws IOException
Specified by:
getLmngSoapRequestForAllAccount in interface CrmUtil
Throws:
IOException

getLmngRequestEnvelope

public String getLmngRequestEnvelope()
                              throws IOException
Specified by:
getLmngRequestEnvelope in interface CrmUtil
Throws:
IOException


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