Getting started

  1. Connect Aerse maven repository:
    		<repositories>
    			<repository>
    				<id>aerse</id>
    				<url>http://repo.aerse.com/release</url>
    			</repository>
    		</repositories>
  2. Add dependency to project's pom.xml:
    		<dependencies>
    		...
    			<dependency>
    	   			<groupId>com.aerse</groupId>
    	   			<artifactId>api</artifactId>
    	   			<version>20.0</version>
    			</dependency>
    		...
    		</dependencies>

Quering

Following example illustrates querying for product "Nokia N900":

		Properties props = new Properties();
		props.put("key","0123456789");
		props.put("pop","en");
 		IWareNet warenet = new WareNet(props);
 		try {
 	 		Product result = warenet.findProduct("N900", "Nokia").getProduct();
 		} catch(WareNetException e) {
 			//do logging.
 		}

Using with Spring

API could be used within Spring container:

 		<bean class="com.aerse.api.WareNet">
			<constructor-arg>
				<props>
					<prop key="key">0123456789</prop>
					<prop key="lod">1</prop>
					<prop key="lang">en</prop>
					<prop key="pop">en</prop>
				</props>
			</constructor-arg>
		</bean>

Receiving updates

Updates are generated when new product information is available or product information has been updated.

Currently this functionality is in beta state. Please contact info@aerse.com to request access.

To establish incoming connection with Aerse following steps must be taken:

  1. Implement callback listener:
     		package com.yourcompany.warenet;
     
    		public class WareNetListener extends WareNetCallback {
    			public void onProduct(Product product) {
    		 		System.out.println("Received product: " + product);
    		 	}
    		}
  2. Add configuration to web.xml:
    		<servlet>
    			<servlet-name>WareNetListener</servlet-name>
    			<servlet-class>com.yourcompany.warenet.WareNetListener</servlet-class>
     		</servlet>
     		<servlet-mapping>
     			<servlet-name>WareNetListener</servlet-name>
     			<url-pattern>/callback</url-pattern>
     		</servlet-mapping>
  3. Package warenet-api.jar and its dependencies into /WEB-INF/lib

Logging

java.util.logging is used for logging. The following logger name could be used to log all messages from API:

		com.aerse.api