/*
* Copyright (c) 1999 Sun Microsystems, Inc. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
* and its documentation for NON-COMMERCIAL purposes and without
* fee is hereby granted provided that this copyright notice
* appears in all copies. Please refer to the file "copyright.html"
* for further important copyright and licensing information.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
* THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/
/**
* ECTF working group internal, sensitive and confidential,
* not for public distribution.
*/
package javax.telephony.media;
import java.util.Hashtable;
/**
* This class defines (Format == 0), for ECTF defined Symbols
* in accordance with the S.100-R2 specification.
* <p>
* The list of Symbols and their names was machine generated from
* the S.100 R2 header file listing. Some edits have been made
* to fix errors and omissions in S.100 R2.
* <p>
* The internal numeric value of a Symbol is partitioned into fields:<br>
* Format (2 LSBs), and for format = 00:<br>
* Reserved (next 2 LSBs), Object (next 12 LSBs), Item (top 16 bits)<br>
* <p>
* For ECTF S.100-R2 Symbols, the Vendor (ECTF) is <i>implicity</i> <b>zero</b>.
*/
//package
class R2Symbol extends Symbol {
/** IIIIIIIIIIIIIIIIOOOOOOOOOOOOXXFF */
private static final int maskFormat = 0x00000003; // format bits [==0]
private static final int maskVendor = 0x00000003; // format & vendor [==0]
private static final int maskObject = 0x0000ffff; // object bits
private static final int maskItem = 0xffff0000; // just the Item bits
private static final int objShift = 4;
private static final int itemShift = 16;
/* Inherit from Symbol:
protected int value = 0;
*/
protected int getFormat() {
return (value & maskFormat);
}
protected int getVendor() {
return (value & maskVendor);
}
protected int getObject() {
return (value & maskObject);
}
protected int getItem() {
return (value & maskItem);
}
/** default contstructor. */
protected R2Symbol() {this(0,0);}
/** Constructor for ECTF defined Symbols. */
protected R2Symbol(int obj, int item) {
value = ((item<<itemShift) + (obj<<objShift) + 0);
}
/** this static method avoids a few keystrokes for "new " */
protected static Symbol r2Symbol(int obj, int item) {
return new R2Symbol(obj, item);
}
// editors note: change c/KVSet/KVS/ c/FaxService/Fax/
// c/Srv/Service/
/**************************************************************
* ECTF defined symbol object values.
**************************************************************/
protected static final int Any_ = 0x0000; // Any object
protected static final int ASR_ = 0x0001; // ASR
protected static final int CCR_ = 0x0002; // Call Channel Resource
protected static final int CPR_ = 0x0003; // Conference Port Resource
protected static final int Container_ = 0x0004; // Container
protected static final int Error_ = 0x0005; // Error
protected static final int FaxReceiver_= 0x0006; // FAX Receiver
protected static final int FaxSender_ = 0x0007; // Fax Sender
protected static final int Faxll_ = 0x0008; // Fax Low Level
protected static final int Fax_ = 0x0009; // Fax Service
protected static final int Group_ = 0x000A; // Group
protected static final int KVS_ = 0x000B; // KVSet
protected static final int Language_ = 0x000C; // Language
protected static final int Macro_ = 0x000D; // Macro
protected static final int Message_ = 0x000E; // Message
protected static final int Player_ = 0x000F; // Player
protected static final int Recorder_ = 0x0010; // Recorder
protected static final int SCR_ = 0x0011; // SCR
protected static final int Session_ = 0x0012; // Session
protected static final int SD_ = 0x0013; // Signal Detector
protected static final int SG_ = 0x0014; // Signal Generator
protected static final int Admin_ = 0x0015; // Administration
protected static final int SessionManager_= 0x0016; // Session Manager
protected static final int Symbol_ = 0x0017; // Symbol Table
protected static final int Application_= 0x0018; // Local Application
protected static final int Service_ = 0x0019; // Application service
/** use R2Symbol class for making Symbols with value:(format==0) */
static {registerFormatClass(0, R2Symbol.class);}
/** Setup print string translations for "Object" */
static {
setObjectName(Any_ <<objShift, "Any");
setObjectName(ASR_ <<objShift, "ASR");
setObjectName(CCR_ <<objShift, "CCR");
setObjectName(CPR_ <<objShift, "CPR");
setObjectName(Container_ <<objShift, "Container");
setObjectName(Error_ <<objShift, "Error");
setObjectName(FaxReceiver_ <<objShift, "FaxReceiver");
setObjectName(FaxSender_ <<objShift, "FaxSender");
setObjectName(Faxll_ <<objShift, "Faxll");
setObjectName(Fax_ <<objShift, "Fax");
setObjectName(Group_ <<objShift, "Group");
setObjectName(KVS_ <<objShift, "KVS");
setObjectName(Language_ <<objShift, "Language");
setObjectName(Macro_ <<objShift, "Macro");
setObjectName(Message_ <<objShift, "Message");
setObjectName(Player_ <<objShift, "Player");
setObjectName(Recorder_ <<objShift, "Recorder");
setObjectName(SCR_ <<objShift, "SCR");
setObjectName(Session_ <<objShift, "Session");
setObjectName(SD_ <<objShift, "SD");
setObjectName(SG_ <<objShift, "SG");
setObjectName(Admin_ <<objShift, "Admin");
setObjectName(SessionManager_ <<objShift, "SessionManager");
setObjectName(Symbol_ <<objShift, "Symbol");
setObjectName(Application_ <<objShift, "Application");
setObjectName(Service_ <<objShift, "AppService");
}
/***************************************************************
* Definitions of standard error codes.
* <p>
* Errors, while not strictly speaking an object or service type,
* must have a common name space,
* and so have their own Object Name/Value defined.
* <p>
* Note that all errors within each vendor's number space
* share that number space - i.e. there is no further
* error partitioning by resource type. This is consistent
* with the reality that there is a great deal of overlap
* in the errors generated by different resource requests.
**************************************************************/
final static Symbol Error_ResourceClass = r2Symbol(Error_, 0x000);
final static Symbol Error_OK = r2Symbol(Error_, 0x001);
final static Symbol Error_BadArg = r2Symbol(Error_, 0x002);
final static Symbol Error_BadASI = r2Symbol(Error_, 0x003);
final static Symbol Error_BadContainer = r2Symbol(Error_, 0x004);
final static Symbol Error_BadContainerName = r2Symbol(Error_, 0x005);
final static Symbol Error_BadContext = r2Symbol(Error_, 0x006);
final static Symbol Error_BadDataFlow = r2Symbol(Error_, 0x007);
final static Symbol Error_BadDataID = r2Symbol(Error_, 0x008);
final static Symbol Error_BadDestAddress = r2Symbol(Error_, 0x009);
final static Symbol Error_BadEvent = r2Symbol(Error_, 0x00A);
final static Symbol Error_BadFaxSVC = r2Symbol(Error_, 0x00B);
final static Symbol Error_BadFileFormat = r2Symbol(Error_, 0x00C);
final static Symbol Error_BadFunction = r2Symbol(Error_, 0x00D);