Class HazelcastDataConnection
- java.lang.Object
-
- com.hazelcast.dataconnection.DataConnectionBase
-
- com.hazelcast.dataconnection.HazelcastDataConnection
-
- All Implemented Interfaces:
DataConnection
public class HazelcastDataConnection extends DataConnectionBase
Creates a HazelcastInstance that is shared to connect to a remote cluster.Set the client XML as property using
CLIENT_XML
as property key or Set the client YAML as property usingCLIENT_YML
as property key- Since:
- 5.3
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLIENT_XML
The constant to be used as property key for XML string for connecting to remote clusterstatic java.lang.String
CLIENT_XML_PATH
The constant to be used as property key for XML file path for connecting to remote clusterstatic java.lang.String
CLIENT_YML
The constant to be used as property key for YAML string for connecting to remote clusterstatic java.lang.String
CLIENT_YML_PATH
The constant to be used as property key for YAML file path for connecting to remote clusterstatic java.lang.String
OBJECT_TYPE_IMAP_JOURNAL
IMap Journal resource type name
-
Constructor Summary
Constructors Constructor Description HazelcastDataConnection(DataConnectionConfig dataConnectionConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Called by the member when shutting down.HazelcastInstance
getClient()
Return a clientHazelcastInstance
based on this data connection configuration.java.util.Collection<DataConnectionResource>
listResources()
Returns list ofDataConnectionResource
s accessible via this DataConnection.java.util.Collection<java.lang.String>
resourceTypes()
Returns the list of possible values forDataConnectionResource.type()
, that will be returned whenDataConnection.listResources()
is called.-
Methods inherited from class com.hazelcast.dataconnection.DataConnectionBase
getConfig, getName, release, retain
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hazelcast.dataconnection.DataConnection
options
-
-
-
-
Field Detail
-
CLIENT_XML
public static final java.lang.String CLIENT_XML
The constant to be used as property key for XML string for connecting to remote cluster- See Also:
- Constant Field Values
-
CLIENT_YML
public static final java.lang.String CLIENT_YML
The constant to be used as property key for YAML string for connecting to remote cluster- See Also:
- Constant Field Values
-
CLIENT_XML_PATH
public static final java.lang.String CLIENT_XML_PATH
The constant to be used as property key for XML file path for connecting to remote cluster- See Also:
- Constant Field Values
-
CLIENT_YML_PATH
public static final java.lang.String CLIENT_YML_PATH
The constant to be used as property key for YAML file path for connecting to remote cluster- See Also:
- Constant Field Values
-
OBJECT_TYPE_IMAP_JOURNAL
public static final java.lang.String OBJECT_TYPE_IMAP_JOURNAL
IMap Journal resource type name- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HazelcastDataConnection
public HazelcastDataConnection(@Nonnull DataConnectionConfig dataConnectionConfig)
-
-
Method Detail
-
resourceTypes
@Nonnull public java.util.Collection<java.lang.String> resourceTypes()
Description copied from interface:DataConnection
Returns the list of possible values forDataConnectionResource.type()
, that will be returned whenDataConnection.listResources()
is called. Returned values are case-insensitive, e.g.DataConnectionResource.type()
may returnMY_RES
and this methodmy_res
.
-
listResources
@Nonnull public java.util.Collection<DataConnectionResource> listResources()
Description copied from interface:DataConnection
Returns list ofDataConnectionResource
s accessible via this DataConnection.It is not strictly required that the data connection lists all resources; a resource can be used even if it is not listed. For example, the list of resources in Oracle database might not include tables available through a database link. In fact, it might list no resources at all, perhaps if the security in the target system prevents reading of such a list.
The returned list contains up-to-date list of resources. Any changes (added or removed resources) must be reflected in subsequent calls to this method.
-
getClient
@Nonnull public HazelcastInstance getClient()
Return a clientHazelcastInstance
based on this data connection configuration.Depending on the
DataConnectionConfig.isShared()
config the HazelcastInstance is - shared=true -> a single instance is created - shared=false -> a new instance is created each time the method is calledThe caller must call `shutdown` on the instance when finished to allow correct release of the underlying resources. In case of a shared instance, the instance is shut down when all users call the shutdown method and this DataConnection is released. In case of a non-shared instance, the instance is shutdown immediately when the shutdown method is called.
-
destroy
public void destroy()
Description copied from interface:DataConnection
Called by the member when shutting down. Should unconditionally close all connections and release resources.
-
-