private CommandMessage createLoginCommandMessage() {
    CommandMessage commandMessage = new CommandMessage();
    commandMessage.setOperation(CommandMessage.LOGIN_OPERATION);

    String credString = username + ":" + password;
    Encoder encoder = new Encoder(credString.length());
    encoder.encode(credString.getBytes());

    commandMessage.setBody(encoder.drain());
    commandMessage.setDestination(DESTINATION);
    return commandMessage;
  }
 private static CommandMessage createLogoutCommandMessage() {
   CommandMessage commandMessage = new CommandMessage();
   commandMessage.setOperation(CommandMessage.LOGOUT_OPERATION);
   commandMessage.setDestination(DESTINATION);
   return commandMessage;
 }