mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-13 09:20:36 +00:00
41 lines
25 KiB
HTML
41 lines
25 KiB
HTML
<!DOCTYPE html ><html><head><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/><title>PSF-LoginServer - master - net.psforever.objects.guid.actor</title><meta content="PSF - LoginServer - master - net.psforever.objects.guid.actor" name="description"/><meta content="PSF LoginServer master net.psforever.objects.guid.actor" name="keywords"/><meta http-equiv="content-type" content="text/html; charset=UTF-8"/><link href="../../../../../lib/index.css" media="screen" type="text/css" rel="stylesheet"/><link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet"/><link href="../../../../../lib/print.css" media="print" type="text/css" rel="stylesheet"/><link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css"/><script type="text/javascript" src="../../../../../lib/jquery.min.js"></script><script type="text/javascript" src="../../../../../lib/index.js"></script><script type="text/javascript" src="../../../../../index.js"></script><script type="text/javascript" src="../../../../../lib/scheduler.js"></script><script type="text/javascript" src="../../../../../lib/template.js"></script><script type="text/javascript">/* this variable can be used by the JS to determine the path to the root document */
|
|
var toRoot = '../../../../../';</script></head><body><div id="search"><span id="doc-title">PSF-LoginServer - <span id="doc-version">master</span></span> <span class="close-results"><span class="left"><</span> Back</span><div id="textfilter"><span class="input"><input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/"/><i class="clear material-icons"></i><i id="search-icon" class="material-icons"></i></span></div></div><div id="search-results"><div id="search-progress"><div id="progress-fill"></div></div><div id="results-content"><div id="entity-results"></div><div id="member-results"></div></div></div><div id="content-scroll-container" style="-webkit-overflow-scrolling: touch;"><div id="content-container" style="-webkit-overflow-scrolling: touch;"><div id="subpackage-spacer"><div id="packages"><h1>Packages</h1><ul><li class="indented0 " name="_root_.root" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="_root_"></a><a id="root:_root_"></a> <span class="permalink"><a href="../../../../../index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../../../../../index.html" title=""><span class="name">root</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../../../../index.html" name="_root_" id="_root_" class="extype">root</a></dd></dl></div></li><li class="indented1 " name="_root_.net" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="net"></a><a id="net:net"></a> <span class="permalink"><a href="../../../../../net/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../../../../index.html" title=""><span class="name">net</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../../../../index.html" name="_root_" id="_root_" class="extype">root</a></dd></dl></div></li><li class="indented2 " name="net.psforever" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="psforever"></a><a id="psforever:psforever"></a> <span class="permalink"><a href="../../../../../net/psforever/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../../../index.html" title=""><span class="name">psforever</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../../../index.html" name="net" id="net" class="extype">net</a></dd></dl></div></li><li class="indented3 " name="net.psforever.objects" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="objects"></a><a id="objects:objects"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../../index.html" title=""><span class="name">objects</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../../index.html" name="net.psforever" id="net.psforever" class="extype">psforever</a></dd></dl></div></li><li class="indented4 " name="net.psforever.objects.guid" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="guid"></a><a id="guid:guid"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../index.html" title=""><span class="name">guid</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../../index.html" name="net.psforever.objects" id="net.psforever.objects" class="extype">objects</a></dd></dl></div></li><li class="indented5 current" name="net.psforever.objects.guid.actor" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="actor"></a><a id="actor:actor"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><span class="name">actor</span></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li><li class="current-entities indented5"><a href="NumberPoolActor$.html" title="" class="object"></a> <a href="NumberPoolActor.html" title="An Actor that wraps around a NumberPool and regulates access to it. Wrapping around the pool like this forces a FIFO order to requests for numbers from the pool." class="class"></a><a href="NumberPoolActor.html" title="An Actor that wraps around a NumberPool and regulates access to it. Wrapping around the pool like this forces a FIFO order to requests for numbers from the pool.">NumberPoolActor</a></li><li class="current-entities indented5"><a href="Register$.html" title="" class="object"></a> <a href="Register.html" title="A message for accepting object-number registration requests. The callback is actually an ActorRef to which a RegisterSuccess message or a RegisterFailure message is sent." class="class"></a><a href="Register.html" title="A message for accepting object-number registration requests. The callback is actually an ActorRef to which a RegisterSuccess message or a RegisterFailure message is sent.">Register</a></li><li class="current-entities indented5"><a href="UniqueNumberSystem$.html" title="" class="object"></a> <a href="UniqueNumberSystem.html" title="An Actor that wraps around converted NumberPools and synchronizes a portion of the number registration process." class="class"></a><a href="UniqueNumberSystem.html" title="An Actor that wraps around converted NumberPools and synchronizes a portion of the number registration process.">UniqueNumberSystem</a></li><li class="current-entities indented5"><a href="Unregister$.html" title="" class="object"></a> <a href="Unregister.html" title="A message for accepting object-number unregistration requests." class="class"></a><a href="Unregister.html" title="A message for accepting object-number unregistration requests.">Unregister</a></li><li class="indented5 " name="net.psforever.objects.guid.key" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="key"></a><a id="key:key"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/key/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../key/index.html" title=""><span class="name">key</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li><li class="indented5 " name="net.psforever.objects.guid.pool" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="pool"></a><a id="pool:pool"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/pool/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../pool/index.html" title=""><span class="name">pool</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li><li class="indented5 " name="net.psforever.objects.guid.selector" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="selector"></a><a id="selector:selector"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/selector/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../selector/index.html" title=""><span class="name">selector</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li><li class="indented5 " name="net.psforever.objects.guid.source" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="source"></a><a id="source:source"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/source/index.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><a href="../source/index.html" title=""><span class="name">source</span></a></span><div class="fullcomment"><dl class="attributes block"><dt>Definition Classes</dt><dd><a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></dd></dl></div></li></ul></div></div><div id="content"><body class="package value"><div id="definition"><div class="big-circle package">p</div><p id="owner"><a href="../../../../index.html" name="net" id="net" class="extype">net</a>.<a href="../../../index.html" name="net.psforever" id="net.psforever" class="extype">psforever</a>.<a href="../../index.html" name="net.psforever.objects" id="net.psforever.objects" class="extype">objects</a>.<a href="../index.html" name="net.psforever.objects.guid" id="net.psforever.objects.guid" class="extype">guid</a></p><h1>actor<span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/index.html" title="Permalink"><i class="material-icons"></i></a></span></h1></div><h4 id="signature" class="signature"><span class="modifier_kind"><span class="modifier"></span> <span class="kind">package</span></span> <span class="symbol"><span class="name">actor</span></span></h4><div id="comment" class="fullcommenttop"></div><div id="mbrsel"><div class="toggle"></div><div id="memberfilter"><i class="material-icons arrow"></i><span class="input"><input placeholder="Filter all members" id="mbrsel-input" type="text" accesskey="/"/></span><i class="clear material-icons"></i></div><div id="filterby"><div id="order"><span class="filtertype">Ordering</span><ol><li class="alpha in"><span>Alphabetic</span></li></ol></div><div id="visbl"><span class="filtertype">Visibility</span><ol><li class="public in"><span>Public</span></li><li class="protected out"><span>Protected</span></li></ol></div></div></div><div id="template"><div id="allMembers"><div id="types" class="types members"><h3>Type Members</h3><ol><li class="indented0 " name="net.psforever.objects.guid.actor.NumberPoolActor" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="NumberPoolActorextendsActor"></a><a id="NumberPoolActor:NumberPoolActor"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/NumberPoolActor.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">class</span></span> <span class="symbol"><a href="NumberPoolActor.html" title="An Actor that wraps around a NumberPool and regulates access to it. Wrapping around the pool like this forces a FIFO order to requests for numbers from the pool."><span class="name">NumberPoolActor</span></a><span class="result"> extends <span name="akka.actor.Actor" class="extype">Actor</span></span></span><p class="shortcomment cmt">An <code>Actor</code> that wraps around a <code>NumberPool</code> and regulates access to it.<br>
|
|
<br>
|
|
Wrapping around the pool like this forces a FIFO order to requests for numbers from the pool.</p><div class="fullcomment"><div class="comment cmt"><p>An <code>Actor</code> that wraps around a <code>NumberPool</code> and regulates access to it.<br>
|
|
<br>
|
|
Wrapping around the pool like this forces a FIFO order to requests for numbers from the pool.
|
|
This synchronization only lasts as long as this <code>Actor</code> is the only one for the given pool.
|
|
In the distribution of globally unique identifiers, this is extremely important.
|
|
<code>NumberPool</code>s are used as the primary determination of whether a number is available at any given moment.
|
|
The categorization of the pool is also important, though for a contextually-sensitive reason.</p></div></div></li><li class="indented0 " name="net.psforever.objects.guid.actor.Register" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="RegisterextendsProductwithSerializable"></a><a id="Register:Register"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/Register.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier">final </span> <span class="kind">case class</span></span> <span class="symbol"><a href="Register.html" title="A message for accepting object-number registration requests. The callback is actually an ActorRef to which a RegisterSuccess message or a RegisterFailure message is sent."><span class="name">Register</span></a><span class="params">(<span name="obj">obj: <a href="../../entity/IdentifiableEntity.html" name="net.psforever.objects.entity.IdentifiableEntity" id="net.psforever.objects.entity.IdentifiableEntity" class="extype">IdentifiableEntity</a></span>, <span name="name">name: <span name="scala.Option" class="extype">Option</span>[<span name="scala.Predef.String" class="extype">String</span>]</span>, <span name="number">number: <span name="scala.Option" class="extype">Option</span>[<span name="scala.Int" class="extype">Int</span>]</span>, <span name="callback">callback: <span name="scala.Option" class="extype">Option</span>[<span name="akka.actor.ActorRef" class="extype">ActorRef</span>]</span>)</span><span class="result"> extends <span name="scala.Product" class="extype">Product</span> with <span name="scala.Serializable" class="extype">Serializable</span></span></span><p class="shortcomment cmt">A message for accepting object-number registration requests.<br>
|
|
<br>
|
|
The callback is actually an <code>ActorRef</code> to which a <code>RegisterSuccess</code> message or a <code>RegisterFailure</code> message is sent.</p><div class="fullcomment"><div class="comment cmt"><p>A message for accepting object-number registration requests.<br>
|
|
<br>
|
|
The callback is actually an <code>ActorRef</code> to which a <code>RegisterSuccess</code> message or a <code>RegisterFailure</code> message is sent.
|
|
This is as opposed to what a "callback" is normally - a function.</p></div><dl class="paramcmts block"><dt class="param">obj</dt><dd class="cmt"><p>the mandatory object</p></dd><dt class="param">name</dt><dd class="cmt"><p>the optional name of the number pool to which this object is registered</p></dd><dt class="param">number</dt><dd class="cmt"><p>the optional number pre-selected for registering this object</p></dd><dt class="param">callback</dt><dd class="cmt"><p>the optional custom callback for the messages from the success or failure conditions</p></dd></dl></div></li><li class="indented0 " name="net.psforever.objects.guid.actor.UniqueNumberSystem" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="UniqueNumberSystemextendsActor"></a><a id="UniqueNumberSystem:UniqueNumberSystem"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/UniqueNumberSystem.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">class</span></span> <span class="symbol"><a href="UniqueNumberSystem.html" title="An Actor that wraps around converted NumberPools and synchronizes a portion of the number registration process."><span class="name">UniqueNumberSystem</span></a><span class="result"> extends <span name="akka.actor.Actor" class="extype">Actor</span></span></span><p class="shortcomment cmt">An <code>Actor</code> that wraps around converted <code>NumberPool</code>s and synchronizes a portion of the number registration process.</p><div class="fullcomment"><div class="comment cmt"><p>An <code>Actor</code> that wraps around converted <code>NumberPool</code>s and synchronizes a portion of the number registration process.
|
|
The ultimate goal is to manage a coherent group of unique identifiers for a given "region" (<code>Zone</code>).
|
|
Both parts of the UID system sit atop the <code>Zone</code> for easy external access.
|
|
The plain part - the <code>NumberPoolHub</code> here - is used for low-priority requests such as checking for existing associations.
|
|
This <code>Actor</code> is the involved portion that paces registration and unregistration.<br>
|
|
<br>
|
|
A four part process is used for object registration tasks.
|
|
First, the requested <code>NumberPool</code> is located among the list of known <code>NumberPool</code>s.
|
|
Second, an asynchronous request is sent to that pool to retrieve a number.
|
|
(Only any number. Only a failing case allows for selection of a specific number.)
|
|
Third, the asynchronous request returns and the original information about the request is recovered.
|
|
Fourth, both sides of the contract are completed by the object being assigned the number and
|
|
the underlying "number source" is made to remember an association between the object and the number.
|
|
Short circuits and recoveries as available on all steps though reporting is split between logging and callbacks.
|
|
The process of removing the association between a number and object (unregistering) is a similar four part process.<br>
|
|
<br>
|
|
The important relationship between this <code>Actor</code> and the <code>Map</code> of <code>NumberPoolActors</code> is an "gate."
|
|
A single <code>Map</code> is constructed and shared between multiple entry points to the UID system where requests are messaged.
|
|
Multiple entry points send messages to the same <code>NumberPool</code>.
|
|
That <code>NumberPool</code> deals with the messages one at a time and sends reply to each entry point that communicated with it.
|
|
This process is almost as fast as the process of the <code>NumberPool</code> selecting a number.
|
|
(At least, both should be fast.)</p></div></div></li><li class="indented0 " name="net.psforever.objects.guid.actor.Unregister" group="Ungrouped" fullComment="yes" data-isabs="false" visbl="pub"><a id="UnregisterextendsProductwithSerializable"></a><a id="Unregister:Unregister"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/Unregister.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier">final </span> <span class="kind">case class</span></span> <span class="symbol"><a href="Unregister.html" title="A message for accepting object-number unregistration requests."><span class="name">Unregister</span></a><span class="params">(<span name="obj">obj: <a href="../../entity/IdentifiableEntity.html" name="net.psforever.objects.entity.IdentifiableEntity" id="net.psforever.objects.entity.IdentifiableEntity" class="extype">IdentifiableEntity</a></span>, <span name="callback">callback: <span name="scala.Option" class="extype">Option</span>[<span name="akka.actor.ActorRef" class="extype">ActorRef</span>] = <span class="symbol">None</span></span>)</span><span class="result"> extends <span name="scala.Product" class="extype">Product</span> with <span name="scala.Serializable" class="extype">Serializable</span></span></span><p class="shortcomment cmt">A message for accepting object-number unregistration requests.</p><div class="fullcomment"><div class="comment cmt"><p>A message for accepting object-number unregistration requests.
|
|
When given to a number pool (<code>NumberPoolAccessorActor</code>), that <code>Actor</code> assumes itself to have the object.
|
|
When given to a hub object (<code>NumberPoolHubActor</code>), it will attempt to determine which pool currently has the object.<br>
|
|
<br>
|
|
The callback is actually an <code>ActorRef</code> to which a <code>RegisterSuccess</code> message or a <code>RegisterFailure</code> message is sent.
|
|
This is as opposed to what a "callback" is normally - a function.</p></div><dl class="paramcmts block"><dt class="param">obj</dt><dd class="cmt"><p>the mandatory object</p></dd><dt class="param">callback</dt><dd class="cmt"><p>the optional custom callback for the messages from the success or failure conditions</p></dd></dl></div></li></ol></div><div class="values members"><h3>Value Members</h3><ol><li class="indented0 " name="net.psforever.objects.guid.actor.NumberPoolActor" group="Ungrouped" fullComment="no" data-isabs="false" visbl="pub"><a id="NumberPoolActor"></a><a id="NumberPoolActor:NumberPoolActor"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/NumberPoolActor$.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">object</span></span> <span class="symbol"><a href="NumberPoolActor$.html" title=""><span class="name">NumberPoolActor</span></a></span></li><li class="indented0 " name="net.psforever.objects.guid.actor.Register" group="Ungrouped" fullComment="no" data-isabs="false" visbl="pub"><a id="Register"></a><a id="Register:Register"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/Register$.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">object</span></span> <span class="symbol"><a href="Register$.html" title=""><span class="name">Register</span></a><span class="result"> extends <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html#java.io.Serializable" name="java.io.Serializable" id="java.io.Serializable" class="extype">Serializable</a></span></span></li><li class="indented0 " name="net.psforever.objects.guid.actor.UniqueNumberSystem" group="Ungrouped" fullComment="no" data-isabs="false" visbl="pub"><a id="UniqueNumberSystem"></a><a id="UniqueNumberSystem:UniqueNumberSystem"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/UniqueNumberSystem$.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">object</span></span> <span class="symbol"><a href="UniqueNumberSystem$.html" title=""><span class="name">UniqueNumberSystem</span></a></span></li><li class="indented0 " name="net.psforever.objects.guid.actor.Unregister" group="Ungrouped" fullComment="no" data-isabs="false" visbl="pub"><a id="Unregister"></a><a id="Unregister:Unregister"></a> <span class="permalink"><a href="../../../../../net/psforever/objects/guid/actor/Unregister$.html" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier"></span> <span class="kind">object</span></span> <span class="symbol"><a href="Unregister$.html" title=""><span class="name">Unregister</span></a><span class="result"> extends <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html#java.io.Serializable" name="java.io.Serializable" id="java.io.Serializable" class="extype">Serializable</a></span></span></li></ol></div></div><div id="inheritedMembers"></div><div id="groupedMembers"><div name="Ungrouped" class="group"><h3>Ungrouped</h3></div></div></div><div id="tooltip"></div><div id="footer"></div></body></div></div></div></body></html>
|