Package com.hazelcast.config
Class DataConnectionConfig
- java.lang.Object
-
- com.hazelcast.config.DataConnectionConfig
-
- All Implemented Interfaces:
NamedConfig
,DataSerializable
,IdentifiedDataSerializable
@Beta public class DataConnectionConfig extends java.lang.Object implements IdentifiedDataSerializable, NamedConfig
A configuration of a data connection that can be used:- Since:
- 5.3
-
-
Constructor Summary
Constructors Constructor Description DataConnectionConfig()
DataConnectionConfig(DataConnectionConfig config)
DataConnectionConfig(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getClassId()
Returns type identifier for this class.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.java.lang.String
getName()
Returns the name of this data connection.java.util.Properties
getProperties()
Returns all the properties of a data connectionjava.lang.String
getProperty(java.lang.String key)
Returns a single property of a data connectionjava.lang.String
getProperty(java.lang.String key, java.lang.String defaultValue)
Returns a single property of a data connectionjava.lang.String
getType()
Returns the type of theDataConnection
int
hashCode()
boolean
isShared()
true
if an instance of the data connection will be reused.void
readData(ObjectDataInput in)
Reads fields from the input streamDataConnectionConfig
setName(java.lang.String name)
Sets the name of this data connection, the name must be unique.DataConnectionConfig
setProperties(java.util.Properties properties)
Sets the properties of a data connection.DataConnectionConfig
setProperty(java.lang.String key, java.lang.String value)
Sets a single property.DataConnectionConfig
setShared(boolean shared)
true
if an instance of the data connection will be reused.DataConnectionConfig
setType(java.lang.String type)
Sets the type of theDataConnection
java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Constructor Detail
-
DataConnectionConfig
public DataConnectionConfig()
-
DataConnectionConfig
public DataConnectionConfig(DataConnectionConfig config)
-
DataConnectionConfig
public DataConnectionConfig(java.lang.String name)
-
-
Method Detail
-
setName
public DataConnectionConfig setName(java.lang.String name)
Sets the name of this data connection, the name must be unique.- Specified by:
setName
in interfaceNamedConfig
- Returns:
- this DataConnectionConfig
-
getName
public java.lang.String getName()
Returns the name of this data connection.- Specified by:
getName
in interfaceNamedConfig
- Returns:
- the name of this data connection
-
getType
public java.lang.String getType()
Returns the type of theDataConnection
-
setType
public DataConnectionConfig setType(@Nonnull java.lang.String type)
Sets the type of theDataConnection
-
isShared
public boolean isShared()
true
if an instance of the data connection will be reused.false
when on each usage the data connection instance should be created. The default istrue
- Returns:
- if the data connection instance should be reused
-
setShared
public DataConnectionConfig setShared(boolean shared)
true
if an instance of the data connection will be reused.false
when on each usage the data connection instance should be created- Parameters:
shared
- if the data connection instance should be reused- Returns:
- this DataConnectionConfig
-
getProperties
public java.util.Properties getProperties()
Returns all the properties of a data connection- Returns:
- all the properties of a data connection
-
getProperty
@Nullable public java.lang.String getProperty(java.lang.String key)
Returns a single property of a data connection- Parameters:
key
- the property key of a data connection- Returns:
- property value or null if the given key doesn't exist
-
getProperty
@Nullable public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
Returns a single property of a data connection- Parameters:
key
- the property key of a data connection- Returns:
- property value or default value if the given key doesn't exist
-
setProperty
public DataConnectionConfig setProperty(java.lang.String key, java.lang.String value)
Sets a single property. SeesetProperties(Properties)
- Parameters:
key
- the property keyvalue
- the property value- Returns:
- this DataConnectionConfig
-
setProperties
public DataConnectionConfig setProperties(java.util.Properties properties)
Sets the properties of a data connection. See implementations ofDataConnection
for supported values- Parameters:
properties
- the properties to be set- Returns:
- this DataConnectionConfig
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
writeData
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
getFactoryId
public int getFactoryId()
Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()
Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
-