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 acl_data;
028:
029: import java.util.Vector;
030:
031: /**
032: * This class represents a set of ACL permissions.
033: */
034: public class ACLPermissions {
035:
036: /** PIN operation constant. */
037: public static final int CMD_VERIFY = 0;
038: /** PIN operation constant. */
039: public static final int CMD_CHANGE = 1;
040: /** PIN operation constant. */
041: public static final int CMD_DISABLE = 2;
042: /** PIN operation constant. */
043: public static final int CMD_ENABLE = 3;
044: /** PIN operation constant. */
045: public static final int CMD_UNBLOCK = 4;
046: /** The number of supported PIN commands. */
047: public static final int CMD_COUNT = 5;
048:
049: /**
050: * Flag that indicates that the object contains permissions.
051: */
052: static final int CHECK = 0;
053:
054: /**
055: * Flag that indicates that MIDlet suite have full access.
056: */
057: static final int ALLOW = 1;
058: /**
059: * Flag that indicates that MIDlet suite have not access.
060: */
061: static final int DISALLOW = 2;
062:
063: /**
064: * Verifier type.
065: */
066: int type = CHECK;
067: /**
068: * The list of permissions.
069: */
070: Vector permissions;
071:
072: /**
073: * Array of PIN data for this permission.
074: */
075: private PINData[] pins;
076:
077: /** Parent ACSlot object, contains PIN attributes. */
078: protected ACFile parent;
079:
080: /**
081: * Constructs new object.
082: * @param parent parent ACSlot object.
083: */
084: public ACLPermissions(ACFile parent) {
085: this .parent = parent;
086: }
087:
088: /**
089: * Set the list of permissions.
090: * @param permissions the list of permissions.
091: */
092: public void setPermissions(Vector permissions) {
093: this .permissions = permissions;
094: }
095:
096: /**
097: * Set type of the permission.
098: * @param type permission type.
099: */
100: public void setType(int type) {
101: this .type = type;
102: }
103:
104: /**
105: * Set PIN data for this permission.
106: * @param data PIN data for this permission.
107: */
108: public void setPINData(PINData[] data) {
109: pins = data;
110: }
111:
112: /** Attributes of the first PIN to be entered. */
113: protected PINAttributes attr1;
114: /** Attributes of the second PIN or null. */
115: protected PINAttributes attr2;
116:
117: }
|