001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.midp.security;
028:
029: /**
030: * The attributes of a permission group.
031: */
032: public final class PermissionGroup {
033: /** Name string ID. */
034: private int name;
035:
036: /** Settings question ID. */
037: private int settingsQuestion;
038:
039: /** Disable setting choice string ID. */
040: private int disableSettingChoice;
041:
042: /** Title string ID for the permission dialog. */
043: private int runtimeDialogTitle;
044:
045: /** Question string ID for the permission dialog. */
046: private int runtimeQuestion;
047:
048: /** Oneshot question string ID for the permission dialog. */
049: private int runtimeOneshotQuestion;
050:
051: /** Identified Third Party domain maxium permission level. */
052: private byte identifiedMaxiumLevel;
053:
054: /** Identified Third Party domain default permission level. */
055: private byte identifiedDefaultLevel;
056:
057: /** Unidentified Third Party domain maxium permission level. */
058: private byte unidentifiedMaxiumLevel;
059:
060: /** Unidentified Third Party domain default permission level. */
061: private byte unidentifiedDefaultLevel;
062:
063: /**
064: * Constructs a third party domain permission group.
065: *
066: * @param theName name of the group
067: * @param theSettingsQuestion question for the settings dialog
068: * @param theDisableSettingChoice disable setting choice
069: * @param theRuntimeDialogTitle Title for the runtime permission dialog
070: * @param theRuntimeQuestion Question for the runtime permission dialog
071: * @param theRuntimeOneshotQuestion Oneshot question for the runtime
072: * permission dialog
073: * @param theIdentifiedMaxiumLevel Identified Third Party domain
074: * maxium permission level
075: * @param theIdentifiedDefaultLevel Identified Third Party domain
076: * default permission level
077: * @param theUnidentifiedMaxiumLevel Unidentified Third Party domain
078: * maxium permission level
079: * @param theUnidentifiedDefaultLevel Unidentified Third Party domain
080: * default permission level
081: */
082: PermissionGroup(int theName, int theSettingsQuestion,
083: int theDisableSettingChoice, int theRuntimeDialogTitle,
084: int theRuntimeQuestion, int theRuntimeOneshotQuestion,
085: byte theIdentifiedMaxiumLevel,
086: byte theIdentifiedDefaultLevel,
087: byte theUnidentifiedMaxiumLevel,
088: byte theUnidentifiedDefaultLevel) {
089:
090: name = theName;
091: settingsQuestion = theSettingsQuestion;
092: disableSettingChoice = theDisableSettingChoice;
093: runtimeDialogTitle = theRuntimeDialogTitle;
094: runtimeQuestion = theRuntimeQuestion;
095: identifiedMaxiumLevel = theIdentifiedMaxiumLevel;
096: identifiedDefaultLevel = theIdentifiedDefaultLevel;
097: unidentifiedMaxiumLevel = theUnidentifiedMaxiumLevel;
098: unidentifiedDefaultLevel = theUnidentifiedDefaultLevel;
099: }
100:
101: /**
102: * Get the name string ID.
103: *
104: * @return string ID or zero if there is no name for the settings dialog
105: */
106: public int getName() {
107: return name;
108: }
109:
110: /**
111: * Get the settings question ID.
112: *
113: * @return stringID or 0 if there is no question
114: */
115: public int getSettingsQuestion() {
116: return settingsQuestion;
117: }
118:
119: /**
120: * Get the disable setting choice string ID.
121: *
122: * @return string ID or 0 if there is not disable setting choice
123: */
124: public int getDisableSettingChoice() {
125: return disableSettingChoice;
126: }
127:
128: /**
129: * Get the title string ID for the permission dialog.
130: *
131: * @return string ID
132: */
133: public int getRuntimeDialogTitle() {
134: return runtimeDialogTitle;
135: }
136:
137: /**
138: * Get the question string ID for the permission dialog.
139: *
140: * @return string ID
141: */
142: public int getRuntimeQuestion() {
143: return runtimeQuestion;
144: }
145:
146: /**
147: * Get the oneshot question string ID for the permission dialog.
148: *
149: * @return string ID
150: */
151: public int getRuntimeOneshotQuestion() {
152: if (runtimeOneshotQuestion == 0) {
153: return runtimeQuestion;
154: }
155:
156: return runtimeOneshotQuestion;
157: }
158:
159: /**
160: * Get the identified Third Party domain maxium permission level.
161: *
162: * @return permission level
163: */
164: public byte getIdentifiedMaxiumLevel() {
165: return identifiedMaxiumLevel;
166: }
167:
168: /**
169: * Get the identified Third Party domain default permission level.
170: *
171: * @return permission level
172: */
173: public byte getIdentifiedDefaultLevel() {
174: return identifiedDefaultLevel;
175: }
176:
177: /**
178: * Get the unidentified Third Party domain maxium permission level.
179: *
180: * @return permission level
181: */
182: public byte getUnidentifiedMaxiumLevel() {
183: return unidentifiedMaxiumLevel;
184: }
185:
186: /**
187: * Get the unidentified Third Party domain default permission level.
188: *
189: * @return permission level
190: */
191: public byte getUnidentifiedDefaultLevel() {
192: return unidentifiedDefaultLevel;
193: }
194: }
|