connectivity/com.nokia.tcf/src/com/nokia/tcf/api/ITCConnection.java
author cawthron
Tue, 24 Mar 2009 22:20:21 -0500
changeset 2 d760517a8095
child 60 9d2210c8eed2
permissions -rw-r--r--
new
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
/*
cawthron
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
cawthron
parents:
diff changeset
     3
* All rights reserved.
cawthron
parents:
diff changeset
     4
* This component and the accompanying materials are made available
cawthron
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
cawthron
parents:
diff changeset
     6
* which accompanies this distribution, and is available
cawthron
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
cawthron
parents:
diff changeset
     8
*
cawthron
parents:
diff changeset
     9
* Initial Contributors:
cawthron
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
cawthron
parents:
diff changeset
    11
*
cawthron
parents:
diff changeset
    12
* Contributors:
cawthron
parents:
diff changeset
    13
*
cawthron
parents:
diff changeset
    14
* Description: 
cawthron
parents:
diff changeset
    15
*
cawthron
parents:
diff changeset
    16
*/
cawthron
parents:
diff changeset
    17
/**
cawthron
parents:
diff changeset
    18
 * 
cawthron
parents:
diff changeset
    19
 */
cawthron
parents:
diff changeset
    20
package com.nokia.tcf.api;
cawthron
parents:
diff changeset
    21
cawthron
parents:
diff changeset
    22
import org.eclipse.core.runtime.IStatus;
cawthron
parents:
diff changeset
    23
cawthron
parents:
diff changeset
    24
/**
cawthron
parents:
diff changeset
    25
 * This interface the basis of all connection type classes. Instantiate one of these classes using
cawthron
parents:
diff changeset
    26
 * the TCFClassFactory for the connection type required.
cawthron
parents:
diff changeset
    27
 * 
cawthron
parents:
diff changeset
    28
 */
cawthron
parents:
diff changeset
    29
public interface ITCConnection {
cawthron
parents:
diff changeset
    30
	
cawthron
parents:
diff changeset
    31
	/**
cawthron
parents:
diff changeset
    32
	 * Connection types
cawthron
parents:
diff changeset
    33
	 */
cawthron
parents:
diff changeset
    34
	public final int MEDIA_REALTCP = 2;
cawthron
parents:
diff changeset
    35
	public final int MEDIA_REALSERIAL = 3;
cawthron
parents:
diff changeset
    36
	public final int MEDIA_VIRTUALSERIAL = 4;
cawthron
parents:
diff changeset
    37
	public final int MEDIA_USB = 5;
cawthron
parents:
diff changeset
    38
cawthron
parents:
diff changeset
    39
	/**
cawthron
parents:
diff changeset
    40
	 * Default retry interval and retry timeout (in seconds)
cawthron
parents:
diff changeset
    41
	 */
cawthron
parents:
diff changeset
    42
	public final long DEFAULT_COMM_ERROR_RETRY_INTERVAL = 1; // 1 second
cawthron
parents:
diff changeset
    43
	public final long DEFAULT_COMM_ERROR_RETRY_TIMEOUT = 5*60; // 5 minutes
cawthron
parents:
diff changeset
    44
cawthron
parents:
diff changeset
    45
	/**
cawthron
parents:
diff changeset
    46
	 * Return a string detailing this connection
cawthron
parents:
diff changeset
    47
	 * @return
cawthron
parents:
diff changeset
    48
	 */
cawthron
parents:
diff changeset
    49
	public String getConnectionDescription();
cawthron
parents:
diff changeset
    50
	/**
cawthron
parents:
diff changeset
    51
	 * Return connection type
cawthron
parents:
diff changeset
    52
	 * @return
cawthron
parents:
diff changeset
    53
	 */
cawthron
parents:
diff changeset
    54
	public int getConnectionType();
cawthron
parents:
diff changeset
    55
	/**
cawthron
parents:
diff changeset
    56
	 * Get the current retry interval in seconds
cawthron
parents:
diff changeset
    57
	 * @return
cawthron
parents:
diff changeset
    58
	 */
cawthron
parents:
diff changeset
    59
	public long getRetryInterval();
cawthron
parents:
diff changeset
    60
	/**
cawthron
parents:
diff changeset
    61
	 * Get the current retry timeout in seconds
cawthron
parents:
diff changeset
    62
	 * @return
cawthron
parents:
diff changeset
    63
	 */
cawthron
parents:
diff changeset
    64
	public long getRetryTimeout();
cawthron
parents:
diff changeset
    65
	/**
cawthron
parents:
diff changeset
    66
	 * Set the connection type
cawthron
parents:
diff changeset
    67
	 * @param inConnectionType
cawthron
parents:
diff changeset
    68
	 * @return IStatus
cawthron
parents:
diff changeset
    69
	 */
cawthron
parents:
diff changeset
    70
	public IStatus setConnectionType(int inConnectionType);
cawthron
parents:
diff changeset
    71
	
cawthron
parents:
diff changeset
    72
	/**
cawthron
parents:
diff changeset
    73
	 * Set the retry interval after a comm error in seconds. The default is 1 second. 
cawthron
parents:
diff changeset
    74
	 * Must be >= 1 second and less then retry timeout.
cawthron
parents:
diff changeset
    75
	 * 
cawthron
parents:
diff changeset
    76
	 * @param inRetryInterval in seconds
cawthron
parents:
diff changeset
    77
	 * @return IStatus
cawthron
parents:
diff changeset
    78
	 */
cawthron
parents:
diff changeset
    79
	public IStatus setRetryInterval(long inRetryInterval);
cawthron
parents:
diff changeset
    80
	/**
cawthron
parents:
diff changeset
    81
	 * Set the retry timeout after a comm error in seconds. The default is 5 minutes.
cawthron
parents:
diff changeset
    82
	 * Must be > then the retry interval.
cawthron
parents:
diff changeset
    83
	 * 
cawthron
parents:
diff changeset
    84
	 * @param inRetryTimeout in seconds
cawthron
parents:
diff changeset
    85
	 * @return IStatus
cawthron
parents:
diff changeset
    86
	 */
cawthron
parents:
diff changeset
    87
	public IStatus setRetryTimeout(long inRetryTimeout);
cawthron
parents:
diff changeset
    88
cawthron
parents:
diff changeset
    89
	/**
cawthron
parents:
diff changeset
    90
	 * Specify which message format to decode on incoming messages
cawthron
parents:
diff changeset
    91
	 * A string to indicate the formatting types
cawthron
parents:
diff changeset
    92
	 * e.g. "platsim", "ost", etc.
cawthron
parents:
diff changeset
    93
	 * 
cawthron
parents:
diff changeset
    94
	 * @param inDecodeFormat
cawthron
parents:
diff changeset
    95
	 */
cawthron
parents:
diff changeset
    96
	public IStatus setDecodeFormat(String inDecodeFormat);
cawthron
parents:
diff changeset
    97
cawthron
parents:
diff changeset
    98
	/**
cawthron
parents:
diff changeset
    99
	 * Returns the current decode format for this connection
cawthron
parents:
diff changeset
   100
	 * 
cawthron
parents:
diff changeset
   101
	 * @return
cawthron
parents:
diff changeset
   102
	 */
cawthron
parents:
diff changeset
   103
	public String getDecodeFormat();
cawthron
parents:
diff changeset
   104
}