com.crystaldecisions.sdk.occa.security
Interface IBatch

All Known Subinterfaces:
ISecCacheController, ISecCacheControllerAdmin, ISecRightsAdmin

public interface IBatch

This interface controls the security batch operations. It allows batching multiple security requests together and committing them to the CMS in one network call. Used by ISecCacheController and ISecCacheControllerAdmin to batch up security info retrieval queries, and by ISecRightsAdmin to batch up multiple security updates queries.

Call one of the batch() methods to signal the start of a batch operation. Then batch a collection of the security queries through one of the aforementioned interfaces. Call commit() to commit the queries to the server or rollback() to abort the operaton and clear the queued requests. Note that if commit() call fails before completion, caller needs to call rollback() explicitly in order to reset the batch state.


Method Summary
 int batch()
          Begin a batch operation.
 int batch(boolean useCache)
          Begin a batch operation specifying whether cache should be checked first before the requests go to the server.
 int batch(CacheModes cacheMode)
          Begin a batch operation specifying whether cache should be checked first before the requests go to the server.
 int commit()
          Commit the batch operation.
 int rollback()
          Rollback a batch operation.
 

Method Detail

batch

int batch()
          throws SDKException
Begin a batch operation. If the operation is already in batched state, this call will raise a com.crystaldecisions.sdk.occa.security.internal.SecurityException.BatchState exception

Returns:
A value defined in ISecurityResult indicating the status of the batch operation
Throws:
SDKException

batch

int batch(boolean useCache)
          throws SDKException
Begin a batch operation specifying whether cache should be checked first before the requests go to the server. If the operation is already in batched state, this call will raise a com.crystaldecisions.sdk.occa.security.internal.SecurityException.BatchState exception

Parameters:
useCache - true if security cache will be examined before requests go to the server. In other words, if the answer to certain requests has already been cached and the cache has not expired, these requests will not go to the server. And false if the cache is ignored and all requests go to the server for process. Note that if a request is an admin security request from ISecCacheControllerAdmin, the cache will not be checked even if the useCache is passed in as true. Use IBatch.batch(CacheModes cacheMode) to be more specific
Returns:
A value defined in ISecurityResult indicating the status of the batch operation
Throws:
SDKException

batch

int batch(CacheModes cacheMode)
          throws SDKException
Begin a batch operation specifying whether cache should be checked first before the requests go to the server. If the operation is already in batched state, this call will raise a com.crystaldecisions.sdk.occa.security.internal.SecurityException.BatchState exception

Parameters:
cacheMode - A value from CacheModes.
Returns:
A value defined in ISecurityResult indicating the status of the batch operation
Throws:
SDKException

commit

int commit()
           throws SDKException
Commit the batch operation. The operation has to be in batch state to be committed, otherwise, a com.crystaldecisions.sdk.occa.security.internal.SecurityException.BatchState exception will be raised

Returns:
A value defined in ISecurityResult indicating the status of the batch operation
Throws:
SDKException

rollback

int rollback()
             throws SDKException
Rollback a batch operation. All pending reqeusts will be cleared from the queue and the batch state reset. If the batch state is inactive yet there are still pending requests in the queue, calling rollback() will raise a com.crystaldecisions.sdk.occa.security.internal.SecurityException.BatchState exception

Returns:
A value defined in ISecurityResult indicating the status of the batch operation
Throws:
SDKException