Ontimize 5.2072EN

com.ontimize.locator
Class PermissionReferenceLocator

java.lang.Object
  extended bycom.ontimize.locator.ReferenceLocator
      extended bycom.ontimize.locator.PermissionReferenceLocator
All Implemented Interfaces:
ClientPermissionManager, ClientReferenceLocator, EntityReferenceLocator, INoticeSendMails, INoticeSystem, com.ontimize.ols.LControl, com.ontimize.ols.LOk, java.rmi.Remote, RemoteApplicationPreferenceReferencer, RemotelyManageable, RemoteReportReferencer, java.rmi.server.RMIFailureHandler, ServerPermissionManager, TokenLogin, UtilReferenceLocator, XMLClientProvider, XMLFormProvider
Direct Known Subclasses:
DelegationPermissionReferenceLocator

public class PermissionReferenceLocator
extends ReferenceLocator
implements ClientPermissionManager, ServerPermissionManager, com.ontimize.ols.LControl


Nested Class Summary
protected  class PermissionReferenceLocator.TimeThread
           
 
Nested classes inherited from class com.ontimize.locator.ReferenceLocator
ReferenceLocator.DefaultClientSocketFactory, ReferenceLocator.DefaultSSLClientSocketFactory
 
Nested classes inherited from class com.ontimize.locator.UtilReferenceLocator
UtilReferenceLocator.Message
 
Field Summary
static java.lang.String BUSINESS_CALENDAR_FILE
           
protected  java.lang.String businessCalendarFile
           
static java.lang.String CLIENT_PERMISSION_COLUMN
           
protected  java.lang.String clientPermissionsColumn
           
protected  boolean clientPermissionsInstalled
           
protected  long currentServerTime
           
protected static int DEFAULT_TIME_THREAD_SLEEP
           
static java.lang.String ENTITIES
           
protected  java.util.Vector entityNames
           
static java.lang.String PERMISSION_ENTITY
           
static java.lang.String PERMISSION_GROUP_KEY_COLUMN
           
protected  java.lang.String permissionGroupKeyColumnName
           
protected  java.lang.String permissionsEntity
           
static java.lang.String PROFILE_COLUMN
           
static java.lang.String PROFILE_ENTITY
           
protected  java.lang.String profileColumn
           
protected  java.lang.String profileEntity
           
static java.lang.String SERVER_PERMISSION_COLUMN
           
static java.lang.String SERVER_SECURITY_MANAGER_CLASS
           
protected  java.lang.String serverPermissionsColumn
           
protected  java.lang.String serverSecurityManagerClass
           
protected  PermissionReferenceLocator.TimeThread updateHourServerThread
           
static java.lang.String USER_GROUP_ENTITY
           
protected  java.lang.String userGroupsEntityName
           
 
Fields inherited from class com.ontimize.locator.ReferenceLocator
askUserChangeTimezone, ATTACHMENT_ENTITY, ATTACHMENT_ENTITY_PATH, attachmentEntity, attachmentEntityInstance, attachmentPath, AUTONUMERICAL_PROPERTIES, b, chatCheckTime, chatWindow, CHECK_SERVER_MESSAGES_PERIOD, checkMessagesThread, CUSTOM_SOCKET, cw, databaseEntityManager, DB_PROPERTIES, DEBUG, defaultNoticeDestinyEntityClass, defaultNoticeEntityClass, defaultValueUseServerTimezone, ENCRYPT_PROPERTY, ENTITIES_CLASS, ENTITIES_PROPERTIES, entitiesProperties, entitiesPropertiesClass, formManagerProviderEntity, formManagerProviderEntityFormNameColumn, formManagerProviderEntityIdColumn, formManagerProviderEntityInteractionManagerColumn, formProviderEntity, formProviderEntityFormNameColumn, formProviderEntityFormXMLColumn, IMPOSSIBLE_CONNECT_TO_SERVER, initReferences, installSocketFactory, key, lastRemoteReferenceCheck, loadedEntities, LOCAL, LOCAL_ENTITIES, LOCAL_ENTITIES_PACKAGE, localEntities, localEntitiesPackage, localLocator, localRemoteReportStore, LOGIN_ENTITY, loginEntity, M_NOT_AUTHORIZED, manager, menuProviderEntity, menuProviderEntityXMLColumn, messagesCheckTime, MULTICONNECTION_MANAGER, multiConnectionManager, multiConnectionManagerPath, NEW_CHAT, NOTICE_ENTITY_DESTINY_NAME, NOTICE_ENTITY_NAME, noticeEntity, noticesPath, noticeSystem, offset, offsetString, PACKAGE_OR_HOSTNAME, packageA, port, PORT, printingTemplateEntityInstance, printingTemplatesEntity, privilegedId, propertiesPath, reconnectState, referenceLocatorServer, referenceLocatorServerName, REMOTE_OBJECT_NOT_REGISTERED, REMOTE_REFERENCE_LOCATOR_NAME, remoteReferenceCheckCycle, remoteReferenceClassNames, remoteReferenceInstances, remoteReferenceParameters, REPORT_ENTITIES, reportEntities, reportStore, rOperationManager, s, serverTimeZone, startSession, text, textAttribute, UNKNOWN_ERROR, UNKNOWN_HOST, user, userId, VIEWER, xmlDynamicMenu
 
Fields inherited from interface com.ontimize.security.ClientPermissionManager
PERMISSIONS_KEY
 
Fields inherited from interface com.ontimize.gui.ServerPermissionManager
ENTITY_LIST_KEY, USER_PERMISSIONS_KEY, USER_PROFILE_PERMISSIONS_KEY
 
Fields inherited from interface com.ontimize.gui.RemotelyManageable
ADMINISTRATION_PERMISSION, CONNECTION_INFO, IS_MULTICONNECTION, LOADED_ENTITIES, MULTICONNECTION_IDLIST, MULTICONNECTION_INFO
 
Fields inherited from interface com.ontimize.util.notice.INoticeSystem
INTERNAL_NOTICE_PERIOD, MAIL_CONF_PROPERTIES, NOTICE_CONTENT, NOTICE_CREATE_DATE, NOTICE_DELETE_RECEIVE_NOTICE, NOTICE_DELETE_SEND_NOTICE, NOTICE_DESTINY_KEY, NOTICE_ENTITY_DESTINY_TABLE_DB, NOTICE_ENTITY_TABLE_DB, NOTICE_FORCE_READ, NOTICE_FROM_PARAMETER, NOTICE_KEY, NOTICE_MAILTO_PARAMETER, NOTICE_MESSAGE_COLUMN_NAME, NOTICE_MESSAGE_TYPE_COLUMN_NAME, NOTICE_OTHER_COLUMNS, NOTICE_READ, NOTICE_READ_DATE, NOTICE_RESPONSE_REQUEST, NOTICE_SEND, NOTICE_SEND_DATE, NOTICE_SEND_MAIL, NOTICE_SUBJECT, NOTICE_SYSTEM, NOTICE_TO_PARAMETER, PROP_NOTICE_CLASS_MAIL, PROP_NOTICE_CONFIG_DEFAULT_TEMPLATE, PROP_NOTICE_CONFIG_MAIL, PROP_NOTICE_CONFIG_REQUEST_TEMPLATE, PROP_NOTICE_CONFIG_TEMPLATES, PROP_NOTICE_ENTITY_DESTINY_NAME, PROP_NOTICE_ENTITY_NAME, SEND_MAIL_PERIOD
 
Constructor Summary
PermissionReferenceLocator(boolean local, java.lang.String entityPackageOrRMIServer, java.lang.String entityReferenceLocatorName, int port, java.net.URL dbPropertiesUrl, java.net.URL autonumericalUrl)
           
PermissionReferenceLocator(boolean local, java.lang.String entityPackageOrRMIServer, java.lang.String entityReferenceLocatorName, int port, java.net.URL dbPropertiesUrl, java.net.URL autonumericalUrl, java.lang.String loginEntity)
           
PermissionReferenceLocator(boolean local, java.lang.String entityPackageOrRMIServer, java.lang.String entityReferenceLocatorName, int port, java.net.URL dbPropertiesUrl, java.net.URL autonumericalUrl, java.lang.String permissionEntity, java.lang.String clientPermissionColumn)
           
PermissionReferenceLocator(boolean local, java.lang.String entityPackageOrRMIServer, java.lang.String entityReferenceLocatorName, int port, java.net.URL dbPropertiesUrl, java.net.URL autonumericalUrl, java.lang.String loginEntity, java.lang.String permissionEntity, java.lang.String clientPermissionColumn)
           
PermissionReferenceLocator(java.util.Hashtable params)
          Calls to super() to initialize some parameters and additionally checks permission and profile parameters.
 
Method Summary
 boolean checkActionPermission(java.lang.String entity, java.lang.String action, int sessionId, long time)
          Checks if the specified user has permissions to execute an action in the specified entity
 java.lang.String getBussinesCalendarFile()
           
 java.lang.String getClientPermissionColumn()
           
 EntityResult getClientPermissions(java.util.Hashtable userKeys, int userId)
          userKeys contains the value for user keys.
protected  java.util.Hashtable getContextParams(java.lang.String password)
           
 EntityResult getEntityList(int sessionId)
           
 java.util.Hashtable getParameters()
           
 PermissionGroupInfo[] getPermissionGroupsInfo()
           
 PermissionInfo getPermissionInfo(java.lang.String entity, java.lang.String action, int sessionId)
           
protected  java.lang.StringBuffer getServerPermissions(java.util.Hashtable userKeys)
           
 EntityResult getServerPermissions(java.util.Hashtable userKeys, int sessionId)
          Get the user permissions
 long getTime()
           
 EntityResult getUserProfileServerPermissions(java.util.Hashtable profileKeys, int sessionId)
          Get the permission definition for a specified profile
 void installClientPermissions(java.util.Hashtable keys, int sessionId)
          Sets the client permissions.
protected  void installServerPermissions(int sessionId, java.lang.StringBuffer permissions)
           
protected  void installServerSecurityManager()
           
protected  java.util.Hashtable joinClientPermissions(java.util.List permissions)
           
protected  java.util.Hashtable joinServerPermissions(java.util.List permissions)
           
protected  EntityResult queryGroupPermission(java.util.Hashtable userKeys, java.lang.String columnName)
           
 InitialContext retrieveInitialContext(int sessionId, java.util.Hashtable params)
           
 EntityResult setServerPermissions(java.util.Hashtable keys, int sessionId, java.util.Hashtable permissions)
           
 EntityResult setServerPermissions(java.util.Hashtable keys, int sessionId, java.lang.StringBuffer permissions)
          Sets the server permissions value
 EntityResult setUserProfileServerPermissions(java.util.Hashtable profileKeys, java.lang.StringBuffer permissions, int sessionId)
           
 int startSession(java.lang.String user, java.lang.String password, ClientWatch cw)
          Start a new client session in local or remote mode.
 java.util.Hashtable updateL(java.util.Hashtable h)
           
 
Methods inherited from class com.ontimize.locator.ReferenceLocator
checkNoticeAsSend, checkNoticeSent, checkToken, closeLockedConnections, closeSession, configureConnectionManager, configureMultiConnectionManager, configureRemoteReferences, createConnectionManager, createDatabaseEntityManager, createRemoteReference, endSession, ensureRemoteReferenceLocator, failure, finalize, finishAdministrationRemoteSession, getAttachmentEntity, getChatCheckTime, getConnectedSessionIds, getConnectedUsers, getConnectionManager, getDatabaseConnectionManager, getDEBUGValueRemote, getDefaultPackage, getEntityConnectionManager, getEntityReference, getFormManagerParameters, getInitialContext, getInternalNotices, getLastNCharactersFromLogFile, getLContent, getLInfoObject, getLoadedEntities, getLocalEntity, getLocalEntity, getLoginEntityName, getLValue, getMemoryEntity, getMessageCheckTime, getMessages, getNewMailNotice, getNodeValue, getNoticeEntity, getNoticeEntityDestinyName, getNoticeEntityName, getNoticeTypes, getPasswordFromCert, getPasswordFromCert, getPrintingTemplateEntity, getPrivateEntity, getRemoteApplicationPreferences, getRemoteOperationManager, getRemotePreferencesFile, getRemoteReference, getRemoteReportStore, getReportEntityNames, getSentNotices, getServerTimeZone, getSessionId, getSessionInfo, getSpecialEntity, getStartSessionTime, getSystemInfo, getToken, getUser, getUserFromCert, getUserFromCert, getUserId, getUserIds, getXMLForm, getXMLMenu, hasChat, initServerNotice, installClientRMIFailureHandler, installRMISocketFactory, isAllowCertificateLogin, isDevelopementL, isLocalMode, isMultiConnectionManager, loadEntity, ok, ok, ping, reloadXMLMenu, removeEntity, removeEntity, removeReceivedNotices, removeRemoteReferences, removeSentNotices, restartServer, selectTimeZone, sendMessage, sendMessage, sendMessageToAll, sendNotice, setDEBUGValueRemote, setLocalEntities, setMultiConnectionManager, setNoticesRead, setRemotePreferencesFile, setRemoteReportStore, showMessageDialog, startAdministrationRemoteSession, startCheckMessagesThread, startLocalSession, startRemoteSession, startUserPasswordSession, stopServer, testConnectionSpeed, testConnectionSpeed, updateRemoteReferenceLocator, waitServerForRestart
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITIES

public static final java.lang.String ENTITIES
See Also:
Constant Field Values

SERVER_SECURITY_MANAGER_CLASS

public static final java.lang.String SERVER_SECURITY_MANAGER_CLASS
See Also:
Constant Field Values

PROFILE_COLUMN

public static final java.lang.String PROFILE_COLUMN
See Also:
Constant Field Values

BUSINESS_CALENDAR_FILE

public static final java.lang.String BUSINESS_CALENDAR_FILE
See Also:
Constant Field Values

SERVER_PERMISSION_COLUMN

public static final java.lang.String SERVER_PERMISSION_COLUMN
See Also:
Constant Field Values

CLIENT_PERMISSION_COLUMN

public static final java.lang.String CLIENT_PERMISSION_COLUMN
See Also:
Constant Field Values

PROFILE_ENTITY

public static final java.lang.String PROFILE_ENTITY
See Also:
Constant Field Values

PERMISSION_ENTITY

public static final java.lang.String PERMISSION_ENTITY
See Also:
Constant Field Values

PERMISSION_GROUP_KEY_COLUMN

public static java.lang.String PERMISSION_GROUP_KEY_COLUMN

USER_GROUP_ENTITY

public static java.lang.String USER_GROUP_ENTITY

serverSecurityManagerClass

protected java.lang.String serverSecurityManagerClass

permissionsEntity

protected java.lang.String permissionsEntity

profileEntity

protected java.lang.String profileEntity

clientPermissionsColumn

protected java.lang.String clientPermissionsColumn

serverPermissionsColumn

protected java.lang.String serverPermissionsColumn

userGroupsEntityName

protected java.lang.String userGroupsEntityName

permissionGroupKeyColumnName

protected java.lang.String permissionGroupKeyColumnName

entityNames

protected java.util.Vector entityNames

profileColumn

protected java.lang.String profileColumn

businessCalendarFile

protected java.lang.String businessCalendarFile

clientPermissionsInstalled

protected boolean clientPermissionsInstalled

currentServerTime

protected long currentServerTime

DEFAULT_TIME_THREAD_SLEEP

protected static int DEFAULT_TIME_THREAD_SLEEP

updateHourServerThread

protected PermissionReferenceLocator.TimeThread updateHourServerThread
Constructor Detail

PermissionReferenceLocator

public PermissionReferenceLocator(java.util.Hashtable params)
Calls to super() to initialize some parameters and additionally checks permission and profile parameters.

Parameters:
params - the Hashtable with parameters

attribute values default required meaning
PermissionEntity User yes Permission entity name
ProfileEntity UserProfile no Profile entity name
ProfileColumn Profile no User profile column name. Usually this is a common column between user entity and profile entity.
ClientPermissionColumn ClientPermission yes Name of the column which stores the xml with client permission description
ServerPermissionColumn ServerPermission yes Name of the column which stores the xml with the server permission description
Entities entityname1;entityname2;...;entitynameN no Entity names separated by ';' . This names are used to ask for the references. Only informative value.
BusinessCalendarFile no File name for the business calendar, the file format is the same as bundles, for example: com.ontimize.filename.

PermissionReferenceLocator

public PermissionReferenceLocator(boolean local,
                                  java.lang.String entityPackageOrRMIServer,
                                  java.lang.String entityReferenceLocatorName,
                                  int port,
                                  java.net.URL dbPropertiesUrl,
                                  java.net.URL autonumericalUrl,
                                  java.lang.String loginEntity,
                                  java.lang.String permissionEntity,
                                  java.lang.String clientPermissionColumn)

PermissionReferenceLocator

public PermissionReferenceLocator(boolean local,
                                  java.lang.String entityPackageOrRMIServer,
                                  java.lang.String entityReferenceLocatorName,
                                  int port,
                                  java.net.URL dbPropertiesUrl,
                                  java.net.URL autonumericalUrl,
                                  java.lang.String permissionEntity,
                                  java.lang.String clientPermissionColumn)

PermissionReferenceLocator

public PermissionReferenceLocator(boolean local,
                                  java.lang.String entityPackageOrRMIServer,
                                  java.lang.String entityReferenceLocatorName,
                                  int port,
                                  java.net.URL dbPropertiesUrl,
                                  java.net.URL autonumericalUrl,
                                  java.lang.String loginEntity)

PermissionReferenceLocator

public PermissionReferenceLocator(boolean local,
                                  java.lang.String entityPackageOrRMIServer,
                                  java.lang.String entityReferenceLocatorName,
                                  int port,
                                  java.net.URL dbPropertiesUrl,
                                  java.net.URL autonumericalUrl)
Method Detail

startSession

public int startSession(java.lang.String user,
                        java.lang.String password,
                        ClientWatch cw)
                 throws java.lang.Exception
Description copied from class: ReferenceLocator
Start a new client session in local or remote mode.
If the application has remote server this method calls it.
In local mode the method needs to know the user entity (LoginEntity parameter) to make a query looking for the specified user and password (with keys 'User_' and 'Password' in the Hashtable used in the {#@link Entity.query(Hashtable, Vector, int) method). If this query return one record te session starts.

Specified by:
startSession in interface EntityReferenceLocator
Overrides:
startSession in class ReferenceLocator
Throws:
java.lang.Exception

installServerSecurityManager

protected void installServerSecurityManager()

installServerPermissions

protected void installServerPermissions(int sessionId,
                                        java.lang.StringBuffer permissions)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

queryGroupPermission

protected EntityResult queryGroupPermission(java.util.Hashtable userKeys,
                                            java.lang.String columnName)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getClientPermissions

public EntityResult getClientPermissions(java.util.Hashtable userKeys,
                                         int userId)
                                  throws java.lang.Exception
userKeys contains the value for user keys. This values are not needed when is a local locator, in this case this object can be null.

Specified by:
getClientPermissions in interface ClientPermissionManager
Parameters:
userKeys - This parameters allow to identify the user. In local locator is not needed and can be a null value.
userId -
Returns:
Throws:
java.lang.Exception

getClientPermissionColumn

public java.lang.String getClientPermissionColumn()

installClientPermissions

public void installClientPermissions(java.util.Hashtable keys,
                                     int sessionId)
                              throws java.lang.Exception
Description copied from interface: ClientPermissionManager
Sets the client permissions. Creates a ClientSecurityManager object with all permissions information for the specified user.

Specified by:
installClientPermissions in interface ClientPermissionManager
Parameters:
keys - Keys to identify the user
sessionId - User session identifier
Throws:
java.lang.Exception

getTime

public long getTime()
             throws java.lang.Exception
Specified by:
getTime in interface ClientPermissionManager
Throws:
java.lang.Exception

getEntityList

public EntityResult getEntityList(int sessionId)
                           throws java.lang.Exception
Specified by:
getEntityList in interface ServerPermissionManager
Throws:
java.lang.Exception

setServerPermissions

public EntityResult setServerPermissions(java.util.Hashtable keys,
                                         int sessionId,
                                         java.lang.StringBuffer permissions)
                                  throws java.lang.Exception
Description copied from interface: ServerPermissionManager
Sets the server permissions value

Specified by:
setServerPermissions in interface ServerPermissionManager
Parameters:
keys - Keys to identify the user
sessionId - User session identifier
permissions - XML value to describes the server permissions
Returns:
Throws:
java.lang.Exception

setServerPermissions

public EntityResult setServerPermissions(java.util.Hashtable keys,
                                         int sessionId,
                                         java.util.Hashtable permissions)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

getServerPermissions

protected java.lang.StringBuffer getServerPermissions(java.util.Hashtable userKeys)

joinServerPermissions

protected java.util.Hashtable joinServerPermissions(java.util.List permissions)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

joinClientPermissions

protected java.util.Hashtable joinClientPermissions(java.util.List permissions)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

getServerPermissions

public EntityResult getServerPermissions(java.util.Hashtable userKeys,
                                         int sessionId)
                                  throws java.lang.Exception
Description copied from interface: ServerPermissionManager
Get the user permissions

Specified by:
getServerPermissions in interface ServerPermissionManager
Parameters:
userKeys - Keys to identify the user
sessionId - User session identifier
Returns:
Throws:
java.lang.Exception

setUserProfileServerPermissions

public EntityResult setUserProfileServerPermissions(java.util.Hashtable profileKeys,
                                                    java.lang.StringBuffer permissions,
                                                    int sessionId)
                                             throws java.lang.Exception
Specified by:
setUserProfileServerPermissions in interface ServerPermissionManager
Throws:
java.lang.Exception

getUserProfileServerPermissions

public EntityResult getUserProfileServerPermissions(java.util.Hashtable profileKeys,
                                                    int sessionId)
                                             throws java.lang.Exception
Description copied from interface: ServerPermissionManager
Get the permission definition for a specified profile

Specified by:
getUserProfileServerPermissions in interface ServerPermissionManager
Parameters:
profileKeys - Keys to identify a profile
sessionId - User session identifier
Returns:
Throws:
java.lang.Exception

checkActionPermission

public boolean checkActionPermission(java.lang.String entity,
                                     java.lang.String action,
                                     int sessionId,
                                     long time)
                              throws java.lang.Exception
Description copied from interface: ServerPermissionManager
Checks if the specified user has permissions to execute an action in the specified entity

Specified by:
checkActionPermission in interface ServerPermissionManager
Parameters:
entity - Entity name
action - Action to check
sessionId - User session identifier
time -
Returns:
Throws:
java.lang.Exception

getPermissionGroupsInfo

public PermissionGroupInfo[] getPermissionGroupsInfo()
                                              throws java.lang.Exception
Specified by:
getPermissionGroupsInfo in interface ServerPermissionManager
Throws:
java.lang.Exception

getBussinesCalendarFile

public java.lang.String getBussinesCalendarFile()

getPermissionInfo

public PermissionInfo getPermissionInfo(java.lang.String entity,
                                        java.lang.String action,
                                        int sessionId)
                                 throws java.lang.Exception
Specified by:
getPermissionInfo in interface ServerPermissionManager
Throws:
java.lang.Exception

getParameters

public java.util.Hashtable getParameters()
                                  throws java.lang.Exception
Specified by:
getParameters in interface com.ontimize.ols.LControl
Throws:
java.lang.Exception

updateL

public java.util.Hashtable updateL(java.util.Hashtable h)
                            throws java.lang.Exception
Specified by:
updateL in interface com.ontimize.ols.LControl
Throws:
java.lang.Exception

getContextParams

protected java.util.Hashtable getContextParams(java.lang.String password)
Overrides:
getContextParams in class ReferenceLocator

retrieveInitialContext

public InitialContext retrieveInitialContext(int sessionId,
                                             java.util.Hashtable params)
                                      throws java.lang.Exception
Specified by:
retrieveInitialContext in interface UtilReferenceLocator
Overrides:
retrieveInitialContext in class ReferenceLocator
Throws:
java.lang.Exception

Ontimize