001/******************************************************************************* 002 * Copyright (c) 2017 Red Hat Inc and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * Red Hat Inc - initial API and implementation 011 *******************************************************************************/ 012package org.eclipse.kapua.gateway.client; 013 014/** 015 * An application is a sub-unit of a client, focused on handling data 016 * <p> 017 * The {@link Client} instance is more technical unit, where the {@link Application} 018 * is more a data oriented unit. 019 * </p> 020 */ 021public interface Application extends AutoCloseable { 022 023 public interface Builder { 024 025 public Application build(); 026 } 027 028 /** 029 * Lookup a data controller to an application topic 030 * 031 * @param topic 032 * the topic the controller is bound to, must never be {@code null} 033 * @return the data controller 034 */ 035 public Data data(Topic topic); 036 037 /** 038 * Lookup a transport controller 039 * <p> 040 * A transport controller for the client's underlying transport mechanism. 041 * </p> 042 * <p> 043 * <b>Note:</b> Each application has its own instance and thus can set 044 * events handler independent of the root client or other applications. 045 * </p> 046 * 047 * @return the transport controller 048 */ 049 public Transport transport(); 050}