DATAGEODE-302 - Rename DefaultMemberFunctionExecution to OnDefaultMemberFunctionExecution.

Format source code.

Edit Javadoc.
This commit is contained in:
John Blum
2020-04-01 11:33:38 -07:00
parent d3820c84e9
commit b7c0f16d53
4 changed files with 51 additions and 31 deletions

View File

@@ -12,43 +12,45 @@
*/
package org.springframework.data.gemfire.function.execution;
import org.apache.geode.distributed.DistributedMember;
/**
*
* @author David Turanski
* @see org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate
* @author John Blum
* @see org.apache.geode.distributed.DistributedMember
* @see org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate
*/
public class GemfireOnMemberFunctionTemplate extends AbstractFunctionTemplate {
public class GemfireOnMemberFunctionTemplate extends AbstractFunctionTemplate {
private final DistributedMember distributedMember;
private final String[] groups;
public GemfireOnMemberFunctionTemplate (DistributedMember distributedMember) {
public GemfireOnMemberFunctionTemplate() {
this.distributedMember = null;
this.groups = null;
}
public GemfireOnMemberFunctionTemplate(DistributedMember distributedMember) {
this.distributedMember = distributedMember;
this.groups = null;
}
public GemfireOnMemberFunctionTemplate (String[] groups) {
public GemfireOnMemberFunctionTemplate(String[] groups) {
this.distributedMember = null;
this.groups = groups;
}
public GemfireOnMemberFunctionTemplate () {
this.distributedMember = null;
this.groups = null;
}
protected AbstractFunctionExecution getFunctionExecution() {
if (distributedMember == null && groups == null) {
return new DefaultMemberFunctionExecution();
} else if (distributedMember == null) {
if (this.distributedMember == null && this.groups == null) {
return new OnDefaultMemberFunctionExecution();
}
else if (this.distributedMember == null) {
return new OnMemberInGroupsFunctionExecution(this.groups);
}
return new OnDistributedMemberFunctionExecution(this.distributedMember);
}
}

View File

@@ -17,38 +17,42 @@ import java.util.Set;
import org.apache.geode.distributed.DistributedMember;
/**
*
* @author David Turanski
* @see org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate
* @author John Blum
* @see org.apache.geode.distributed.DistributedMember
* @see org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate
*/
public class GemfireOnMembersFunctionTemplate extends AbstractFunctionTemplate {
public class GemfireOnMembersFunctionTemplate extends AbstractFunctionTemplate {
private final Set<DistributedMember> distributedMembers;
private final String[] groups;
public GemfireOnMembersFunctionTemplate (Set<DistributedMember> distributedMembers) {
public GemfireOnMembersFunctionTemplate() {
this.distributedMembers = null;
this.groups = null;
}
public GemfireOnMembersFunctionTemplate(Set<DistributedMember> distributedMembers) {
this.distributedMembers = distributedMembers;
this.groups = null;
}
public GemfireOnMembersFunctionTemplate (String[] groups) {
public GemfireOnMembersFunctionTemplate(String[] groups) {
this.distributedMembers = null;
this.groups = groups;
}
public GemfireOnMembersFunctionTemplate () {
this.distributedMembers = null;
this.groups = null;
}
protected AbstractFunctionExecution getFunctionExecution() {
if (distributedMembers == null && groups == null) {
if (this.distributedMembers == null && this.groups == null) {
return new OnAllMembersFunctionExecution();
} else if (distributedMembers == null) {
}
else if (this.distributedMembers == null) {
return new OnMembersInGroupsFunctionExecution(this.groups);
}
return new OnDistributedMembersFunctionExecution(this.distributedMembers);
}
}

View File

@@ -15,16 +15,19 @@ package org.springframework.data.gemfire.function.execution;
import java.util.Set;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.execute.Execution;
import org.apache.geode.cache.execute.Function;
import org.springframework.util.Assert;
/**
* An {@link AbstractFunctionTemplate} implementation for executing a {@link Function} on a target {@link Region}.
* An {@link AbstractFunctionTemplate} implementation for {@link Execution executing} a {@link Function}
* on a target {@link Region}.
*
* @author David Turanski
* @author John Blum
* @see org.apache.geode.cache.Region
* @see org.apache.geode.cache.execute.Execution
* @see org.apache.geode.cache.execute.Function
* @see org.springframework.data.gemfire.function.execution.AbstractFunctionTemplate
* @see org.springframework.data.gemfire.function.execution.GemfireOnRegionOperations

View File

@@ -13,17 +13,28 @@
package org.springframework.data.gemfire.function.execution;
import org.apache.geode.cache.execute.Execution;
import org.apache.geode.cache.execute.Function;
import org.apache.geode.cache.execute.FunctionService;
import org.apache.geode.distributed.DistributedMember;
/**
* @author David Turanski
* Creates an {@literal OnMember} {@link Function} {@link Execution} for a single member
* using {@link FunctionService#onMember(String...)} with no {@link String groups}
* nor a {@link DistributedMember}.
*
* @author David Turanski
* @author John Blum
* @see org.apache.geode.cache.execute.Execution
* @see org.apache.geode.cache.execute.Function
* @see org.apache.geode.cache.execute.FunctionService
* @see org.springframework.data.gemfire.function.execution.AbstractFunctionExecution
* @since 1.3.0
*/
class DefaultMemberFunctionExecution extends AbstractFunctionExecution {
class OnDefaultMemberFunctionExecution extends AbstractFunctionExecution {
@Override
@SuppressWarnings("rawtypes")
protected Execution getExecution() {
return FunctionService.onMember();
}
}