|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.OwnedItem<D> net.sf.basedb.core.SharedItem<D> net.sf.basedb.core.CommonItem<FileServerData> net.sf.basedb.core.FileServer
public class FileServer
This class represents a file server that is used to store
external files. A File
should be associated with a file
server if authentication is required to access the file.
Field Summary | |
---|---|
static int |
MAX_CERTIFICATE_LENGTH
The maximum length of the server certificate that can be stored in the database. |
static int |
MAX_PASSWORD_LENGTH
The maximum length of the password that can be stored in the database. |
static int |
MAX_USERNAME_LENGTH
The maximum length of the username that can be stored in the database. |
static Item |
TYPE
The type of item represented by this class. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
FileServer(FileServerData data)
|
Method Summary | |
---|---|
static FileServer |
getById(DbControl dc,
int id)
Get a FileServer item when you know the ID. |
byte[] |
getClientCertificate()
Get the client certificate that BASE should use to authenticate with the server when connecting with https. |
String |
getClientCertificatePassword()
Get the password that is needed to unlock the client certificate. |
X509Certificate |
getClientX509Certificate()
Get the X.509 certificate for the client. |
ItemQuery<File> |
getFiles()
Get a query returning all files that has been registered with this server. |
static FileServer |
getNew(DbControl dc)
Create a new FileServer item. |
String |
getPassword()
Get the password that is used when authenticating with the file server. |
static ItemQuery<FileServer> |
getQuery()
Get a new query object for this class. |
byte[] |
getServerCertificate()
Get the public server certificate that indicates that we should only trust the server if it can present a certificate that matches this. |
X509Certificate |
getServerX509Certificate()
Get the X.509 certificate for the server. |
org.apache.http.conn.ssl.SSLSocketFactory |
getSSLSocketFactory()
Get a socket factory that can be used to create SSL connections to the given server. |
Item |
getType()
Get the type of item represented by the object. |
String |
getUsername()
Get the username that is required to authenticate with the file server. |
Set<ItemProxy> |
getUsingItems()
Get all files registered with this server. |
boolean |
hasPassword()
Is a password set or not? |
boolean |
isUsed()
Checks if there are files registered with this server. |
void |
setClientCertificate(byte[] certificate)
Set the client certificate that BASE should use to authenticate with the server when connecting with https. |
void |
setClientCertificatePassword(String password)
Set the password that is needed to unlock the client certificate. |
void |
setPassword(String password)
Set the password to use when authenticating with the file server. |
void |
setServerCertificate(byte[] certificate)
Set the public server certificate so that BASE can trust https connections to the server. |
void |
setUsername(String username)
Set the username that is required to authenticate with the file server. |
Methods inherited from class net.sf.basedb.core.CommonItem |
---|
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable |
Methods inherited from class net.sf.basedb.core.SharedItem |
---|
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey, toTransferable |
Methods inherited from class net.sf.basedb.core.OwnedItem |
---|
getOwner, isOwner, setOwner, takeOwnership, toTransferable |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Methods inherited from interface net.sf.basedb.core.Ownable |
---|
getOwner, isOwner, setOwner, takeOwnership |
Field Detail |
---|
public static final Item TYPE
Item.FILESERVER
,
getType()
public static final int MAX_USERNAME_LENGTH
setUsername(String)
,
Constant Field Valuespublic static final int MAX_PASSWORD_LENGTH
setPassword(String)
,
Constant Field Valuespublic static final int MAX_CERTIFICATE_LENGTH
setServerCertificate(byte[])
,
setClientCertificate(byte[])
,
Constant Field ValuesConstructor Detail |
---|
FileServer(FileServerData data)
Method Detail |
---|
public static FileServer getNew(DbControl dc) throws BaseException
FileServer
item.
dc
- The DbControl
which will be used for
permission checking and database access
FileServer
item
BaseException
- If there is an errorpublic static FileServer getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
FileServer
item when you know the ID.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to load
FileServer
item
ItemNotFoundException
- If an item with the specified
ID is not found
PermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the item
BaseException
- If there is another errorpublic static ItemQuery<FileServer> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
public boolean isUsed() throws BaseException
isUsed
in class BasicItem<FileServerData>
BaseException
- If there is another errorBasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
getUsingItems
in class BasicItem<FileServerData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public String getUsername()
public void setUsername(String username) throws PermissionDeniedException, InvalidDataException
username
- The new username, null if not authentication is required
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the username is longer than MAX_USERNAME_LENGTH
public String getPassword()
hasPassword()
public boolean hasPassword()
public void setPassword(String password) throws PermissionDeniedException, InvalidDataException
password
- The new password (can be null)
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the password is longer than MAX_PASSWORD_LENGTH
public byte[] getServerCertificate()
getServerX509Certificate()
public void setServerCertificate(byte[] certificate)
getServerCertificate()
for more information. The certificate
must be a X.509 certificate in either binary or base64-encoded DER format.
certificate
- The server certificate or null if no certificate is requiredpublic X509Certificate getServerX509Certificate()
public byte[] getClientCertificate()
getClientX509Certificate()
to get
the public information from the certificate.
getClientX509Certificate()
public void setClientCertificate(byte[] certificate)
certificate
- The client certificate or null if no certificate is requiredpublic X509Certificate getClientX509Certificate()
public String getClientCertificatePassword()
public void setClientCertificatePassword(String password) throws PermissionDeniedException, InvalidDataException
password
- The new password (can be null)
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the password is longer than MAX_PASSWORD_LENGTH
public org.apache.http.conn.ssl.SSLSocketFactory getSSLSocketFactory()
public ItemQuery<File> getFiles()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |