com.gigaspaces.client
Interface IProxyAdmin

All Known Subinterfaces:
IJSpace

public interface IProxyAdmin

This interface contains all the administrative methods that the proxy provides to control the proxy.


 Usage:
        IPojoSpace space = (IPojoSpace)SpaceFinder.find(spaceUrl);
        IProxyAdmin proxyAdmin = space.getProxyAdmin();
 
 The code examples on each method assumes the above usage.
 

Since:
6.1
See Also:
IPojoSpace.getProxyAdmin(), IRemoteJSpaceAdmin

Method Summary
 SpaceURL getFinderURL()
          Returns the SpaceURL object which was used as the argument for SpaceFinder.find(SpaceURL) while looking for the space.
 int getReadModifiers()
          Gets the proxy ReadModifiers.
 int getUpdateModifiers()
          Gets the proxyUpdateModifiers.
 boolean isFifo()
          Returns true if this proxy FIFO enabled, otherwise false.
 boolean isNOWriteLeaseMode()
          Checks the write mode.
 boolean isOptimisticLockingEnabled()
          Returns status of Optimistic Lock protocol.
 boolean isSecured()
          Returns an indication : is this space secured.
 void setDefaultTransaction(Transaction transaction)
          Sets default transaction to use in case that null parameter is used as transaction parameter with JavaSpace methods.
 void setFifo(boolean enabled)
          Sets FIFO mode for proxy.
 void setNOWriteLeaseMode(boolean noWriteLeaseMode)
          If set to true, Lease object will not return from write/writeMultiple operations.
 void setOptimisticLocking(boolean enabled)
          Enable/Disable Optimistic Lock protocol.
 int setReadModifiers(int readModifiers)
          Sets the read mode modifiers for proxy level.
 void setSecurityContext(SecurityContext context)
          This function is called by the client (usually at the beginning of the session) in order to set a security context for the following operations.
 int setUpdateModifiers(int newModifiers)
          Sets the update mode modifiers for proxy level.
 

Method Detail

setSecurityContext

void setSecurityContext(SecurityContext context)
                        throws SpaceSecurityException,
                               RemoteException
This function is called by the client (usually at the beginning of the session) in order to set a security context for the following operations.

 SecurityContext context = new SecurityContext("anonymous", "anonymous");
 space.setSecurityContext(context);
 

Parameters:
context - the SecurityContext to be active (or null to disable).
Throws:
SpaceSecurityException - Thrown by the Space or Filter to indicate a security violation.
RemoteException - if a communication error occurs

isSecured

boolean isSecured()
Returns an indication : is this space secured. If for this space defined Security Filter, the space will be secured.

Returns:
boolean true if this space secured, otherwise false.
See Also:
DefaultSecurityFilter

setOptimisticLocking

void setOptimisticLocking(boolean enabled)
Enable/Disable Optimistic Lock protocol.

Parameters:
enabled - true enable Optimistic Lock protocol, false disable.
See Also:
SpaceVersion, IMetaDataEntry

isOptimisticLockingEnabled

boolean isOptimisticLockingEnabled()
Returns status of Optimistic Lock protocol.

Returns:
true Optimistic Lock enabled, otherwise false.
See Also:
SpaceVersion, IMetaDataEntry

setFifo

void setFifo(boolean enabled)
Sets FIFO mode for proxy. Every operation that come through the proxy will be FIFO enabled. The other way to set FIFO enabled using com.j_spaces.core.client.SpaceFinder: SpaceFinder.find("jini://localhost/myContainer/mySpace?fifo=true") If this mode enabled, you don't need to use com.j_spaces.core.client.MetaDataEntry.setFifo(boolean) for every entry/template. All entries and templates will be FIFO enabled.

Parameters:
enabled - if true this proxy FIFO enabled, otherwise false.
See Also:
SpaceClass.fifo(), IMetaDataEntry

isFifo

boolean isFifo()
Returns true if this proxy FIFO enabled, otherwise false.

Returns:
Returns true if this proxy FIFO enabled, otherwise false.
See Also:
SpaceClass.fifo(), IMetaDataEntry

setNOWriteLeaseMode

void setNOWriteLeaseMode(boolean noWriteLeaseMode)
If set to true, Lease object will not return from write/writeMultiple operations.
The other way to set noWriteLease mode enabled using SpaceFinder:
SpaceFinder.find("jini://localhost/myContainer/mySpace?noWriteLease")

Parameters:
noWriteLeaseMode - write mode.
See Also:
SpaceURL

isNOWriteLeaseMode

boolean isNOWriteLeaseMode()
Checks the write mode.

Returns:
true if do not return Lease object after write, otherwise false.
See Also:
setNOWriteLeaseMode(boolean)

getFinderURL

SpaceURL getFinderURL()
Returns the SpaceURL object which was used as the argument for SpaceFinder.find(SpaceURL) while looking for the space. If a client uses this SpaceURL when it calls to SpaceFinder.find(SpaceURL) it should be able to find that space. Notice: The SpaceURL returned when calling getURL() is different since in that case it returns the SpaceURL used to initialize the space (a java:// protocol to start an embedded space).

Returns:
SpaceURL object which can be used to find the space proxy while calling SpaceFinder.find(SpaceURL)

setUpdateModifiers

int setUpdateModifiers(int newModifiers)
Sets the update mode modifiers for proxy level.

Parameters:
newModifiers - new values for modifiers Values are defined in UpdateModifiers.
Returns:
old value of modifiers.
See Also:
IPojoSpace.update(Object, Transaction, long, long, int), IPojoSpace.update(Object, Transaction, long, long, int)

getUpdateModifiers

int getUpdateModifiers()
Gets the proxyUpdateModifiers. Values are defined in UpdateModifiers class.
Default value: UPDATE_ONLY.

Returns:
value of modifiers.
See Also:
IPojoSpace.update(Object, Transaction, long, long, int), IPojoSpace.update(Object, Transaction, long, long, int)

setReadModifiers

int setReadModifiers(int readModifiers)
Sets the read mode modifiers for proxy level.
Default: ReadModifiers.REPEATABLE_READ

Parameters:
readModifiers - new values for modifiers Values are defined in ReadModifiers.
Returns:
old value of modifiers.
Since:
6.0
See Also:
ReadModifiers, IPojoSpace.read(Object, Transaction, long, int), IJSpace.readIfExists(net.jini.core.entry.Entry, Transaction, long, int)

getReadModifiers

int getReadModifiers()
Gets the proxy ReadModifiers.
values are from ReadModifiers.

Returns:
value of modifiers.
Since:
6.0
See Also:
IPojoSpace.read(Object, Transaction, long, int), IJSpace.readIfExists(net.jini.core.entry.Entry, Transaction, long, int)

setDefaultTransaction

void setDefaultTransaction(Transaction transaction)
Sets default transaction to use in case that null parameter is used as transaction parameter with JavaSpace methods.
Notice: after commit/abort the default transaction should be set to null otherwise the TransactionException will be thrown on the next space operation call.

 proxyAdmin.setDefaultTransaction( txn);

 space.write( entry1, null, Lease.FOREVER );
 space.write( entry2, null, Lease.FOREVER );
 txn.commit();

 proxyAdmin.setDefaultTransaction( null);
 

Note: This function is unsupported when using it in conjunction with local cache.

Parameters:
transaction - the default transaction.