Module com.aoapps.appcluster.core
Package com.aoapps.appcluster
Class Resource<R extends Resource<R,N>,N extends ResourceNode<R,N>>
java.lang.Object
com.aoapps.appcluster.Resource<R,N>
- Direct Known Subclasses:
CronResource
Monitors the status of a resource by monitoring its role based on DNS entries
and synchronizing the resource on an as-needed and/or scheduled basis.
- Author:
- AO Industries, Inc.
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Resource
(AppCluster cluster, ResourceConfiguration<R, N> resourceConfiguration, Collection<? extends ResourceNode<?, ?>> resourceNodes) -
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract boolean
Gets if this resource allows multiple master servers.Gets the cluster this resource is part of.Gets the display name of this resource.Gets the DNS monitor for this resource.Set
<? extends Nameserver> Gets the set of all nameservers used by all enabled nodes.getId()
The unique ID of this resource.Gets the set of master records that must all by the same.int
Gets the expected TTL value for the master record.Gets the status of this resource based on disabled, last monitoring results, and synchronization state.Gets a map-view of the resource synchronizers keyed on remote node.Gets the set of resource synchronizers.getType()
Gets the replication type of this resource.int
hashCode()
boolean
Determines if both the cluster and this resource are enabled.protected abstract ResourceSynchronizer
<R, N> newResourceSynchronizer
(N localResourceNode, N remoteResourceNode, ResourceConfiguration<R, N> resourceConfiguration) Creates the resource synchronizer for this specific type of resource ornull
if never performs any synchronization between these two nodes.toString()
-
Constructor Details
-
Resource
protected Resource(AppCluster cluster, ResourceConfiguration<R, N> resourceConfiguration, Collection<? extends ResourceNode<?, throws AppClusterConfigurationException?>> resourceNodes) - Throws:
AppClusterConfigurationException
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
getCluster
Gets the cluster this resource is part of. -
getId
The unique ID of this resource. -
isEnabled
public boolean isEnabled()Determines if both the cluster and this resource are enabled. -
getDisplay
Gets the display name of this resource. -
getMasterRecords
Gets the set of master records that must all by the same. The master node is determined by matching these records against the resource node configuration's node records. -
getMasterRecordsTtl
public int getMasterRecordsTtl()Gets the expected TTL value for the master record. -
getEnabledNameservers
Gets the set of all nameservers used by all enabled nodes. -
getDnsMonitor
Gets the DNS monitor for this resource. -
getResourceNodes
-
getStatus
Gets the status of this resource based on disabled, last monitoring results, and synchronization state. -
getAllowMultiMaster
public abstract boolean getAllowMultiMaster()Gets if this resource allows multiple master servers. -
getType
Gets the replication type of this resource. -
newResourceSynchronizer
protected abstract ResourceSynchronizer<R,N> newResourceSynchronizer(N localResourceNode, N remoteResourceNode, ResourceConfiguration<R, N> resourceConfiguration) throws AppClusterConfigurationExceptionCreates the resource synchronizer for this specific type of resource ornull
if never performs any synchronization between these two nodes.- Throws:
AppClusterConfigurationException
-
getSynchronizers
Gets the set of resource synchronizers. -
getSynchronizerMap
Gets a map-view of the resource synchronizers keyed on remote node. If the local node is not part of the resource nodes, returns an empty map.
-