1 package de.juplo.facebook.errors;
4 import java.util.regex.Matcher;
5 import java.util.regex.Pattern;
6 import org.springframework.http.HttpHeaders;
7 import org.springframework.http.HttpStatus;
12 * 21: Page ID (XXX) was migrated to page ID (YYY).
15 public class PageMigratedException extends OAuthException
17 private final static Pattern pattern =
18 Pattern.compile("Page ID ([0-9]+) was migrated to page ID ([0-9]+)");
20 private final Long oldId, newId;
23 protected PageMigratedException(
26 FacebookErrorMessage error
29 super(status, headers, error);
30 Matcher matcher = pattern.matcher(error.message);
33 String warning = "Could not parse migration-error: " + error.message;
35 throw new RuntimeException(warning);
37 oldId = Long.parseLong(matcher.group(1));
38 newId = Long.parseLong(matcher.group(2));
42 public Long getOldId()
47 public Long getNewId()