org.openrdf.sesame.config
Class SystemConfig

java.lang.Object
  extended byorg.openrdf.sesame.config.SystemConfig

public class SystemConfig
extends Object


Constructor Summary
SystemConfig()
           
 
Method Summary
 void addListener(SystemConfigListener listener)
          Adds the supplied SystemConfigListener
 void addRepository(String id, String title)
          Adds a new repository with the supplied id and title
 void addRepositoryConfig(RepositoryConfig ri)
           
 void addSail(String id, String sailClass, int idx)
          Adds the sail with the supplied class to the sail stack of the repository with the given id at the supplied index
 void addUser(int id, String login, String fullName, String password)
          Adds a new user with the supplied id, login, full name and password
 void addUserInfo(UserInfo ui)
           
 RepositoryConfig cloneRepository(String origID, String cloneID)
          Clones the repository with the specified id, changes its id to the specified new id, and adds this new repository.
 String getAdminPassword()
           
 String getLogDir()
           
 int getLogLevel()
           
 Map getParameters(String id, String sailClass)
          Gets a Map of parameters from the sail with the supplied class of the repository with the given id
 RepositoryConfig getRepositoryConfig(String id)
           
 List getRepositoryConfigList()
           
 String getRMIFactoryClass()
           
 int getRMIPort()
           
 List getSails(String id)
          Gets a List of sails from the repository with the supplied id
 String getSystemProp(String key)
           
 Properties getSystemProps()
           
 String getTmpDir()
           
 int getUnusedUserId()
          Gets an unused user id.
 UserInfo getUserInfo(int userID)
           
 UserInfo getUserInfo(String login)
           
 List getUserInfoList()
          Gets a List of users
 Set getUsernames()
           
 List getUsersForRepository(RepositoryConfig repConfig)
          Gets all users that have read and/or write access to the specified repository.
 boolean hasAnUser()
          Checks if an user exists
 boolean hasARepository()
          Checks if a repository exists
 boolean hasASail(String id)
          Checks if the repository with the supplied id has a sail
 boolean hasParameter(String id, String sailClass, String key)
          Checks if the sail with the supplied class of the repository with the given id has a parameter with the supplied key
 boolean hasReadAccess(String id, String login)
          Checks if the user with the supplied login has read access to the specified repository.
 boolean hasReadAndWriteAccess(String id, String login)
          Checks if the user with the supplied login has both read and write access to the specified repository.
 boolean hasReadOrWriteAccess(String id, String login)
          Checks if the user with the supplied login has read or write access to the specified repository.
 boolean hasRepository(String id)
          Checks if a repository with the supplied id exists
 boolean hasSail(String id, String sailClass)
          Checks if the repository with the supplied id has a sail with the supplied class
 boolean hasUser(String login)
          Checks if an user with the supplied login exists
 boolean hasWriteAccess(String id, String login)
          Checks if the user with the supplied login has write access to the specified repository.
 boolean isRMIEnabled()
           
 boolean isWorldReadable(String id)
          Checks if the repository with the supplied id is world readable
 boolean isWorldWriteable(String id)
          Checks if the repository with the supplied id is world writeable
 void removeListener(SystemConfigListener listener)
          Removes the supplied SystemConfigListener
 void removeParameter(String id, String sailClass, String key)
          Removes the parameter with the supplied key from the sail with the given class of the repository with the supplied id
 void removeRepository(String id)
          Removes the repository with the supplied id
 void removeSail(String id, String sailClass)
          Removes the sail with the supplied class from the sail stack of the repository with the supplied id
 void removeUser(String login)
          Removes the user with the supplied login
 void sailDown(String id, String sailClass)
          Moves the sail with the supplied class one level down in the sail stack of the repository with the given id
 void sailUp(String id, String sailClass)
          Moves the sail with the supplied class one level up in the sail stack of the repository with the given id
 void setAdminPassword(String password)
           
 void setLogDir(String logDir)
           
 void setLogLevel(int logLevel)
           
 void setParameter(String id, String sailClass, String key, String value)
          Adds the parameter with the supplied key-value pair to the sail with the given class of the repository with the supplied id
 void setParameterKey(String id, String sailClass, String oldKey, String newKey)
          Sets the key of the parameter with the supplied old key of the sail with the given class of the repository with the supplied id to the given new key
 void setParameterValue(String id, String sailClass, String key, String value)
          Sets the value of the parameter with the supplied key of the sail with the given class of the repository with the supplied id to the given value
 void setReadAccess(String id, String login, boolean readAccess)
          Sets the read access of the user with supplied login to the repository with the given id to the supplied read access
 void setRepositoryId(String oldId, String newId)
          Sets the id of the repository with the supplied old id to the given new id
 void setRepositoryTitle(String id, String title)
          Sets the title of the repository with the supplied id to the given title
 void setRMIEnabled(boolean rmiEnabled)
           
 void setRMIFactory(String rmiFactoryClass, int port)
           
 void setSail(String id, String oldClass, String newClass)
          Sets the sail with the supplied old class of the repository with the given id to the supplied new class
 void setSystemConfig(SystemConfig other)
          Copies the data from other to this SystemConfig.
 void setSystemProp(String key, String value)
           
 void setTmpDir(String tmpDir)
           
 void setUserFullName(String login, String fullName)
          Sets the full name of the user with the supplied login to the given full name
 void setUserId(String login, int id)
          Sets the id of the user with the supplied login to the given id
 void setUserLogin(String oldLogin, String newLogin)
          Sets the login of the user with the supplied old login to the given new login
 void setUserPassword(String login, String password)
          Sets the password of the user with the supplied login to the given password
 void setWorldReadable(String id, boolean worldReadable)
          Sets if the repository with the supplied id is world readable
 void setWorldWriteable(String id, boolean worldWriteable)
          Sets if the repository with the supplied id is world writeable
 void setWriteAccess(String id, String login, boolean writeAccess)
          Sets the write access of the user with supplied login to the repository with the given id to the supplied write access
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemConfig

public SystemConfig()
Method Detail

setAdminPassword

public void setAdminPassword(String password)

getAdminPassword

public String getAdminPassword()

setLogDir

public void setLogDir(String logDir)

getLogDir

public String getLogDir()

setLogLevel

public void setLogLevel(int logLevel)

getLogLevel

public int getLogLevel()

setTmpDir

public void setTmpDir(String tmpDir)

getTmpDir

public String getTmpDir()

setSystemProp

public void setSystemProp(String key,
                          String value)

getSystemProp

public String getSystemProp(String key)

getSystemProps

public Properties getSystemProps()

setRMIEnabled

public void setRMIEnabled(boolean rmiEnabled)

isRMIEnabled

public boolean isRMIEnabled()

setRMIFactory

public void setRMIFactory(String rmiFactoryClass,
                          int port)

getRMIFactoryClass

public String getRMIFactoryClass()

getRMIPort

public int getRMIPort()

addUserInfo

public void addUserInfo(UserInfo ui)

removeUser

public void removeUser(String login)
Removes the user with the supplied login

Parameters:
login - User login

getUserInfo

public UserInfo getUserInfo(String login)

getUserInfo

public UserInfo getUserInfo(int userID)

getUsernames

public Set getUsernames()

getUserInfoList

public List getUserInfoList()
Gets a List of users

Returns:
a List of UserInfo objects.

getUsersForRepository

public List getUsersForRepository(RepositoryConfig repConfig)
Gets all users that have read and/or write access to the specified repository.


getUnusedUserId

public int getUnusedUserId()
Gets an unused user id.

Returns:
An unused user id.

setUserId

public void setUserId(String login,
                      int id)
Sets the id of the user with the supplied login to the given id

Parameters:
login - User login
id - User id

setUserLogin

public void setUserLogin(String oldLogin,
                         String newLogin)
Sets the login of the user with the supplied old login to the given new login

Parameters:
oldLogin - Old user login
newLogin - New user login

setUserFullName

public void setUserFullName(String login,
                            String fullName)
Sets the full name of the user with the supplied login to the given full name

Parameters:
login - User login
fullName - User full name

setUserPassword

public void setUserPassword(String login,
                            String password)
Sets the password of the user with the supplied login to the given password

Parameters:
login - User login
password - User password

addRepositoryConfig

public void addRepositoryConfig(RepositoryConfig ri)

getRepositoryConfig

public RepositoryConfig getRepositoryConfig(String id)

getRepositoryConfigList

public List getRepositoryConfigList()

getSails

public List getSails(String id)
Gets a List of sails from the repository with the supplied id

Parameters:
id - Repository id
Returns:
an unmodifiable List of SailConfig objects.
See Also:
SailConfig

getParameters

public Map getParameters(String id,
                         String sailClass)
Gets a Map of parameters from the sail with the supplied class of the repository with the given id

Parameters:
id - Repository id
sailClass - Sail class return Map of parameters

setRepositoryId

public void setRepositoryId(String oldId,
                            String newId)
Sets the id of the repository with the supplied old id to the given new id

Parameters:
oldId - Old repository id
newId - New repository id

setRepositoryTitle

public void setRepositoryTitle(String id,
                               String title)
Sets the title of the repository with the supplied id to the given title

Parameters:
id - Repository id
title - Repository title

isWorldReadable

public boolean isWorldReadable(String id)
Checks if the repository with the supplied id is world readable

Parameters:
id - Repository id
Returns:
Boolean indicating if the repository is world readable

setWorldReadable

public void setWorldReadable(String id,
                             boolean worldReadable)
Sets if the repository with the supplied id is world readable

Parameters:
id - Repository id
worldReadable - Boolean indicating if the repository is world readable

isWorldWriteable

public boolean isWorldWriteable(String id)
Checks if the repository with the supplied id is world writeable

Parameters:
id - The repository id
Returns:
Boolean indicating if the repository is world writeable

setWorldWriteable

public void setWorldWriteable(String id,
                              boolean worldWriteable)
Sets if the repository with the supplied id is world writeable

Parameters:
id - The repository id
worldWriteable - Boolean indicating if the repository is world writeable

setSail

public void setSail(String id,
                    String oldClass,
                    String newClass)
Sets the sail with the supplied old class of the repository with the given id to the supplied new class

Parameters:
id - Repository id
oldClass - Old sail class
newClass - New sail class

setParameterKey

public void setParameterKey(String id,
                            String sailClass,
                            String oldKey,
                            String newKey)
Sets the key of the parameter with the supplied old key of the sail with the given class of the repository with the supplied id to the given new key

Parameters:
id - Repository id
sailClass - Sail class
oldKey - Old parameter key
newKey - New parameter key

setParameterValue

public void setParameterValue(String id,
                              String sailClass,
                              String key,
                              String value)
Sets the value of the parameter with the supplied key of the sail with the given class of the repository with the supplied id to the given value

Parameters:
id - Repository id
sailClass - Sail class
key - Parameter key
value - Parameter value

hasAnUser

public boolean hasAnUser()
Checks if an user exists

Returns:
Boolean indicating if an user exists

hasUser

public boolean hasUser(String login)
Checks if an user with the supplied login exists

Parameters:
login - User login
Returns:
Boolean indicating if the user exists

hasARepository

public boolean hasARepository()
Checks if a repository exists

Returns:
Boolean indicating if a repository exists

hasRepository

public boolean hasRepository(String id)
Checks if a repository with the supplied id exists

Parameters:
id - The repository id
Returns:
Boolean indicating if the repository exists

hasASail

public boolean hasASail(String id)
Checks if the repository with the supplied id has a sail

Parameters:
id - Repository id
Returns:
Boolean indicating if the repository has a sail

hasSail

public boolean hasSail(String id,
                       String sailClass)
Checks if the repository with the supplied id has a sail with the supplied class

Parameters:
id - Repository id
sailClass - Sail class
Returns:
Boolean indicating if the repository has the sail

hasParameter

public boolean hasParameter(String id,
                            String sailClass,
                            String key)
Checks if the sail with the supplied class of the repository with the given id has a parameter with the supplied key

Parameters:
id - Repository id
sailClass - Sail class
key - Parameter key
Returns:
Boolean indicating if the sail of the repository has the parameter

addUser

public void addUser(int id,
                    String login,
                    String fullName,
                    String password)
Adds a new user with the supplied id, login, full name and password

Parameters:
id - User id
login - User login
fullName - User full name
password - User password

addRepository

public void addRepository(String id,
                          String title)
Adds a new repository with the supplied id and title

Parameters:
id - Repository id
title - Repository title

cloneRepository

public RepositoryConfig cloneRepository(String origID,
                                        String cloneID)
Clones the repository with the specified id, changes its id to the specified new id, and adds this new repository.

Parameters:
origID - The repository to clone.
cloneID - The ID of the cloned repository.

addSail

public void addSail(String id,
                    String sailClass,
                    int idx)
Adds the sail with the supplied class to the sail stack of the repository with the given id at the supplied index

Parameters:
id - Repository id
sailClass - Sail class
idx - Sail index

setParameter

public void setParameter(String id,
                         String sailClass,
                         String key,
                         String value)
Adds the parameter with the supplied key-value pair to the sail with the given class of the repository with the supplied id

Parameters:
id - Repository id
sailClass - Sail class
key - Parameter key
value - Parameter value

removeRepository

public void removeRepository(String id)
Removes the repository with the supplied id

Parameters:
id - Repository id

removeSail

public void removeSail(String id,
                       String sailClass)
Removes the sail with the supplied class from the sail stack of the repository with the supplied id

Parameters:
id - Repository id
sailClass - Sail class

removeParameter

public void removeParameter(String id,
                            String sailClass,
                            String key)
Removes the parameter with the supplied key from the sail with the given class of the repository with the supplied id

Parameters:
id - Repository id
sailClass - Sail class
key - Parameter key

sailUp

public void sailUp(String id,
                   String sailClass)
Moves the sail with the supplied class one level up in the sail stack of the repository with the given id

Parameters:
id - Repository id
sailClass - Sail class

sailDown

public void sailDown(String id,
                     String sailClass)
Moves the sail with the supplied class one level down in the sail stack of the repository with the given id

Parameters:
id - Repository id
sailClass - Sail class

hasReadAccess

public boolean hasReadAccess(String id,
                             String login)
Checks if the user with the supplied login has read access to the specified repository.

Parameters:
id - Repository id
login - User login
Returns:
Boolean indicating if the user has read access to the repository

setReadAccess

public void setReadAccess(String id,
                          String login,
                          boolean readAccess)
Sets the read access of the user with supplied login to the repository with the given id to the supplied read access

Parameters:
id - Repository id
login - User login
readAccess - Boolean indicating if the user has read access to the repository

hasWriteAccess

public boolean hasWriteAccess(String id,
                              String login)
Checks if the user with the supplied login has write access to the specified repository.

Parameters:
id - Repository id
login - User login
Returns:
Boolean indicating if the user has write access to the repository

setWriteAccess

public void setWriteAccess(String id,
                           String login,
                           boolean writeAccess)
Sets the write access of the user with supplied login to the repository with the given id to the supplied write access

Parameters:
id - Repository id
login - User login
writeAccess - Boolean indicating if the user has write access to the repository

hasReadOrWriteAccess

public boolean hasReadOrWriteAccess(String id,
                                    String login)
Checks if the user with the supplied login has read or write access to the specified repository.

Parameters:
id - Repository id
login - User login
Returns:
Boolean indicating if the user has access to the repository

hasReadAndWriteAccess

public boolean hasReadAndWriteAccess(String id,
                                     String login)
Checks if the user with the supplied login has both read and write access to the specified repository.

Parameters:
id - Repository id
login - User login
Returns:
Boolean indicating if the user has access to the repository

setSystemConfig

public void setSystemConfig(SystemConfig other)
Copies the data from other to this SystemConfig.

Parameters:
other - The SystemConfig to copy.

addListener

public void addListener(SystemConfigListener listener)
Adds the supplied SystemConfigListener

Parameters:
listener - SystemConfigListener

removeListener

public void removeListener(SystemConfigListener listener)
Removes the supplied SystemConfigListener

Parameters:
listener - SystemConfigListener


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.