org.tiian.flom
public class FlomHandle extends java.lang.Object
| Constructor and Description |
|---|
FlomHandle()
Create a new object calling the native interface
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize()
Release native object if finalization is executed and the program
forgot to call release method
|
void |
free()
Explicitly free the native object allocated by JNI wrapper
|
int |
getDiscoveryAttempts()
Get the maximum number of attempts that will be tryed during
auto-discovery phase using UDP/IP multicast (see
getMulticastAddress, getMulticastPort).
|
int |
getDiscoveryTimeout()
Get the number of milliseconds between two consecutive attempts that
will be tryed during auto-discovery phase using UDP/IP multicast (see
getMulticastAddress, getMulticastPort).
|
int |
getDiscoveryTtl()
Get the UDP/IP multicast TTL parameter used during auto-discovery
phase; for a definition of the parameter, see
http://www.tldp.org/HOWTO/Multicast-HOWTO-2.html
.
|
java.lang.String |
getLockedElement()
Get the name of the locked element if the resource is of type set;
this method throws an exception if the name of the locked element is
not available
|
int |
getLockMode()
Get lock mode property: how a simple or hierarchical resource will
be locked when method lock is called; FLoM
supports the same lock mode semantic proposed by DLM, see
http://en.wikipedia.org/wiki/Distributed_lock_manager#Lock_modes
for a detailed explanation
.
|
java.lang.String |
getMulticastAddress()
Get the multicast address: the IP address (or a network name that
the system can resolve) of the IP multicast group that must be
contacted to reach FLoM daemon (server) using UDP/IP; see also
getMulticastPort.
|
int |
getMulticastPort()
Get the UDP/IP multicast port that must be used to contact the FLoM
daemon (server) using UDP/IP; see also getMulticastAddress.
|
java.lang.String |
getNetworkInterface()
Get the network interface that must be used for IPv6 link local
addresses
The current value can be altered using method
setNetworkInterface.
|
boolean |
getResourceCreate()
Get the UDP/IP multicast port that must be used to contact the FLoM
daemon (server) using UDP/IP; see also getMulticastAddress.
|
int |
getResourceIdleLifespan()
Get "resource idle lifespan" property: it specifies how many
milliseconds a resource will be kept after the last locker released
it; the expiration is necessary to avoid useless resource allocation.
|
java.lang.String |
getResourceName()
Get the resource name: the name of the resource that can be locked
and unlocked using lock and unlock methods.
|
int |
getResourceQuantity()
Get "resource quantity" property: the number of units that will be
locked and unlocked using lock and unlock methods.
|
int |
getResourceTimeout()
Get "resource timeout" property: how long a lock operation
(see lock) will wait if the resource is locked
by another requester.
|
java.lang.String |
getSocketName()
Get the socket name: the AF_LOCAL/AF_UNIX socket name that must be
used to contact a local FLoM daemon (server).
|
java.lang.String |
getTlsCaCertificate()
Get the TLS CA certificate file name.
|
java.lang.String |
getTlsCertificate()
Get the TLS certificate file name.
|
boolean |
getTlsCheckPeerId()
Get the TLS check peer ID flag value.
|
java.lang.String |
getTlsPrivateKey()
Get the TLS private key file name.
|
java.lang.String |
getTraceFilename()
Get the trace filename: the name (absolute or relative path) used
by libflom (FLoM client library) to record trace messages.
|
java.lang.String |
getUnicastAddress()
Get the unicast address: the IP address (or a network name that the
system can resolve) of the host that must be contacted
to reach FLoM daemon (server) using TCP/IP; see also
getUnicastPort.
|
int |
getUnicastPort()
Get the TCP/IP unicast port that must be used to contact the FLoM
daemon (server) using TCP/IP; see also getUnicastAddress.
|
void |
lock()
Lock the (logical) resource linked to this handle; the resource
MUST be unlocked using method
unlock
(or unlockRollback)
when the lock condition is no more necessary. |
int |
setDiscoveryAttempts(int value)
Set the maximum number of attempts that will be tryed during
auto-discovery phase using UDP/IP multicast (see
setMulticastAddress, setMulticastPort).
|
int |
setDiscoveryTimeout(int value)
Set the number of milliseconds between two consecutive attempts that
will be tryed during auto-discovery phase using UDP/IP multicast (see
setMulticastAddress, setMulticastPort).
|
int |
setDiscoveryTtl(int value)
Set the UDP/IP multicast TTL parameter used during auto-discovery
phase; for a definition of the parameter, see
http://www.tldp.org/HOWTO/Multicast-HOWTO-2.html
.
|
int |
setLockMode(int value)
Set lock mode property: how a simple or hierarchical resource will
be locked when method lock is called; FLoM
supports the same lock mode semantic proposed by DLM, see
http://en.wikipedia.org/wiki/Distributed_lock_manager#Lock_modes
for a detailed explanation
.
|
int |
setMulticastAddress(java.lang.String value)
Set the multicast address: the IP address (or a network name that
the system can resolve) of the IP multicast group that must be
contacted to reach FLoM daemon (server) using UDP/IP; see also
setMulticastPort.
|
int |
setMulticastPort(int value)
Set the UDP/IP multicast port that must be used to contact the FLoM
daemon (server) using UDP/IP; see also setMulticastAddress.
|
int |
setNetworkInterface(java.lang.String value)
Set the network interface that must be used for IPv6 link local
addresses
The current value can be inspected using method
getNetworkInterface.
|
int |
setResourceCreate(boolean value)
Set "resource create" boolean property: it specifies if method
lock can create a new resource when the specified
one is not defined.
|
int |
setResourceIdleLifespan(int value)
Set "resource idle lifespan" property: it specifies how many
milliseconds a resource will be kept after the last locker released
it; the expiration is necessary to avoid useless resource allocation.
|
int |
setResourceName(java.lang.String value)
Set the resource name: the name of the resource that can be locked
and unlocked using lock and unlock methods.
|
int |
setResourceQuantity(int value)
Set "resource quantity" property: the number of units that will be
locked and unlocked using lock and unlock methods.
|
int |
setResourceTimeout(int value)
Set "resource timeout" property: how long a lock operation
(see lock) will wait if the resource is locked
by another requester.
|
int |
setSocketName(java.lang.String value)
Set the socket name: the AF_LOCAL/AF_UNIX socket name that must be
used to contact a local FLoM daemon (server).
|
int |
setTlsCaCertificate(java.lang.String value)
Set the TLS CA certificate file name.
|
int |
setTlsCertificate(java.lang.String value)
Set the TLS certificate file name.
|
int |
setTlsCheckPeerId(boolean value)
Set "TLS check peer ID" boolean property: it specifies if this node
must check the unique ID presented by the remote peer.
|
int |
setTlsPrivateKey(java.lang.String value)
Set the TLS CA private key file name.
|
int |
setTraceFilename(java.lang.String value)
Set the trace filename: the name (absolute or relative path) used
by libflom (FLoM client library) to record trace messages.
|
int |
setUnicastAddress(java.lang.String value)
Set the unicast address: the IP address (or a network name that the
system can resolve) of the host that must be contacted
to reach FLoM daemon (server) using TCP/IP; see also
setUnicastPort.
|
int |
setUnicastPort(int value)
Set the TCP/IP unicast port that must be used to contact the FLoM
daemon (server) using TCP/IP; see also setUnicastAddress.
|
void |
unlock()
Unlock the (logical) resource linked to this handle; the resource
MUST be previously locked using method
lock |
void |
unlockRollback()
Unlock the (logical) resource linked to this handle and rollback the
transactiona resource state; the resource MUST be previously locked
using method
lock |
public FlomHandle()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic void free()
protected void finalize()
finalize in class java.lang.Objectpublic void lock()
throws FlomException
unlock
(or unlockRollback)
when the lock condition is no more necessary.FlomException - if the underlying native C function returns
an error conditionpublic void unlock()
throws FlomException
lockFlomException - if the underlying native C function returns
an error conditionpublic void unlockRollback()
throws FlomException
lockFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getLockedElement()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int getDiscoveryAttempts()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setDiscoveryAttempts(int value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic int getDiscoveryTimeout()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setDiscoveryTimeout(int value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic int getDiscoveryTtl()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setDiscoveryTtl(int value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic int getLockMode()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setLockMode(int value)
throws FlomException
value - (Input): the new value
The available lock modes are described by class FlomLockModesFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getMulticastAddress()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setMulticastAddress(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic int getMulticastPort()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setMulticastPort(int value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getNetworkInterface()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setNetworkInterface(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic boolean getResourceCreate()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setResourceCreate(boolean value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic int getResourceIdleLifespan()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setResourceIdleLifespan(int value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getResourceName()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setResourceName(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic int getResourceQuantity()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setResourceQuantity(int value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic int getResourceTimeout()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setResourceTimeout(int value)
throws FlomException
value - (Input): the new value: FlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getSocketName()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setSocketName(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getTraceFilename()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setTraceFilename(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getUnicastAddress()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setUnicastAddress(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic int getUnicastPort()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setUnicastPort(int value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getTlsCertificate()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setTlsCertificate(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getTlsPrivateKey()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setTlsPrivateKey(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic java.lang.String getTlsCaCertificate()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setTlsCaCertificate(java.lang.String value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error conditionpublic boolean getTlsCheckPeerId()
throws FlomException
FlomException - if the underlying native C function returns
an error conditionpublic int setTlsCheckPeerId(boolean value)
throws FlomException
value - (Input): the new valueFlomException - if the underlying native C function returns
an error condition