org.esupportail.portal.channels.CStockage.config
Class Space

java.lang.Object
  extended byorg.esupportail.portal.channels.CStockage.config.Space

public class Space
extends java.lang.Object

Id: Space.java,v 1.0 9 juil. 2004
Copyright (c) 2004 Esup Portail (www.esup-portail.org)
Classes: Space
Original Author: Yohan Colmant
This represents a file space on the server


Field Summary
private  ServerAccess access
          The attribute used to access the server
private  java.lang.String aclGroupPrefix
          The group prefix for the ACL
private  java.lang.String aclNamespace
          The ACL namespace
private  java.lang.String aclUportalGroup
          The uPortal group node for the ACL
private  java.lang.String aclUserPrefix
          The user prefix for the ACL
private  java.lang.String actionType
          The channel action type
static java.lang.String AUTH_ASKED
          ASKED authentication
static java.lang.String AUTH_CAS
          CAS authentication
static java.lang.String AUTH_TRUSTED
          TRUSTED authentication
private  java.lang.String authenticationMode
          The authentication mode.
private  java.util.ArrayList authorizations
          The authorization list for this space
private  boolean canWrite
          If the user can write into this space
private  AbstractChannelAction channelAction
          To manage the actions in funtion of the access class
private  java.lang.String channelActionClass
          The class name used to manage the actions
private  java.lang.String cifsDisablePlainTextPassword
          The cifs disable plain text password
private  java.lang.String cifsDomain
          The cifs domain
private  java.lang.String cifsResolveOrder
          The Cifs resolve order
private  java.util.Vector currentPath
          The currentPath used
private  java.lang.String enableSharing
          If this space can support the document sharing
private  java.lang.String idInDatabase
          The ID of this space in the database when we share it
private  java.lang.String initialLoginFromTheConfigurationFile
          The login if trusted authentication
private  java.lang.String initialPath
          The path in the initial configuration file
private  java.lang.String key
          The space key
private  java.lang.String label
          The label of this space
protected static Log log
          Logger object
private  java.lang.String login
          The login if trusted authentication
private  boolean loginIsFromConfigurationFile
          If the login is from the configuration file
private  boolean manageAcl
          If this space manage the acl for the sharing or for the injac mode
private  java.lang.String metadataNamespace
          The namespace used for the metadata
private  java.lang.String nfsGidNumber
          The NFS Gid Number
 java.lang.String nfsUidNumber
          The NFS Uid Number
private  java.lang.String owner
          Used for shared spaces, this attribute is the person who share the space
private  java.lang.String password
          The password if trusted authentication, or is asked authentication
private  java.lang.String pathRegexp
          The regexp used to apply on the path
private  java.lang.String pathRegexpSeparator
          The separator used when the regexp is in few parts
private  boolean personnalSpace
          If this space is a personnal one
private  java.lang.String serverAccessClass
          The class name used to manage the actions
private  java.lang.String serverType
          The server type
private  boolean sharedForTheUser
          Attribute used when we work with a shared space. the value is true if the space has been shared for one user, false if it is for a group
private  java.lang.String targetOfSharing
          The target for the sharing: the user key or the group key
private  java.lang.String url
          The server url
 
Constructor Summary
Space()
           
 
Method Summary
 void addPathElement(java.lang.String pathElement)
          Add a path element to the current directory
 boolean canRead(ServerAccess access)
          Check if we are authorized to read this space
 void checkAttribute(java.lang.String attributeName, org.jasig.portal.security.IPerson person)
          we look for a {...} form in the attribute.
 void checkPath(org.jasig.portal.security.IPerson person)
          We check if the is a {...} form in the path.
 java.lang.Object clone()
          Clone this object
 boolean equals(java.lang.Object o)
          Compare this to another object
 java.lang.String getAclGroupPrefix()
           
 java.lang.String getAclNamespace()
           
 java.lang.String getAclUportalGroup()
           
 java.lang.String getAclUserPrefix()
           
 java.lang.String getActionType()
           
 java.lang.String getAuthenticationMode()
           
 java.util.ArrayList getAuthorization()
          return the authorization list
 java.lang.String getChannelActionClass()
           
 AbstractChannelAction getChannelActionObject()
          Get the channel action object
 java.lang.String getCifsDisablePlainTextPassword()
           
 java.lang.String getCifsDomain()
           
 java.lang.String getCifsResolveOrder()
           
 java.lang.String getIdInDatabase()
           
 java.lang.String getInitialLoginFromTheConfigurationFile()
           
 java.lang.String getKey()
           
 java.lang.String getLabel()
           
 java.lang.String getLogin()
           
 java.lang.String getMetadataNamespace()
           
 java.lang.String getNfsGidNumber()
           
 java.lang.String getNfsUidNumber()
           
 java.lang.String getOwner()
           
 java.lang.String getPassword()
           
 java.lang.String getPath()
           
private  java.lang.String getPath(java.util.Vector currentPath)
          Return the path due to a current path vector
 java.lang.String getPathElementAt(int index)
          Return the current element path at the good index
 java.lang.String getPathRegexp()
           
 java.lang.String getPathRegexpSeparator()
           
 int getPathSize()
          Return the path size
 java.lang.String getServerAccessClass()
           
 ServerAccess getServerAccessObject()
          Return the object used to access the server
 java.lang.String getServerType()
           
 java.lang.String getTargetOfSharing()
           
 java.lang.String getUrl()
           
private  java.util.Vector initPath(java.lang.String path)
           
 boolean isAskedAuthentication()
          If the selected authentication is ASKED
 boolean isCasAuthentication()
          If the selected authentication is CAS
 boolean isLoginIsFromConfigurationFile()
           
 boolean isPersonnalSpace()
           
 boolean isSharedForTheUser()
           
 boolean isSharing()
           
 boolean isTrustedAuthentication()
          If the selected authentication is TRUSTED
 boolean managesAcl()
           
 void removePathElement(int index)
          Remove an element from the current path
 void setAclGroupPrefix(java.lang.String aclGroupPrefix)
           
 void setAclNamespace(java.lang.String aclNamespace)
           
 void setAclUportalGroup(java.lang.String aclUportalGroup)
           
 void setAclUserPrefix(java.lang.String aclUserPrefix)
           
 void setActionType(java.lang.String actionType)
           
 void setAuthenticationMode(java.lang.String authenticationMode)
           
 void setAuthorization(AuthorizationSpaceParameter authorization)
          add a new authorization to the list
 void setCanWrite(boolean canWrite)
           
 void setChannelActionClass(java.lang.String channelActionClass)
           
 boolean setChannelActionObject(org.jasig.portal.security.IPerson person, java.util.ArrayList spaces, BufferAction buffer, java.lang.String userPortalLogin, java.util.Vector userGroups)
          Set the object used to manage the actions of the channel
 void setCifsDisablePlainTextPassword(java.lang.String cifsDisablePlainTextPassword)
           
 void setCifsDomain(java.lang.String cifsDomain)
           
 void setCifsResolveOrder(java.lang.String cifsResolveOrder)
           
 void setEnableSharing(java.lang.String enableSharing)
           
 void setIdInDatabase(java.lang.String idInDatabase)
           
 void setKey(java.lang.String key)
           
 void setLabel(java.lang.String label)
           
 void setLogin(java.lang.String login)
           
 void setLoginFromTheConfigurationFile(java.lang.String loginFromTheConfigurationFile)
           
 void setManageAcl(java.lang.String manageAcl)
           
 void setMetadataNamespace(java.lang.String metadataNamespace)
           
 void setNfsGidNumber(java.lang.String nfsGidNumber)
           
 void setNfsUidNumber(java.lang.String nfsUidNumber)
           
 void setOwner(java.lang.String owner)
           
 void setPassword(java.lang.String password)
           
 void setPath(java.lang.String path)
           
 void setPathRegexp(java.lang.String pathRegexp)
           
 void setPathRegexpSeparator(java.lang.String pathRegexpSeparator)
           
 void setPersonnalSpace(boolean personnalSpace)
           
 void setServerAccessClass(java.lang.String serverAccessClass)
           
 boolean setServerAccessObject()
          Set the server access object for this space
 void setServerAccessObject(ServerAccess access)
          Set the server access object
 void setServerType(java.lang.String serverType)
           
 void setSharedForTheUser(boolean sharedForTheUser)
           
 void setTargetOfSharing(java.lang.String targetOfSharing)
           
 void setUrl(java.lang.String url)
           
private  boolean supportsAcl()
           
 java.lang.String toString()
          Return a String representation of this space
 boolean userCanWrite()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final Log log
Logger object


AUTH_CAS

public static final java.lang.String AUTH_CAS
CAS authentication

See Also:
Constant Field Values

AUTH_TRUSTED

public static final java.lang.String AUTH_TRUSTED
TRUSTED authentication

See Also:
Constant Field Values

AUTH_ASKED

public static final java.lang.String AUTH_ASKED
ASKED authentication

See Also:
Constant Field Values

key

private java.lang.String key
The space key


label

private java.lang.String label
The label of this space


url

private java.lang.String url
The server url


serverType

private java.lang.String serverType
The server type


actionType

private java.lang.String actionType
The channel action type


channelActionClass

private java.lang.String channelActionClass
The class name used to manage the actions


serverAccessClass

private java.lang.String serverAccessClass
The class name used to manage the actions


authenticationMode

private java.lang.String authenticationMode
The authentication mode. "cas" or "trusted"


login

private java.lang.String login
The login if trusted authentication


initialLoginFromTheConfigurationFile

private java.lang.String initialLoginFromTheConfigurationFile
The login if trusted authentication


loginIsFromConfigurationFile

private boolean loginIsFromConfigurationFile
If the login is from the configuration file


password

private java.lang.String password
The password if trusted authentication, or is asked authentication


enableSharing

private java.lang.String enableSharing
If this space can support the document sharing


initialPath

private java.lang.String initialPath
The path in the initial configuration file


pathRegexp

private java.lang.String pathRegexp
The regexp used to apply on the path


pathRegexpSeparator

private java.lang.String pathRegexpSeparator
The separator used when the regexp is in few parts


currentPath

private java.util.Vector currentPath
The currentPath used


access

private ServerAccess access
The attribute used to access the server


channelAction

private AbstractChannelAction channelAction
To manage the actions in funtion of the access class


metadataNamespace

private java.lang.String metadataNamespace
The namespace used for the metadata


manageAcl

private boolean manageAcl
If this space manage the acl for the sharing or for the injac mode


aclNamespace

private java.lang.String aclNamespace
The ACL namespace


aclUserPrefix

private java.lang.String aclUserPrefix
The user prefix for the ACL


aclGroupPrefix

private java.lang.String aclGroupPrefix
The group prefix for the ACL


aclUportalGroup

private java.lang.String aclUportalGroup
The uPortal group node for the ACL


authorizations

private java.util.ArrayList authorizations
The authorization list for this space


cifsDomain

private java.lang.String cifsDomain
The cifs domain


cifsResolveOrder

private java.lang.String cifsResolveOrder
The Cifs resolve order


cifsDisablePlainTextPassword

private java.lang.String cifsDisablePlainTextPassword
The cifs disable plain text password


nfsUidNumber

public java.lang.String nfsUidNumber
The NFS Uid Number


nfsGidNumber

private java.lang.String nfsGidNumber
The NFS Gid Number


personnalSpace

private boolean personnalSpace
If this space is a personnal one


canWrite

private boolean canWrite
If the user can write into this space


owner

private java.lang.String owner
Used for shared spaces, this attribute is the person who share the space


targetOfSharing

private java.lang.String targetOfSharing
The target for the sharing: the user key or the group key


sharedForTheUser

private boolean sharedForTheUser
Attribute used when we work with a shared space. the value is true if the space has been shared for one user, false if it is for a group


idInDatabase

private java.lang.String idInDatabase
The ID of this space in the database when we share it

Constructor Detail

Space

public Space()
Method Detail

managesAcl

public boolean managesAcl()
                   throws PropertiesException
Returns:
Returns the manageAcl.
Throws:
PropertiesException

setManageAcl

public void setManageAcl(java.lang.String manageAcl)
Parameters:
manageAcl - The manageAcl to set.

getTargetOfSharing

public java.lang.String getTargetOfSharing()
Returns:
Returns the targetOfSharing.

setTargetOfSharing

public void setTargetOfSharing(java.lang.String targetOfSharing)
Parameters:
targetOfSharing - The targetOfSharing to set.

getIdInDatabase

public java.lang.String getIdInDatabase()
Returns:
Returns the idInDatabase.

setIdInDatabase

public void setIdInDatabase(java.lang.String idInDatabase)
Parameters:
idInDatabase - The idInDatabase to set.

isSharedForTheUser

public boolean isSharedForTheUser()
Returns:
Returns the sharedForTheUser.

setSharedForTheUser

public void setSharedForTheUser(boolean sharedForTheUser)
Parameters:
sharedForTheUser - The sharedForTheUser to set.

setCanWrite

public void setCanWrite(boolean canWrite)
Parameters:
canWrite - The canWrite to set.

userCanWrite

public boolean userCanWrite()
Returns:
Returns the canWrite.

getOwner

public java.lang.String getOwner()
Returns:
Returns the owner.

setOwner

public void setOwner(java.lang.String owner)
Parameters:
owner - The owner to set.

isSharing

public boolean isSharing()
Returns:
Returns the sharing.

setEnableSharing

public void setEnableSharing(java.lang.String enableSharing)
Parameters:
enableSharing - The enableSharing to set.

getAuthorization

public java.util.ArrayList getAuthorization()
return the authorization list

Returns:
the authorization list

setAuthorization

public void setAuthorization(AuthorizationSpaceParameter authorization)
add a new authorization to the list

Parameters:
authorization - the authorization to add

getMetadataNamespace

public java.lang.String getMetadataNamespace()
Returns:
Returns the metadataNamespace.

setMetadataNamespace

public void setMetadataNamespace(java.lang.String metadataNamespace)
Parameters:
metadataNamespace - The metadataNamespace to set.

getCifsDisablePlainTextPassword

public java.lang.String getCifsDisablePlainTextPassword()
Returns:
Returns the cifsDisablePlainTextPassword.

setCifsDisablePlainTextPassword

public void setCifsDisablePlainTextPassword(java.lang.String cifsDisablePlainTextPassword)
Parameters:
cifsDisablePlainTextPassword - The cifsDisablePlainTextPassword to set.

getCifsDomain

public java.lang.String getCifsDomain()
Returns:
Returns the cifsDomain.

setCifsDomain

public void setCifsDomain(java.lang.String cifsDomain)
Parameters:
cifsDomain - The cifsDomain to set.

getCifsResolveOrder

public java.lang.String getCifsResolveOrder()
Returns:
Returns the cifsResolveOrder.

setCifsResolveOrder

public void setCifsResolveOrder(java.lang.String cifsResolveOrder)
Parameters:
cifsResolveOrder - The cifsResolveOrder to set.

getActionType

public java.lang.String getActionType()
Returns:
Returns the actionType.

setActionType

public void setActionType(java.lang.String actionType)
Parameters:
actionType - The actionType to set.

getServerType

public java.lang.String getServerType()
Returns:
Returns the serverType.

setServerType

public void setServerType(java.lang.String serverType)
Parameters:
serverType - The serverType to set.

getAclUportalGroup

public java.lang.String getAclUportalGroup()
Returns:
Returns the aclUportalGroup.

setAclUportalGroup

public void setAclUportalGroup(java.lang.String aclUportalGroup)
Parameters:
aclUportalGroup - The aclUportalGroup to set.

getAclGroupPrefix

public java.lang.String getAclGroupPrefix()
Returns:
Returns the aclGroupPrefix.

setAclGroupPrefix

public void setAclGroupPrefix(java.lang.String aclGroupPrefix)
Parameters:
aclGroupPrefix - The aclGroupPrefix to set.

getAclNamespace

public java.lang.String getAclNamespace()
Returns:
Returns the aclNamespace.

setAclNamespace

public void setAclNamespace(java.lang.String aclNamespace)
Parameters:
aclNamespace - The aclNamespace to set.

supportsAcl

private boolean supportsAcl()
Returns:
Returns the supportAcl.

getAclUserPrefix

public java.lang.String getAclUserPrefix()
Returns:
Returns the aclUserPrefix.

setAclUserPrefix

public void setAclUserPrefix(java.lang.String aclUserPrefix)
Parameters:
aclUserPrefix - The aclUserPrefix to set.

isPersonnalSpace

public boolean isPersonnalSpace()
Returns:
Returns the personnalSpace.

setPersonnalSpace

public void setPersonnalSpace(boolean personnalSpace)
Parameters:
personnalSpace - The personnalSpace to set.

isCasAuthentication

public boolean isCasAuthentication()
                            throws PropertiesException
If the selected authentication is CAS

Returns:
trus is cas is selected
Throws:
PropertiesException

isTrustedAuthentication

public boolean isTrustedAuthentication()
                                throws PropertiesException
If the selected authentication is TRUSTED

Returns:
true if trusted is selected
Throws:
PropertiesException

isAskedAuthentication

public boolean isAskedAuthentication()
                              throws PropertiesException
If the selected authentication is ASKED

Returns:
true if asked is selected
Throws:
PropertiesException

getLogin

public java.lang.String getLogin()
Returns:
Returns the login.

setLogin

public void setLogin(java.lang.String login)
Parameters:
login - The login to set.

setLoginFromTheConfigurationFile

public void setLoginFromTheConfigurationFile(java.lang.String loginFromTheConfigurationFile)
Parameters:
loginFromTheConfigurationFile - The login to set.

isLoginIsFromConfigurationFile

public boolean isLoginIsFromConfigurationFile()
Returns:
Returns the loginIsFromConfigurationFile.

getInitialLoginFromTheConfigurationFile

public java.lang.String getInitialLoginFromTheConfigurationFile()
Returns:
Returns the initialLoginFromTheConfigurationFile.

getPassword

public java.lang.String getPassword()
                             throws PropertiesException
Returns:
Returns the password.
Throws:
PropertiesException

setPassword

public void setPassword(java.lang.String password)
Parameters:
password - The trustedPassword to set.

getUrl

public java.lang.String getUrl()
                        throws PropertiesException
Returns:
Returns the url.
Throws:
PropertiesException

setUrl

public void setUrl(java.lang.String url)
Parameters:
url - The url to set.

setAuthenticationMode

public void setAuthenticationMode(java.lang.String authenticationMode)
Parameters:
authenticationMode - The authenticationMode to set.

getAuthenticationMode

public java.lang.String getAuthenticationMode()
Returns:
Returns the authenticationMode.

getServerAccessClass

public java.lang.String getServerAccessClass()
Returns:
Returns the serverAccessClass.

setServerAccessClass

public void setServerAccessClass(java.lang.String serverAccessClass)
Parameters:
serverAccessClass - The serverAccessClass to set.

getChannelActionClass

public java.lang.String getChannelActionClass()
Returns:
Returns the accessClass.

setChannelActionClass

public void setChannelActionClass(java.lang.String channelActionClass)
Parameters:
channelActionClass - The channelActionClass to set.

getKey

public java.lang.String getKey()
Returns:
Returns the key.

setKey

public void setKey(java.lang.String key)
Parameters:
key - The key to set.

getLabel

public java.lang.String getLabel()
Returns:
Returns the label.

setLabel

public void setLabel(java.lang.String label)
Parameters:
label - The label to set.

getPathRegexp

public java.lang.String getPathRegexp()
Returns:
Returns the pathRegexp.

setPathRegexp

public void setPathRegexp(java.lang.String pathRegexp)
Parameters:
pathRegexp - The pathRegexp to set.

getPathRegexpSeparator

public java.lang.String getPathRegexpSeparator()
Returns:
Returns the pathRegexpSeparator.

setPathRegexpSeparator

public void setPathRegexpSeparator(java.lang.String pathRegexpSeparator)
Parameters:
pathRegexpSeparator - The pathRegexpSeparator to set.

setPath

public void setPath(java.lang.String path)
Parameters:
path - The path to set.

initPath

private java.util.Vector initPath(java.lang.String path)
Parameters:
path - The path to set.

getPath

public java.lang.String getPath()
Returns:
Returns the path.

getPath

private java.lang.String getPath(java.util.Vector currentPath)
Return the path due to a current path vector

Parameters:
currentPath -
Returns:
the space current path

checkPath

public void checkPath(org.jasig.portal.security.IPerson person)
We check if the is a {...} form in the path. If yes, we replace by the real value

Parameters:
person - the connected person

checkAttribute

public void checkAttribute(java.lang.String attributeName,
                           org.jasig.portal.security.IPerson person)
we look for a {...} form in the attribute. If yes, we replace it with the real value

Parameters:
attributeName - to check
person - uPortal person object

addPathElement

public void addPathElement(java.lang.String pathElement)
Add a path element to the current directory

Parameters:
pathElement -

removePathElement

public void removePathElement(int index)
Remove an element from the current path

Parameters:
index -

getPathSize

public int getPathSize()
Return the path size

Returns:
the size

getPathElementAt

public java.lang.String getPathElementAt(int index)
Return the current element path at the good index

Parameters:
index - the selected index
Returns:
a string

canRead

public boolean canRead(ServerAccess access)
Check if we are authorized to read this space

Parameters:
access - the object used to access the server
Returns:
true if authorized else false

setServerAccessObject

public boolean setServerAccessObject()
                              throws PropertiesException,
                                     java.lang.ClassNotFoundException,
                                     java.lang.InstantiationException,
                                     java.lang.IllegalAccessException,
                                     java.net.MalformedURLException,
                                     ApplicationException
Set the server access object for this space

Returns:
true if we can access this space, else false
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.net.MalformedURLException
ApplicationException
PropertiesException

getServerAccessObject

public ServerAccess getServerAccessObject()
Return the object used to access the server

Returns:
the object used to access the server

setServerAccessObject

public void setServerAccessObject(ServerAccess access)
Set the server access object

Parameters:
access -

setChannelActionObject

public boolean setChannelActionObject(org.jasig.portal.security.IPerson person,
                                      java.util.ArrayList spaces,
                                      BufferAction buffer,
                                      java.lang.String userPortalLogin,
                                      java.util.Vector userGroups)
                               throws ChannelException
Set the object used to manage the actions of the channel

Parameters:
person - the uPortal person object
spaces - the spaces used
buffer - the buffer used to get for example the clipboard
userPortalLogin - The user login in the portal
userGroups - The groups of the user in the portal
Returns:
true if well done
Throws:
ChannelException

getChannelActionObject

public AbstractChannelAction getChannelActionObject()
Get the channel action object

Returns:
the channel action object

toString

public java.lang.String toString()
Return a String representation of this space


getNfsGidNumber

public java.lang.String getNfsGidNumber()
Returns:
Returns the nfsGidNumber.

setNfsGidNumber

public void setNfsGidNumber(java.lang.String nfsGidNumber)
Parameters:
nfsGidNumber - The nfsGidNumber to set.

getNfsUidNumber

public java.lang.String getNfsUidNumber()
Returns:
Returns the nfsUidNumber.

setNfsUidNumber

public void setNfsUidNumber(java.lang.String nfsUidNumber)
Parameters:
nfsUidNumber - The nfsUidNumber to set.

equals

public boolean equals(java.lang.Object o)
Compare this to another object

Parameters:
o - object to compare

clone

public java.lang.Object clone()
Clone this object

Returns:
a clone of this object