インタフェース Overlay<D extends Destination,K extends Destination>
- 型パラメータ:
D- The destination specification of the overlay.K- The key of the overlay.
- すべてのスーパーインタフェース:
AutoCloseable,Closeable,RequestTransport<D>,Transport<D>
- 既知の実装クラスのリスト:
OverlayImpl
public interface Overlay<D extends Destination,K extends Destination> extends RequestTransport<D>
-
ネストされたクラスの概要
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 static Option.StringOptionDEFAULT_ENDPOINTstatic Option.StringOptionDEFAULT_SEED -
メソッドの概要
修飾子とタイプ メソッド 説明 booleanaddKey(K key)booleanaddKey(ObjectId upper, K key)指定されたkeyをオーバレイに登録する。CompletableFuture<Boolean>addKeyAsync(K key)CompletableFuture<Boolean>addKeyAsync(ObjectId upper, K key)指定されたkeyをオーバレイに非同期に登録する。Class<?>getAvailableKeyType()Set<K>getKeys()Set<K>getKeys(ObjectId upper)OverlayListener<D,K>getListener(ObjectId upper)Return the registered TransportListener.booleanisJoined()overlayの状態(join/leave)を返す。booleanjoin()booleanjoin(String seedSpec)booleanjoin(Collection<? extends Endpoint> seeds)引数で指定されたseedのリストをseedピアとして、Overlayをjoinする。booleanjoin(Endpoint seed)booleanleave()Overlayを不活性化(leave)する。booleanremoveKey(K key)booleanremoveKey(ObjectId upper, K key)指定されたkeyをオーバレイから登録削除する。CompletableFuture<Boolean>removeKeyAsync(K key)CompletableFuture<Boolean>removeKeyAsync(ObjectId upper, K key)指定されたkeyをオーバレイから非同期に登録削除する。FutureQueue<?>request(String dstExp, Object msg)FutureQueue<?>request(String dstExp, Object msg, int timeout)FutureQueue<?>request(String dstExp, Object msg, TransOptions opts)FutureQueue<?>request(ObjectId appId, String dstExp, Object msg)FutureQueue<?>request(ObjectId appId, String dstExp, Object msg, TransOptions opts)FutureQueue<?>request(ObjectId sender, ObjectId receiver, String dstExp, Object msg)FutureQueue<?>request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, int timeout)FutureQueue<?>request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, TransOptions opts)FutureQueue<?>request(TransportId upperTrans, String dstExp, Object msg, int timeout)default voidrequestAsync(String appIdStr, D dst, String msg, BiConsumer<Object,Exception> responseReceiver)default voidrequestAsync(String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver)default voidrequestAsync(String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver, TransOptions opts)default voidrequestAsync(ObjectId appId, String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver)default voidrequestAsync(ObjectId appId, String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver, TransOptions opts)voidrequestAsync(ObjectId sender, ObjectId receiver, String dstExp, Object msg, BiConsumer<Object,Exception> resultsReceiver, TransOptions opts)voidsend(String dstExp, Object msg)voidsend(ObjectId appId, String dstExp, Object msg)voidsend(ObjectId sender, ObjectId receiver, String dstExp, Object msg)voidsend(TransportId upperTrans, String dstExp, Object msg)voidsetListener(ObjectId upper, OverlayListener<D,K> listener)インタフェースから継承されたメソッド org.piax.gtrans.RequestTransport
request, request, request, request, request, request, request, request, request, request, request, requestAsync, requestAsync, requestAsync, requestAsync, requestAsync, requestAsync, requestAsync, singletonFutureQueue, singletonFutureQueueインタフェースから継承されたメソッド org.piax.gtrans.Transport
close, fin, getBaseTransport, getEndpoint, getListener, getLowerTransport, getLowerTransports, getMTU, getPeer, getPeerId, getTransportId, getTransportIdPath, hasStableLocator, isUp, send, send, send, send, send, send, send, send, sendAsync, sendAsync, sendAsync, sendAsync, sendAsync, sendAsync, setListener, setListener
-
フィールド詳細
-
メソッドの詳細
-
setListener
-
getListener
インタフェースからコピーされた説明:TransportReturn the registered TransportListener.upperis an ObjectId specified by the setListener. If TransportListener is not registered,nullis returned.- 定義:
getListenerインタフェース内Transport<D extends Destination>- パラメータ:
upper- The ObjectId of the receiver (upper layer) entity.- 戻り値:
- The TransportListener registered.
-
getAvailableKeyType
Class<?> getAvailableKeyType() -
send
void send(ObjectId sender, ObjectId receiver, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
send
void send(TransportId upperTrans, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
send
void send(ObjectId appId, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
send
void send(String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, int timeout) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(ObjectId appId, String dstExp, Object msg, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(ObjectId appId, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(String dstExp, Object msg, int timeout) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(String dstExp, Object msg, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
FutureQueue<?> request(TransportId upperTrans, String dstExp, Object msg, int timeout) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
requestAsync
void requestAsync(ObjectId sender, ObjectId receiver, String dstExp, Object msg, BiConsumer<Object,Exception> resultsReceiver, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
requestAsync
default void requestAsync(ObjectId appId, String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
requestAsync
default void requestAsync(ObjectId appId, String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
requestAsync
default void requestAsync(String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
requestAsync
default void requestAsync(String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
requestAsync
-
addKey
指定されたkeyをオーバレイに登録する。同一key が複数回登録できるかどうかはオーバーレイによる。 オーバーレイが同一keyの複数回登録を許していない場合、登録は失敗しfalseが返る。
null を key として登録することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、IOExceptionのサブクラスとなる例外が発生する。
- パラメータ:
upper- このオーバーレイを利用するエンティティのObjectIdkey- オーバレイに登録するkey- 戻り値:
- 登録に成功した場合 true
- 例外:
IOException- 実装クラス特有の例外が発生した場合IllegalArgumentException- keyに nullが指定された場合ClassCastException- 引数が適切な型でない場合UnsupportedOperationException- オーバレイがこのメソッドをサポートしていない場合
-
addKey
- 例外:
IOException
-
addKeyAsync
指定されたkeyをオーバレイに非同期に登録する。CompletableFugure内に返値としてBooleanを返す。 その値は登録成功でtrue、失敗でfalseである。 同一keyが複数回登録できるかどうかはオーバーレイによる。 オーバーレイが同一keyの複数回登録を許していない場合、登録は失敗しfalseが返る。
null を key として登録することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、CompletableFuture にIOExceptionのサブクラスとなる例外が帰る。
- パラメータ:
upper- このオーバーレイを利用するエンティティのObjectIdkey- オーバレイに登録するkey- 戻り値:
- 登録用のCompletionStageを表すCompletableFuture
- 例外:
IllegalArgumentException- keyに nullが指定された場合ClassCastException- 引数が適切な型でない場合UnsupportedOperationException- オーバレイがこのメソッドをサポートしていない場合
-
addKeyAsync
- 例外:
IOException
-
removeKey
指定されたkeyをオーバレイから登録削除する。key がオーバレイに登録されていない場合は、falseが返る。 同一key が複数回登録される場合は、 addKey された回数と同じ回数だけremoveKeyが呼ばれないとkeyは削除されない。
null を key として指定することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、IOExceptionのサブクラスとなる例外が発生する。
- パラメータ:
upper- このオーバーレイを利用するエンティティのObjectIdkey- オーバレイから登録削除するkey- 戻り値:
- 登録削除に成功した場合 true
- 例外:
IOException- 実装クラス特有の例外が発生した場合IllegalArgumentException- keyに nullが指定された場合ClassCastException- 引数が適切な型でない場合UnsupportedOperationException- オーバレイがこのメソッドをサポートしていない場合
-
removeKey
- 例外:
IOException
-
removeKeyAsync
指定されたkeyをオーバレイから非同期に登録削除する。CompletableFugure内に返値としてBooleanを返す。 その値は、keyの削除に成功した場合にtrue、失敗した場合はfalseである。 同一key が複数回登録される場合は、 addKey された回数と同じ回数だけremoveKeyAsyncが呼ばれないとkeyは削除されない。
null を key として指定することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、CompletableFuture にIOExceptionのサブクラスとなる例外が帰る。
- パラメータ:
upper- このオーバーレイを利用するエンティティのObjectIdkey- オーバレイから登録削除するkey- 戻り値:
- 登録削除用のCompletionStageを表すCompletableFuture
- 例外:
IllegalArgumentException- keyに nullが指定された場合ClassCastException- 引数が適切な型でない場合UnsupportedOperationException- オーバレイがこのメソッドをサポートしていない場合
-
removeKeyAsync
-
getKeys
-
getKeys
-
join
- 例外:
IOException
-
join
- 例外:
IOException
-
join
- 例外:
IOException
-
join
引数で指定されたseedのリストをseedピアとして、Overlayをjoinする。Overlayがすでにjoinな状態の場合は、joinは実行されずに、falseが返る。
- パラメータ:
seeds- seedピアのリスト- 戻り値:
- すでにjoinされていた場合false
- 例外:
IOException- join時に例外が発生した時
-
leave
Overlayを不活性化(leave)する。 不活性化により、自ピアはオーバレイネットワークから離脱する。- 戻り値:
- すでにleaveされていた場合false
- 例外:
IOException- I/Oエラーが発生した場合
-
isJoined
boolean isJoined()overlayの状態(join/leave)を返す。- 戻り値:
- overlayの状態。joinedの場合はtrue
-