code: public void register() throws IOException {
      try {
        registeredPrefixId = face.registerPrefix(prefix, this, new OnRegisterFailed() {
          @Override
          public void onRegisterFailed(Name prefix) {
            registeredPrefixId = UNREGISTERED;
            logger.log(Level.SEVERE, "Failed to register prefix: " + prefix.toUri());
          }
        }, new ForwardingFlags());
        logger.log(Level.FINER, "Registered a new prefix: " + prefix.toUri());
      } catch (net.named_data.jndn.security.SecurityException e) {
        throw new IOException("Failed to communicate to face due to security error", e);
      }
    }
docs: Register a prefix for responding to interests.
  
  @throws java.io.IOException if IO fails