connectivity/com.nokia.tcf/src/com/nokia/tcf/impl/TCMessageOptions.java
author cawthron
Tue, 24 Mar 2009 22:20:21 -0500
changeset 2 d760517a8095
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.impl;
cawthron
parents:
diff changeset
    21
cawthron
parents:
diff changeset
    22
import org.eclipse.core.runtime.IPath;
cawthron
parents:
diff changeset
    23
import org.eclipse.core.runtime.IStatus;
cawthron
parents:
diff changeset
    24
import org.eclipse.core.runtime.Status;
cawthron
parents:
diff changeset
    25
cawthron
parents:
diff changeset
    26
import com.nokia.tcf.Activator;
cawthron
parents:
diff changeset
    27
import com.nokia.tcf.api.ITCMessageOptions;
cawthron
parents:
diff changeset
    28
import com.nokia.tcf.api.TCErrorConstants;
cawthron
parents:
diff changeset
    29
cawthron
parents:
diff changeset
    30
public class TCMessageOptions implements ITCMessageOptions {
cawthron
parents:
diff changeset
    31
cawthron
parents:
diff changeset
    32
	private long encodeFormat;
cawthron
parents:
diff changeset
    33
	private byte ostVersion;
cawthron
parents:
diff changeset
    34
	private long unWrapFormat;
cawthron
parents:
diff changeset
    35
	private long inputStreamSize;
cawthron
parents:
diff changeset
    36
	private IStatus statusOK;
cawthron
parents:
diff changeset
    37
	private long messageDestination;
cawthron
parents:
diff changeset
    38
	private IPath messageFile;
cawthron
parents:
diff changeset
    39
	
cawthron
parents:
diff changeset
    40
	
cawthron
parents:
diff changeset
    41
	/**
cawthron
parents:
diff changeset
    42
	 * All parameters are defaulted.
cawthron
parents:
diff changeset
    43
	 */
cawthron
parents:
diff changeset
    44
	public TCMessageOptions() {
cawthron
parents:
diff changeset
    45
		super();
cawthron
parents:
diff changeset
    46
		encodeFormat = ITCMessageOptions.DEFAULT_ENCODE_FORMAT;
cawthron
parents:
diff changeset
    47
		inputStreamSize = ITCMessageOptions.DEFAULT_BUFFER_SIZE;
cawthron
parents:
diff changeset
    48
		ostVersion = ITCMessageOptions.DEFAULT_OST_VERSION;
cawthron
parents:
diff changeset
    49
		unWrapFormat = ITCMessageOptions.DEFAULT_UNWRAP_OPTION;
cawthron
parents:
diff changeset
    50
		messageDestination = ITCMessageOptions.DEFAULT_DESTINATION;
cawthron
parents:
diff changeset
    51
		statusOK = new Status(Status.OK, Activator.PLUGIN_ID, (int)TCErrorConstants.TCAPI_ERR_NONE, "OK", null);
cawthron
parents:
diff changeset
    52
	}
cawthron
parents:
diff changeset
    53
cawthron
parents:
diff changeset
    54
	/**
cawthron
parents:
diff changeset
    55
	 * Uses a client specified message file instead of the input stream.
cawthron
parents:
diff changeset
    56
	 * All other parameters are defaulted.
cawthron
parents:
diff changeset
    57
	 * 
cawthron
parents:
diff changeset
    58
	 * @param inMessageFile - full path to client's file to write.
cawthron
parents:
diff changeset
    59
	 */
cawthron
parents:
diff changeset
    60
	public TCMessageOptions(IPath inMessageFile) {
cawthron
parents:
diff changeset
    61
		this();
cawthron
parents:
diff changeset
    62
		messageDestination = ITCMessageOptions.DESTINATION_CLIENTFILE;
cawthron
parents:
diff changeset
    63
		messageFile = inMessageFile;
cawthron
parents:
diff changeset
    64
	}
cawthron
parents:
diff changeset
    65
cawthron
parents:
diff changeset
    66
	/* (non-Javadoc)
cawthron
parents:
diff changeset
    67
	 * @see com.nokia.tcf.api.ITCMessageOptions#getInputStreamSize()
cawthron
parents:
diff changeset
    68
	 */
cawthron
parents:
diff changeset
    69
	public long getInputStreamSize() {
cawthron
parents:
diff changeset
    70
		return this.inputStreamSize;
cawthron
parents:
diff changeset
    71
	}
cawthron
parents:
diff changeset
    72
cawthron
parents:
diff changeset
    73
	/* (non-Javadoc)
cawthron
parents:
diff changeset
    74
	 * @see com.nokia.tcf.api.ITCMessageOptions#getMessageEncodeFormat()
cawthron
parents:
diff changeset
    75
	 */
cawthron
parents:
diff changeset
    76
	public long getMessageEncodeFormat() {
cawthron
parents:
diff changeset
    77
		return this.encodeFormat;
cawthron
parents:
diff changeset
    78
	}
cawthron
parents:
diff changeset
    79
cawthron
parents:
diff changeset
    80
	/* (non-Javadoc)
cawthron
parents:
diff changeset
    81
	 * @see com.nokia.tcf.api.ITCMessageOptions#getOSTVersion()
cawthron
parents:
diff changeset
    82
	 */
cawthron
parents:
diff changeset
    83
	public byte getOSTVersion() {
cawthron
parents:
diff changeset
    84
		return this.ostVersion;
cawthron
parents:
diff changeset
    85
	}
cawthron
parents:
diff changeset
    86
cawthron
parents:
diff changeset
    87
	/* (non-Javadoc)
cawthron
parents:
diff changeset
    88
	 * @see com.nokia.tcf.api.ITCMessageOptions#getUnWrapFormat()
cawthron
parents:
diff changeset
    89
	 */
cawthron
parents:
diff changeset
    90
	public long getUnWrapFormat() {
cawthron
parents:
diff changeset
    91
		return this.unWrapFormat;
cawthron
parents:
diff changeset
    92
	}
cawthron
parents:
diff changeset
    93
cawthron
parents:
diff changeset
    94
	/* (non-Javadoc)
cawthron
parents:
diff changeset
    95
	 * @see com.nokia.tcf.api.ITCMessageOptions#setInputStreamSize(long)
cawthron
parents:
diff changeset
    96
	 */
cawthron
parents:
diff changeset
    97
	public IStatus setInputStreamSize(long inBufferSize) {
cawthron
parents:
diff changeset
    98
		IStatus status = this.statusOK; 
cawthron
parents:
diff changeset
    99
		this.inputStreamSize = inBufferSize;
cawthron
parents:
diff changeset
   100
		// parameter is check when used
cawthron
parents:
diff changeset
   101
		return status;
cawthron
parents:
diff changeset
   102
	}
cawthron
parents:
diff changeset
   103
cawthron
parents:
diff changeset
   104
	/* (non-Javadoc)
cawthron
parents:
diff changeset
   105
	 * @see com.nokia.tcf.api.ITCMessageOptions#setMessageEncodeFormat(long)
cawthron
parents:
diff changeset
   106
	 */
cawthron
parents:
diff changeset
   107
	public IStatus setMessageEncodeFormat(long inMessageEncodeFormat) {
cawthron
parents:
diff changeset
   108
		IStatus status = this.statusOK; 
cawthron
parents:
diff changeset
   109
		this.encodeFormat = inMessageEncodeFormat;
cawthron
parents:
diff changeset
   110
		// parameter is check when used
cawthron
parents:
diff changeset
   111
		return status;
cawthron
parents:
diff changeset
   112
	}
cawthron
parents:
diff changeset
   113
cawthron
parents:
diff changeset
   114
	/* (non-Javadoc)
cawthron
parents:
diff changeset
   115
	 * @see com.nokia.tcf.api.ITCMessageOptions#setOSTVersion(byte)
cawthron
parents:
diff changeset
   116
	 */
cawthron
parents:
diff changeset
   117
	public IStatus setOSTVersion(byte inOSTVersion) {
cawthron
parents:
diff changeset
   118
		IStatus status = this.statusOK; 
cawthron
parents:
diff changeset
   119
		this.ostVersion = inOSTVersion;
cawthron
parents:
diff changeset
   120
		// parameter is check when used
cawthron
parents:
diff changeset
   121
		return status;
cawthron
parents:
diff changeset
   122
	}
cawthron
parents:
diff changeset
   123
cawthron
parents:
diff changeset
   124
	/* (non-Javadoc)
cawthron
parents:
diff changeset
   125
	 * @see com.nokia.tcf.api.ITCMessageOptions#setUnWrapFormat(long)
cawthron
parents:
diff changeset
   126
	 */
cawthron
parents:
diff changeset
   127
	public IStatus setUnWrapFormat(long inUnWrapFormat) {
cawthron
parents:
diff changeset
   128
		IStatus status = this.statusOK; 
cawthron
parents:
diff changeset
   129
		this.unWrapFormat = inUnWrapFormat;
cawthron
parents:
diff changeset
   130
		// parameter is check when used
cawthron
parents:
diff changeset
   131
		return status;
cawthron
parents:
diff changeset
   132
	}
cawthron
parents:
diff changeset
   133
cawthron
parents:
diff changeset
   134
	/*
cawthron
parents:
diff changeset
   135
	 * (non-Javadoc)
cawthron
parents:
diff changeset
   136
	 * @see com.nokia.tcf.api.ITCMessageOptions#getMessageDestination()
cawthron
parents:
diff changeset
   137
	 */
cawthron
parents:
diff changeset
   138
	public long getMessageDestination() {
cawthron
parents:
diff changeset
   139
		return messageDestination;
cawthron
parents:
diff changeset
   140
	}
cawthron
parents:
diff changeset
   141
cawthron
parents:
diff changeset
   142
	/*
cawthron
parents:
diff changeset
   143
	 * (non-Javadoc)
cawthron
parents:
diff changeset
   144
	 * @see com.nokia.tcf.api.ITCMessageOptions#getMessageFile()
cawthron
parents:
diff changeset
   145
	 */
cawthron
parents:
diff changeset
   146
	public IPath getMessageFile() {
cawthron
parents:
diff changeset
   147
		return messageFile;
cawthron
parents:
diff changeset
   148
	}
cawthron
parents:
diff changeset
   149
cawthron
parents:
diff changeset
   150
	/*
cawthron
parents:
diff changeset
   151
	 * (non-Javadoc)
cawthron
parents:
diff changeset
   152
	 * @see com.nokia.tcf.api.ITCMessageOptions#setMessageDestination(long)
cawthron
parents:
diff changeset
   153
	 */
cawthron
parents:
diff changeset
   154
	public IStatus setMessageDestination(long inDestination) {
cawthron
parents:
diff changeset
   155
		IStatus status = this.statusOK; 
cawthron
parents:
diff changeset
   156
		messageDestination = inDestination;
cawthron
parents:
diff changeset
   157
		return status;
cawthron
parents:
diff changeset
   158
	}
cawthron
parents:
diff changeset
   159
cawthron
parents:
diff changeset
   160
	/*
cawthron
parents:
diff changeset
   161
	 * (non-Javadoc)
cawthron
parents:
diff changeset
   162
	 * @see com.nokia.tcf.api.ITCMessageOptions#setMessageFile(java.lang.String)
cawthron
parents:
diff changeset
   163
	 */
cawthron
parents:
diff changeset
   164
	public IStatus setMessageFile(IPath inFile) {
cawthron
parents:
diff changeset
   165
		IStatus status = this.statusOK;
cawthron
parents:
diff changeset
   166
		messageFile = inFile;
cawthron
parents:
diff changeset
   167
		return status;
cawthron
parents:
diff changeset
   168
	}
cawthron
parents:
diff changeset
   169
}