|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OXContextInterface
This class defines the Open-Xchange API Version 2 for creating and manipulating OX Contexts.
To create a new context, you must first register a database,server and filestore to the system!
For details about registering a filestore,server or databases have a look in the OXUtilInterface
.
Example:
final OXContextInterface iface = (OXContextInterface)Naming.lookup("rmi:///oxhost/"+OXContextInterface.RMI_NAME); final Context ctx = new Context(1337); User usr = new User(); usr.setDisplay_name("admin display name"); usr.setName("admin"); usr.setPassword("secret"); usr.setMailenabled(true); usr.setPrimaryEmail("admin@example.org"); usr.setEmail1("admin@example.org"); usr.setGiven_name("my"); usr.setSur_name("admin"); final Credentials auth = new Credentials(); auth.setLogin("admin"); auth.setPassword("secret"); iface.create(ctx,usr,access,auth);
Field Summary | |
---|---|
static String |
RMI_NAME
RMI name to be used in the naming lookup. |
Method Summary | |
---|---|
void |
change(Context ctx,
Credentials auth)
Change specified context! This method currently modifies following data: Login mappings - You can then login via usernam@loginmapping instead of username@contextID Context name in configdb - This is for better organization of contexts in your whole system. |
void |
changeModuleAccess(Context ctx,
String access_combination_name,
Credentials auth)
Change module access rights by "access combination name" for ALL users in the specified context. IF you want to change data of a context like quota etc. use Method change(Context ctx, Credentials auth) This method modifies ONLY the access rights of the context! |
void |
changeModuleAccess(Context ctx,
UserModuleAccess access,
Credentials auth)
Change module access rights for ALL users in the specified context. IF you want to change data of a context like quota etc. use Method change(final Context ctx, final Credentials auth) This method modifies ONLY the access rights of the context! |
boolean |
checkExists(Context ctx,
Credentials auth)
Deprecated. |
Context |
create(Context ctx,
User admin_user,
Credentials auth)
Create a new context. |
Context |
create(Context ctx,
User admin_user,
String access_combination_name,
Credentials auth)
Create a new context! Given access combination name will be used for admin module access rights! |
Context |
create(Context ctx,
User admin_user,
UserModuleAccess access,
Credentials auth)
Create a new context! Given access rights be used for admin! |
void |
delete(Context ctx,
Credentials auth)
Delete a context. Note: Deleting a context will delete all data which the context include (all users, groups, appointments, ... |
void |
disable(Context ctx,
Credentials auth)
Disable given context. |
void |
disableAll(Credentials auth)
Disable all contexts. |
void |
downgrade(Context ctx,
Credentials auth)
If context was changed, call this method to flush data which is no longer needed due to access permission changes! |
void |
enable(Context ctx,
Credentials auth)
Enable given context. |
void |
enableAll(Credentials auth)
Enable all contexts. |
boolean |
exists(Context ctx,
Credentials auth)
Determines whether a context already exists. |
String |
getAccessCombinationName(Context ctx,
Credentials auth)
Get current access combination name of the context based on the rights of the admin user! |
int |
getAdminId(Context ctx,
Credentials auth)
Determines the user ID of the admin user for a given context |
Context[] |
getData(Context[] ctx,
Credentials auth)
Get specified context details |
Context |
getData(Context ctx,
Credentials auth)
Get specified context details |
UserModuleAccess |
getModuleAccess(Context ctx,
Credentials auth)
Get current module access rights of the context based on the rights of the admin user! |
Context[] |
list(String search_pattern,
Credentials auth)
Search for contexts Returns all contexts matching the provided search_pattern. |
Context[] |
listAll(Credentials auth)
Convenience method for listing all contexts Use this for search a context or list all contexts. |
Context[] |
listByDatabase(Database db,
Credentials auth)
Search for context on specified db. |
Context[] |
listByFilestore(Filestore fs,
Credentials auth)
Search for context which store data on specified filestore |
int |
moveContextDatabase(Context ctx,
Database dst_database_id,
Credentials auth)
Move all data of a context contained in a database to another database |
int |
moveContextFilestore(Context ctx,
Filestore dst_filestore_id,
Credentials auth)
Move all data of a context contained on the filestore to another filestore |
Field Detail |
---|
static final String RMI_NAME
Method Detail |
---|
Context create(Context ctx, User admin_user, Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException, InvalidDataException, ContextExistsException
ctx
- Context objectadmin_user
- User data of administrative user account for this contextauth
- Credentials for authenticating against server.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
ContextExistsException
Context create(Context ctx, User admin_user, String access_combination_name, Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException, InvalidDataException, ContextExistsException
ctx
- Context objectadmin_user
- User data of administrative user account for this contextaccess_combination_name
- String Access combination name!auth
- Credentials for authenticating against server.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
ContextExistsException
Context create(Context ctx, User admin_user, UserModuleAccess access, Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException, InvalidDataException, ContextExistsException
ctx
- Context objectadmin_user
- User data of administrative user account for this contextaccess
- UserModuleAccess Access rights!auth
- Credentials for authenticating against server.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
ContextExistsException
void delete(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, DatabaseUpdateException, InvalidDataException
auth
- Credentials for authenticating against server.ctx
- Context object
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
NoSuchContextException
- If the context does not exist in the system.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
DatabaseUpdateException
InvalidDataException
void downgrade(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, DatabaseUpdateException, InvalidDataException
ctx
- Context objectauth
- Credentials for authenticating against server.
RemoteException
- General RMI Exception
InvalidCredentialsException
NoSuchContextException
StorageException
- When an error in the subsystems occurred.
DatabaseUpdateException
InvalidDataException
int moveContextFilestore(Context ctx, Filestore dst_filestore_id, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException, NoSuchFilestoreException, NoSuchReasonException, OXContextException
This method returns immediately and the data is going to be copied in the background. To query the progress and the result of the actual task, the AdminJobExecutor interface must be used.
ctx
- Context objectdst_filestore_id
- Id of the Filestore to move the context in.auth
- Credentials for authenticating against server.
InvalidCredentialsException
- Credentials for authenticating against server.
NoSuchContextException
- If the context does not exist in the system.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occured.
NoSuchFilestoreException
NoSuchReasonException
OXContextException
int moveContextDatabase(Context ctx, Database dst_database_id, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException, DatabaseUpdateException, OXContextException
ctx
- Context objectdst_database_id
- ID of a registered Database to move all data of this context in.auth
- Credentials for authenticating against server.
This method returns immediately and the data is going to be copied in the background. To query the progress and the result of the actual task, the AdminJobExecutor interface must be used.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
NoSuchContextException
- If the context does not exist in the system.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occured.
DatabaseUpdateException
OXContextException
void disable(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException, NoSuchReasonException, OXContextException
ctx
- Context object.auth
- Credentials for authenticating against server.
InvalidCredentialsException
- Credentials for authenticating against server.
NoSuchContextException
- If the context does not exist in the system.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
NoSuchReasonException
OXContextException
void enable(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException
auth
- Credentials for authenticating against server.ctx
- Context object.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
NoSuchContextException
- If the context does not exist in the system.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
InvalidDataException
Context[] list(String search_pattern, Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException, InvalidDataException
auth
- Credentials for authenticating against server.search_pattern
- Search pattern e.g "*mycontext*".
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.Context[] listAll(Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException, InvalidDataException
auth
- Credentials for authenticating against server.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.void disableAll(Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException, InvalidDataException, NoSuchReasonException
auth
- Credentials for authenticating against server.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
NoSuchReasonException
void enableAll(Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException
auth
- Credentials for authenticating against server.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.Context[] getData(Context[] ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException
ctx
- auth
-
RemoteException
InvalidCredentialsException
NoSuchContextException
StorageException
InvalidDataException
Context getData(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException
ctx
- With context ID set.auth
- Credentials for authenticating against server.
RemoteException
InvalidCredentialsException
NoSuchContextException
StorageException
InvalidDataException
void change(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException
ctx
- auth
-
RemoteException
InvalidCredentialsException
NoSuchContextException
StorageException
InvalidDataException
void changeModuleAccess(Context ctx, UserModuleAccess access, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException
ctx
- access
- auth
-
RemoteException
InvalidCredentialsException
NoSuchContextException
StorageException
InvalidDataException
void changeModuleAccess(Context ctx, String access_combination_name, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException
ctx
- access
- auth
-
RemoteException
InvalidCredentialsException
NoSuchContextException
StorageException
InvalidDataException
UserModuleAccess getModuleAccess(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException
ctx
- auth
-
RemoteException
InvalidCredentialsException
NoSuchContextException
StorageException
InvalidDataException
String getAccessCombinationName(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, NoSuchContextException, StorageException, InvalidDataException
ctx
- auth
-
RemoteException
InvalidCredentialsException
NoSuchContextException
StorageException
InvalidDataException
Context[] listByDatabase(Database db, Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException, InvalidDataException, NoSuchDatabaseException
db
- Database on which to search for contexts.auth
- Credentials for authenticating against server.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
NoSuchDatabaseException
Context[] listByFilestore(Filestore fs, Credentials auth) throws RemoteException, StorageException, InvalidCredentialsException, InvalidDataException, NoSuchFilestoreException
fs
- Filestoreauth
- Credentials for authenticating against server.
InvalidCredentialsException
- When the supplied credentials were not correct or invalid.
InvalidDataException
- If the data sent within the method contained invalid data.
RemoteException
- General RMI Exception
StorageException
- When an error in the subsystems occurred.
NoSuchFilestoreException
int getAdminId(Context ctx, Credentials auth) throws RemoteException, InvalidCredentialsException, StorageException, NoSuchContextException
ctx
- The context for which the userId of the admin should be determined.auth
- Credentials for authenticating against the server.
RemoteException
- General RMI Exception
InvalidCredentialsException
- Thrown when the login fails
StorageException
- Thrown when an error in a subsystem occurred.
NoSuchContextException
boolean exists(Context ctx, Credentials auth) throws RemoteException, InvalidDataException, StorageException, InvalidCredentialsException
ctx
- The context we're interested inauth
- Credentials for authenticating against the server.
RemoteException
InvalidDataException
StorageException
InvalidCredentialsException
boolean checkExists(Context ctx, Credentials auth) throws RemoteException, InvalidDataException, StorageException, InvalidCredentialsException
ctx
- The context we're interested inauth
- Credentials for authenticating against the server.
RemoteException
InvalidDataException
StorageException
InvalidCredentialsException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |