001 002package io.vrap.rmf.base.client; 003 004/** 005 * 006 * Marker interface to generate a solution info for the Java SDK user agent. 007 * 008 * <p>A User-Agent header with a solution information looks like this: 009 * {@code commercetools-sdk-java-v2/1.4.1 Java/1.8.0_92-b14 (Mac OS X; x86_64) SOLUTION_NAME/SOLUTION_VERSION (+https://website.tld; +info@SOLUTION.com)}</p> 010 * 011 * <p>To add a solution information to the Java SDK create a resource file {@code src/main/resources/META-INF/services/io.vrap.rmf.base.client.SolutionInfo} 012 * which contains a fully qualified class name like (replace at least SOLUTION with your solution name) 013 * {@code tld.SOLUTION.client.SOLUTIONSolutionInfo}</p> 014 * 015 * Then create a class {@code tld.SOLUTION.client.SOLUTIONSolutionInfo}: 016 * 017 <pre> 018 {@code 019 public class SOLUTIONSolutionInfo extends SolutionInfo { 020 public SOLUTIONSolutionInfo() { 021 setName("Java-SDK-integration-tests"); 022 setVersion(BuildInfo.version()); 023 setWebsite("https://github.com/commercetools/commercetools-sdk-java-v2"); 024 setEmergencyContact("helpdesk@commercetools.com"); 025 } 026 } 027 } 028 </pre> 029 030 This class will be loaded via reflection. 031 * 032 */ 033public class SolutionInfo implements ModelBase { 034 private String name; 035 private String version; 036 private String website; 037 private String emergencyContact; 038 039 public SolutionInfo() { 040 } 041 042 public String getName() { 043 return name; 044 } 045 046 public void setName(final String name) { 047 this.name = name; 048 } 049 050 public String getVersion() { 051 return version; 052 } 053 054 public void setVersion(final String version) { 055 this.version = version; 056 } 057 058 public String getWebsite() { 059 return website; 060 } 061 062 public void setWebsite(final String website) { 063 this.website = website; 064 } 065 066 public String getEmergencyContact() { 067 return emergencyContact; 068 } 069 070 public void setEmergencyContact(final String emergencyContact) { 071 this.emergencyContact = emergencyContact; 072 } 073}