3 * WebFinger resource parent class
6 * @author Mikael Nordfeldth
7 * @copyright 2013 Free Software Foundation, Inc.
8 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
9 * @link http://status.net/
12 abstract class WebFingerResource
14 protected $identities = array();
16 protected $object = null;
17 protected $type = null;
19 public function __construct(Managed_DataObject $object)
21 $this->object = $object;
24 public function getObject()
26 if ($this->object === null) {
27 throw new ServerException('Object is not set');
32 public function getAliases()
36 // Add the URI as an identity, this is _not_ necessarily an HTTP url
37 $aliases[] = $this->object->getUri();
40 $aliases[] = $this->object->getUrl();
41 } catch (InvalidUrlException $e) {
42 // getUrl failed because no valid URL could be returned, just ignore it
48 abstract public function updateXRD(XML_XRD $xrd);