public class DatabaseLocation extends java.lang.Object implements Location, UserHomeable
Location.LocationType
SHARED_PATH_PREFIX
Constructor and Description |
---|
DatabaseLocation(DatabaseConnector dc) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkConnection()
Checks if this location is currently available.
|
ServerModel |
createNewModel(java.io.File model,
java.lang.String path,
java.lang.String id,
SingleUser user,
java.lang.String comment)
Create new model
|
void |
createUserHome(SingleUser user) |
java.lang.String |
getAtticPath(SingleUser user)
Get path to the attic directory
|
java.util.Map<java.lang.String,java.util.List<ServerModel>> |
getIndex(java.util.Set<java.lang.String> usedIDs,
boolean forceRefresh)
Get index of this location.
|
MetaDataHandler |
getMetaDataHandler()
Get meta data handler for this location
|
java.util.Map<java.lang.String,AccessType> |
getModelsForUser(SingleUser user)
Get all models belonging to a certain user withing this location
|
java.lang.String |
getName()
Get this location's name
|
Location.LocationType |
getType()
Get the type of this location
|
java.lang.String |
getUserHome(SingleUser user) |
java.util.Set<java.lang.String> |
listPaths()
Get all paths belonging to this location
|
java.util.Set<java.lang.String> |
listPaths(SingleUser user)
Get all paths belonging to a certain user within this location
|
boolean |
removeModel(java.lang.String id,
SingleUser user)
Remove a certain model
|
public DatabaseLocation(DatabaseConnector dc)
public boolean checkConnection()
Location
checkConnection
in interface Location
public boolean removeModel(java.lang.String id, SingleUser user)
Location
removeModel
in interface Location
id
- the model iduser
- the user that requested the deletionpublic java.lang.String getAtticPath(SingleUser user)
Location
getAtticPath
in interface Location
user
- the userpublic java.util.Map<java.lang.String,java.util.List<ServerModel>> getIndex(java.util.Set<java.lang.String> usedIDs, boolean forceRefresh)
Location
public MetaDataHandler getMetaDataHandler()
Location
getMetaDataHandler
in interface Location
public Location.LocationType getType()
Location
public java.lang.String getName()
Location
public java.util.Set<java.lang.String> listPaths()
Location
public java.util.Set<java.lang.String> listPaths(SingleUser user)
Location
public java.util.Map<java.lang.String,AccessType> getModelsForUser(SingleUser user)
Location
getModelsForUser
in interface Location
user
- the userpublic ServerModel createNewModel(java.io.File model, java.lang.String path, java.lang.String id, SingleUser user, java.lang.String comment)
Location
createNewModel
in interface Location
public java.lang.String getUserHome(SingleUser user)
getUserHome
in interface UserHomeable
public void createUserHome(SingleUser user)
createUserHome
in interface UserHomeable