com.openexchange.admin.rmi
Interface OXResourceInterface

All Superinterfaces:
Remote
All Known Implementing Classes:
OXResource

public interface OXResourceInterface
extends Remote

This interface defines the Open-Xchange API Version 2 for creating and manipulating OX resources within an OX context.

Example:

 final OXResourceInterface iface = (OXResourceInterface)Naming.lookup("rmi:///oxhost/"+OXResourceInterface.RMI_NAME);
 
 final Context ctx = new Context(1);
 
 final Credentials auth = new Credentials();
 auth.setLogin("myuser");
 auth.setPassword("secret");
 
 final Resource res = new Resource();
 res.setName("resource");
 res.setDisplayName("my resource display name");
 
 Resource res_created = iface.create(ctx,res,auth);
 
 

Author:
Manuel Kraft, Carsten Hoeger, Dennis Sieben

Field Summary
static String RMI_NAME
          RMI name to be used in the naming lookup.
 
Method Summary
 void change(Context ctx, Resource res, Credentials auth)
          Change resource within the given context.
 Resource create(Context ctx, Resource res, Credentials auth)
          Creates a new resource within the given context.
 void delete(Context ctx, Resource res, Credentials auth)
          Delete resource from given context.
 Resource[] getData(Context ctx, Resource[] resources, Credentials auth)
          Get specified resources from server.
 Resource getData(Context ctx, Resource res, Credentials auth)
          Get Resource from given context.
 Resource[] list(Context ctx, String pattern, Credentials auth)
          List resources matching pattern in given context.
 Resource[] listAll(Context ctx, Credentials auth)
          List all resources in given context.
 

Field Detail

RMI_NAME

static final String RMI_NAME
RMI name to be used in the naming lookup.

See Also:
Constant Field Values
Method Detail

create

Resource create(Context ctx,
                Resource res,
                Credentials auth)
                throws RemoteException,
                       StorageException,
                       InvalidCredentialsException,
                       NoSuchContextException,
                       InvalidDataException,
                       DatabaseUpdateException
Creates a new resource within the given context.

Parameters:
ctx - Create Resource in this Context
res - Resource which should be created
auth - Credentials for authenticating against server.
Returns:
Resource containing the resource id.
Throws:
StorageException - When an error in the subsystems occurred.
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
DatabaseUpdateException

change

void change(Context ctx,
            Resource res,
            Credentials auth)
            throws RemoteException,
                   StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchResourceException
Change resource within the given context.

Parameters:
ctx - Change Resource in this Context.
res - Resource containing the data.
auth - Credentials for authenticating against server.
Throws:
StorageException - When an error in the subsystems occurred.
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
DatabaseUpdateException
NoSuchResourceException

delete

void delete(Context ctx,
            Resource res,
            Credentials auth)
            throws RemoteException,
                   StorageException,
                   InvalidCredentialsException,
                   NoSuchContextException,
                   InvalidDataException,
                   DatabaseUpdateException,
                   NoSuchResourceException
Delete resource from given context.

Parameters:
ctx - Context object.
res - Resource which should be deleted.
auth - Credentials for authenticating against server.
Throws:
StorageException - When an error in the subsystems occurred.
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
DatabaseUpdateException
NoSuchResourceException

getData

Resource getData(Context ctx,
                 Resource res,
                 Credentials auth)
                 throws RemoteException,
                        StorageException,
                        InvalidCredentialsException,
                        NoSuchContextException,
                        InvalidDataException,
                        DatabaseUpdateException,
                        NoSuchResourceException
Get Resource from given context.

Parameters:
ctx - Context object.
res - Resource containing the resource id.
auth - Credentials for authenticating against server.
Returns:
Resource object containing data.
Throws:
StorageException - When an error in the subsystems occurred.
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
DatabaseUpdateException
NoSuchResourceException

getData

Resource[] getData(Context ctx,
                   Resource[] resources,
                   Credentials auth)
                   throws RemoteException,
                          StorageException,
                          InvalidCredentialsException,
                          NoSuchContextException,
                          InvalidDataException,
                          NoSuchResourceException,
                          DatabaseUpdateException
Get specified resources from server. Can be used to get resource data including extensions. Resources will be identified by id or by name.

Parameters:
ctx -
resources -
auth -
Returns:
Resources including extension data if requested!
Throws:
RemoteException
StorageException
InvalidCredentialsException
NoSuchContextException
InvalidDataException
NoSuchResourceException
DatabaseUpdateException

list

Resource[] list(Context ctx,
                String pattern,
                Credentials auth)
                throws RemoteException,
                       StorageException,
                       InvalidCredentialsException,
                       NoSuchContextException,
                       InvalidDataException,
                       DatabaseUpdateException
List resources matching pattern in given context.

Parameters:
ctx - Context object.
pattern - Search pattern like * or mon* (e.g. for monitor)
auth - Credentials for authenticating against server.
Returns:
Resource[] containing result objects.
Throws:
StorageException - When an error in the subsystems occurred.
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
DatabaseUpdateException

listAll

Resource[] listAll(Context ctx,
                   Credentials auth)
                   throws RemoteException,
                          StorageException,
                          InvalidCredentialsException,
                          NoSuchContextException,
                          InvalidDataException,
                          DatabaseUpdateException
List all resources in given context.

Parameters:
ctx - Context object.
auth - Credentials for authenticating against server.
Returns:
Resource[] containing result objects.
Throws:
StorageException - When an error in the subsystems occurred.
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
DatabaseUpdateException