/**
* Sets the avatar to the specified value
*/
public int setAvatar(String role, boolean noverification, String serviceName, String instance)
throws IOException {
Avatar dest;
if (Avatar.ACTIVE.toString().equalsIgnoreCase(role)) {
dest = Avatar.ACTIVE;
} else if (Avatar.STANDBY.toString().equalsIgnoreCase(role)) {
throw new IOException("setAvatar Command only works to switch avatar" +
" from Standby to Primary");
} else {
throw new IOException("Unknown avatar type " + role);
}
Avatar current = avatarnode.getAvatar();
if (current == dest) {
System.out.println("This instance is already in " + current + " avatar.");
} else {
try {
avatarnode.quiesceForFailover(noverification);