Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
COOS - Connected Objects Operating System (www.connectedobjects.org). Copyright (C) 2009 Telenor ASA and Tellu AS. All rights reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. You may also contact one of the following for additional information: Telenor ASA, Snaroyveien 30, N-1331 Fornebu, Norway (www.telenor.no) Tellu AS, Hagalokkveien 13, N-1383 Asker, Norway (www.tellu.no)
 
 package org.coos.messaging;
 
The interface for a Channel.

Author(s):
Knut Eilif Husa, Tellu AS
 
 public interface Channel extends Processor {
 
 	// Messages
 	// Message name for connecting channel
 	public static final String CONNECT = "connect";
 	
 	//routingalgorithm for connecting segment
 	public static final String ROUTING_ALGORITHM = "routingAlg";
 
 	// Message name for ack of connecting channel
 	public static final String CONNECT_ACK = "connectAck";
 	
 	// Message name for nack of connecting channel
 	public static final String CONNECT_NACK = "connectNack";
 
 	// Message parameters
 	// Message paramater in message CONNECT indicating the endpoint uuid
 	public static final String CONNECT_UUID = "con_uuid";
 
 	// Message paramater in message CONNECT indicating the endpoint segment
 	public static final String CONNECT_SEGMENT = "con_seg";
 
 	// Message paramater in message CONNECT_ACK indicating the allocated
 	// endpoint uuid
 	public static final String CONNECT_ALLOCATED_UUID = "alloc_uuid";
 
 	// Message paramater in message CONNECT_ACK indicating the router uuid
 	public static final String CONNECT_ROUTER_UUID = "router_uuid";

Returns the inLink of the Channel. The InLink direction is from this Channel such that messages processed by the channel will be delivered from the InLink

Returns:
the InLink
 
Sets the inLink of the Channel. The InLink direction is from this Channel such that messages processed by the channel will be delivered from the InLink

Parameters:
inLink
 
 	void setInLink(Link inLink);

Returns the outLink of the Channel. The OutLink direction is into the Channel such that messages inserted into the OutLink will be processed by the Channel

Returns:
the Outlink
 
Sets the outLink of the Channel. The OutLink direction is into the Channel such that messages inserted into the OutLink will be processed by the Channel

Parameters:
outLink
 
 	void setOutLink(Link outLink);

Connects the Channel to the LinkManager. Connecting involves the following actions: Initiate the defined transport mechanism and send the "connect" message over the transport. Receive the For PluginChannels: CONNECT_ALLOCATED_UUID (Unique id for the Plugin allocated by the distant party) Receive the For RouterChannels: CONNECT_UUID (Unique id of the distant party)

Parameters:
linkManager Manager handling links
Throws:
ConnectingException if connection fails, e.g. due to timeout
	void connect(Connectable linkManagerthrows ConnectingException;

Disconnects the channel
	void disconnect();

Returns the transport mechanism

Returns:
the transport mechanism
Sets the Transport mechanism

Parameters:
transport
	void setTransport(Transport transport);

Flag indicating whether this Channel side (Channels always exits in peer relations) shall initiate connection

Returns:
boolean
	boolean isInit();

Sets indicating whether this Channel side (Channels always exits in peer relations) shall initiate connection

Parameters:
init
	void setInit(boolean init);

Sets the LinkManager

Parameters:
linkmanager
	void setLinkManager(Connectable linkmanager);

Returns the LinkManager of this Channel

Returns:
the LinkManager
Adds a protocol that this Channel handles. For PluginChannel and RouterChannel this is defaulted to coos

Parameters:
protocol
	void addProtocol(String protocol);

The protocol that this Channel can handle

Returns:
Sets the Segment that this channel will connect to on the distant side

Parameters:
segment
	void setSegment(String segment);

Returns the segment of this Channel

Returns:
Returns a copy of this Channel
Sets a Vector of protocols that this Channel shall handle

Parameters:
protocols
	void setProtocols(Vector protocols);
    public boolean isDefaultGw();
	public void setDefaultGw(boolean defaultGw);
	boolean isConnected();
	void setConnected(boolean connected);
	void setReceiveRoutingInfo(boolean receiveRoutingInfo);
New to GrepCode? Check out our FAQ X