001: /**
002: * $Id: NetFileContext.java,v 1.22 2005/07/16 18:34:51 aa147324 Exp $
003: * Copyright 2002 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */
014:
015: /**
016: * This interface defines the methods to access DSAME
017: * from the NetFile application
018: *
019: * This interface defines methods to verify if for a user
020: * policy and service have been assigned individually or as
021: * a whole.
022: *
023: * It also has methods to detemine the session validity.
024: *
025: * @author Suresh Yellamaraju
026: */package com.sun.portal.netfile.servlet.java2;
027:
028: import java.util.Hashtable;
029: import com.sun.portal.log.common.PortalLogger;
030: import java.util.Map;
031: import java.util.Locale;
032: import java.util.List;
033:
034: import javax.servlet.http.*;
035:
036: import com.iplanet.sso.SSOToken;
037: import com.iplanet.sso.SSOException;
038: import com.iplanet.am.sdk.AMException;
039:
040: public interface NetFileContext {
041:
042: /*
043: * The services currently referenced by NetFile
044: */
045: public static final String SRAP_NETFILE_SERVICE = "srapNetFileService";
046: public static final String IPS_SSO_ADAPTER_SERVICE = "SunSSOAdapterService";
047: public static final String IPS_SSO_ADAPTER_CONFIG = "sunSSOAdapterConfigurations";
048: public static final String DSAME_USER_SERVICE = "iPlanetAMUserService";
049: public static final String IS_SVC_VERSION = "1.0";
050:
051: /*
052: * System Type Names
053: */
054: public static final String SRAP_NF_WIN = "WIN";
055: public static final String SRAP_NF_NT = "NT";
056: public static final String SRAP_NF_NFS = "NFS";
057: public static final String SRAP_NF_FTP = "FTP";
058: public static final String SRAP_NF_NETWARE = "NETWARE";
059:
060: /*
061: * Global Attribute Names
062: */
063: public static final String SRAP_NF_APPNAME = "sunPortalNetFileApplicationName";
064: public static final String SRAP_NF_APPVERSION = "sunPortalNetFileApplicationRelease";
065: public static final String SRAP_NF_APPRELEASE = "sunPortalNetFileApplicationReleaseDate";
066: public static final String SRAP_NF_COMPNAME = "sunPortalNetFileCompanyName";
067:
068: /*
069: * Organization-level Attribute (dynamic) Names
070: */
071: public static final String SRAP_NF_MIMELOCATION = "sunPortalNetFileMimetypesConfigFileLocation";
072:
073: /*
074: * Policy Attribute Name
075: */
076: public static final String SRAP_NF_EXECUTE = "sunPortalNetFileExecute";
077:
078: /*
079: * Dynamic/User Attribute Names
080: */
081: public static final String SRAP_NF_DENYHOST = "sunPortalNetFileDeniedHostList";
082: public static final String SRAP_NF_ALLOWEDHOST = "sunPortalNetFileAllowedHostList";
083: public static final String SRAP_NF_USERDENYHOST = "sunPortalNetFileUserDeniedHostList";
084: public static final String SRAP_NF_COMHOST = "sunPortalNetFileCommonHostData";
085: public static final String SRAP_NF_USERCOMHOST = "sunPortalNetFileUserCommonHostData";
086: public static final String SRAP_NF_MAXSEARCHDIR = "sunPortalNetFileMaxSearchDir";
087: public static final String SRAP_NF_USERHOST = "sunPortalNetFileHostTypePassShare";
088: public static final String SRAP_NF_INVALIDHOST = "sunPortalNetFileInvalidHost";
089: public static final String SRAP_NF_WINACCESS = "sunPortalNetFileAccessWin";
090: public static final String SRAP_NF_NFSACCESS = "sunPortalNetFileAccessNFS";
091: public static final String SRAP_NF_FTPACCESS = "sunPortalNetFileAccessFTP";
092: public static final String SRAP_NF_NETWAREACCESS = "sunPortalNetFileAccessNetware";
093: public static final String SRAP_NF_ALLOWDELETE = "sunPortalNetFileAllowDelete";
094: public static final String SRAP_NF_ALLOWRENAME = "sunPortalNetFileAllowRename";
095: public static final String SRAP_NF_CHANGEUID = "sunPortalNetFileAllowChangeUserId";
096: public static final String SRAP_NF_CHANGEDOMAIN = "sunPortalNetFileAllowChangeDomain";
097: public static final String SRAP_NF_UPLOADLIMIT = "sunPortalNetFileFileUploadLimit";
098: public static final String SRAP_NF_DOMAIN = "sunPortalNetFileDefaultDomain";
099: public static final String SRAP_NF_NTDOMAIN = "sunPortalNetFileNTDomain";
100: public static final String SRAP_NF_WINLOC = "sunPortalNetFileWindowLocation";
101: public static final String SRAP_NF_WINSIZE = "sunPortalNetFileWindowSize";
102: public static final String SRAP_NF_HOSTDETECTORDER = "sunPortalNetFileHostDetectOrder";
103: public static final String SRAP_NF_OSCHARSET = "sunPortalNetFileOSCharSet";
104: public static final String SRAP_NF_TEMPDIR = "sunPortalNetFileTempDir";
105: public static final String SRAP_NF_WINNAMESERVER = "sunPortalNetFileWINSServer";
106:
107: public static final String SRAP_NF_ALLOWMAIL = "sunPortalNetFileAllowMail";
108: public static final String SRAP_NF_ALLOWSEARCH = "sunPortalNetFileAllowSearch";
109: public static final String SRAP_NF_ALLOWCOMPRESS = "sunPortalNetFileAllowCompression";
110:
111: public static final String SRAP_NF_ALLOWUPLOAD = "sunPortalNetFileAllowUpload";
112: public static final String SRAP_NF_ALLOWDOWNLOAD = "sunPortalNetFileAllowDownload";
113:
114: public static final String SRAP_NF_COMPRESSIONTYPE = "sunPortalNetFileCompressionType";
115: public static final String SRAP_NF_COMPRESSIONLEVEL = "sunPortalNetFileCompressionLevel";
116:
117: /*
118: * Public API that should be implemented for access to NetFile and User's
119: * profile and session.
120: */
121: public Map[] getPreferences();
122:
123: public Map getUserPreferences() throws Exception;
124:
125: public void loadMailAttributesAsCollection(Hashtable htMailData);
126:
127: public List getOrganizationAttributeValues(String serviceName,
128: String attributeName);
129:
130: public String getOrganizationAttribute(String szServiceName,
131: String szAttributeName, String szDefaultVal);
132:
133: public boolean savePreferences(Map prefs) throws Exception;
134:
135: /*
136: * isExecutable determines if the given user
137: * has the service and policy are assigned
138: */
139: public boolean isExecutable(SSOToken token);
140:
141: public boolean isPolicyAssigned(SSOToken ssoToken)
142: throws AMException, SSOException;
143:
144: public boolean isServiceAssigned(String szServiceName)
145: throws AMException, SSOException;
146:
147: public boolean isSessionValid(SSOToken ssoToken);
148:
149: /*
150: * Determines the HTML character set depending on the HTTP request
151: * Uses the client detection service of DSAME
152: *
153: * NOTE: The determination needs to be done before getHTMLCharset is invoked
154: */
155: public void determineHTMLCharset(HttpServletRequest req);
156:
157: public String getHTMLCharset();
158:
159: public Locale getUserLocale();
160:
161: }
|