Class SGrDeclarationLibrary
- java.lang.Object
-
- com.smartgridready.communicator.common.api.SGrDeclarationLibrary
-
public class SGrDeclarationLibrary extends java.lang.ObjectProvides a client for the SGr declaration library. Can be used to retrieve EI-XML data and information. The implementation is backed by the commhandler's HTTP driver.
-
-
Constructor Summary
Constructors Constructor Description SGrDeclarationLibrary()Constructs with default HTTP implementation.SGrDeclarationLibrary(com.smartgridready.driver.api.http.GenHttpClientFactory httpClientFactory)Constructs with custom HTTP implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetProductEidXml(java.lang.String eidName)Gets product EI-XML data.ProductInfogetProductInfo(java.lang.String eidName)Gets information about a product EID.
-
-
-
Constructor Detail
-
SGrDeclarationLibrary
public SGrDeclarationLibrary()
Constructs with default HTTP implementation.
-
SGrDeclarationLibrary
public SGrDeclarationLibrary(com.smartgridready.driver.api.http.GenHttpClientFactory httpClientFactory)
Constructs with custom HTTP implementation.- Parameters:
httpClientFactory- the HTTP client factory implementation
-
-
Method Detail
-
getProductEidXml
public java.lang.String getProductEidXml(java.lang.String eidName) throws java.io.IOExceptionGets product EI-XML data.- Parameters:
eidName- the EID name- Returns:
- EI-XML as string
- Throws:
java.io.IOException- when the request failed
-
getProductInfo
public ProductInfo getProductInfo(java.lang.String eidName) throws java.io.IOException
Gets information about a product EID.- Parameters:
eidName- the EID name- Returns:
- an instance of
ProductInfo - Throws:
java.io.IOException- when the request or decoding failed
-
-