index int64 | repo_id string | file_path string | content string |
|---|---|---|---|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/ValueLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.lane;
import swim.api.warp.WarpLane;
import swim.api.warp.function.DidCommand;
import swim.api.warp.function.DidEnter;
import swim.api.warp.function.DidLeave;
import swim.api.warp.function.DidUplink;
import swim.api.warp.function.WillCommand;
import swim.api.warp.function.WillEnter;
import swim.api.warp.function.WillLeave;
import swim.api.warp.function.WillUplink;
import swim.observable.ObservableValue;
import swim.observable.function.DidSet;
import swim.observable.function.WillSet;
import swim.streamlet.Inlet;
import swim.streamlet.Outlet;
import swim.structure.Form;
public interface ValueLane<V> extends WarpLane, ObservableValue<V>, Inlet<V>, Outlet<V> {
Form<V> valueForm();
<V2> ValueLane<V2> valueForm(Form<V2> valueForm);
<V2> ValueLane<V2> valueClass(Class<V2> valueClass);
boolean isResident();
ValueLane<V> isResident(boolean isResident);
boolean isTransient();
ValueLane<V> isTransient(boolean isTransient);
@Override
ValueLane<V> observe(Object observer);
@Override
ValueLane<V> unobserve(Object observer);
@Override
ValueLane<V> willSet(WillSet<V> willSet);
@Override
ValueLane<V> didSet(DidSet<V> didSet);
@Override
ValueLane<V> willCommand(WillCommand willCommand);
@Override
ValueLane<V> didCommand(DidCommand didCommand);
@Override
ValueLane<V> willUplink(WillUplink willUplink);
@Override
ValueLane<V> didUplink(DidUplink didUplink);
@Override
ValueLane<V> willEnter(WillEnter willEnter);
@Override
ValueLane<V> didEnter(DidEnter didEnter);
@Override
ValueLane<V> willLeave(WillLeave willLeave);
@Override
ValueLane<V> didLeave(DidLeave didLeave);
@Override
V get();
@Override
V set(V newValue);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Lane runtime interface.
*/
package swim.api.lane;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/function/DidDownlinkMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.lane.function;
import swim.api.downlink.MapDownlink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface DidDownlinkMap<L> extends Preemptive {
void didDownlink(L key, MapDownlink<?, ?> downlink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/function/DidDownlinkValue.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.lane.function;
import swim.api.downlink.ValueDownlink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface DidDownlinkValue<K> extends Preemptive {
void didDownlink(K key, ValueDownlink<?> downlink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/function/OnCue.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.lane.function;
import swim.api.warp.WarpUplink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface OnCue<V> extends Preemptive {
V onCue(WarpUplink uplink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/function/OnCueKey.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.lane.function;
import swim.api.warp.WarpUplink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface OnCueKey<K, V> extends Preemptive {
V onCue(K key, WarpUplink uplink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/function/OnSyncMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.lane.function;
import java.util.Iterator;
import java.util.Map;
import swim.api.warp.WarpUplink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface OnSyncMap<K, V> extends Preemptive {
Iterator<Map.Entry<K, V>> onSync(WarpUplink uplink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/function/WillDownlinkMap.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.lane.function;
import swim.api.downlink.MapDownlink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillDownlinkMap<L> extends Preemptive {
MapDownlink<?, ?> willDownlink(L key, MapDownlink<?, ?> downlink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/function/WillDownlinkValue.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.lane.function;
import swim.api.downlink.ValueDownlink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillDownlinkValue<K> extends Preemptive {
ValueDownlink<?> willDownlink(K key, ValueDownlink<?> downlink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane | java-sources/ai/swim/swim-api/3.10.0/swim/api/lane/function/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Lane lifecycle callback function interfaces.
*/
package swim.api.lane.function;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/plane/AbstractPlane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.plane;
import swim.api.SwimContext;
import swim.api.agent.Agent;
import swim.api.agent.AgentFactory;
import swim.api.agent.AgentRoute;
import swim.api.downlink.EventDownlink;
import swim.api.downlink.ListDownlink;
import swim.api.downlink.MapDownlink;
import swim.api.downlink.ValueDownlink;
import swim.api.http.HttpDownlink;
import swim.api.ref.HostRef;
import swim.api.ref.LaneRef;
import swim.api.ref.NodeRef;
import swim.api.ref.SwimRef;
import swim.api.ws.WsDownlink;
import swim.concurrent.Schedule;
import swim.concurrent.Stage;
import swim.structure.Value;
import swim.uri.Uri;
import swim.uri.UriPattern;
import swim.util.Log;
public class AbstractPlane implements Plane, SwimRef, Log {
protected final PlaneContext context;
public AbstractPlane(PlaneContext context) {
this.context = context;
}
public AbstractPlane() {
this(SwimContext.getPlaneContext());
}
@Override
public PlaneContext planeContext() {
return this.context;
}
public Schedule schedule() {
return this.context.schedule();
}
public Stage stage() {
return this.context.stage();
}
public <A extends Agent> AgentRoute<A> createAgentRoute(Class<? extends A> agentClass) {
return this.context.createAgentRoute(agentClass);
}
public <A extends Agent> AgentRoute<A> getAgentRoute(String routeName) {
return this.context.getAgentRoute(routeName);
}
public void addAgentRoute(String routeName, UriPattern pattern, AgentRoute<?> agentRoute) {
this.context.addAgentRoute(routeName, pattern, agentRoute);
}
public void addAgentRoute(String routeName, String pattern, AgentRoute<?> agentRoute) {
this.context.addAgentRoute(routeName, pattern, agentRoute);
}
public void removeAgentRoute(String routeName) {
this.context.removeAgentRoute(routeName);
}
public AgentFactory<?> getAgentFactory(Uri nodeUri) {
return this.context.getAgentFactory(nodeUri);
}
@Override
public EventDownlink<Value> downlink() {
return this.context.downlink();
}
@Override
public ListDownlink<Value> downlinkList() {
return this.context.downlinkList();
}
@Override
public MapDownlink<Value, Value> downlinkMap() {
return this.context.downlinkMap();
}
@Override
public ValueDownlink<Value> downlinkValue() {
return this.context.downlinkValue();
}
@Override
public <V> HttpDownlink<V> downlinkHttp() {
return this.context.downlinkHttp();
}
@Override
public <I, O> WsDownlink<I, O> downlinkWs() {
return this.context.downlinkWs();
}
@Override
public HostRef hostRef(Uri hostUri) {
return this.context.hostRef(hostUri);
}
@Override
public HostRef hostRef(String hostUri) {
return this.context.hostRef(hostUri);
}
@Override
public NodeRef nodeRef(Uri hostUri, Uri nodeUri) {
return this.context.nodeRef(hostUri, nodeUri);
}
@Override
public NodeRef nodeRef(String hostUri, String nodeUri) {
return this.context.nodeRef(hostUri, nodeUri);
}
@Override
public NodeRef nodeRef(Uri nodeUri) {
return this.context.nodeRef(nodeUri);
}
@Override
public NodeRef nodeRef(String nodeUri) {
return this.context.nodeRef(nodeUri);
}
@Override
public LaneRef laneRef(Uri hostUri, Uri nodeUri, Uri laneUri) {
return this.context.laneRef(hostUri, nodeUri, laneUri);
}
@Override
public LaneRef laneRef(String hostUri, String nodeUri, String laneUri) {
return this.context.laneRef(hostUri, nodeUri, laneUri);
}
@Override
public LaneRef laneRef(Uri nodeUri, Uri laneUri) {
return this.context.laneRef(nodeUri, laneUri);
}
@Override
public LaneRef laneRef(String nodeUri, String laneUri) {
return this.context.laneRef(nodeUri, laneUri);
}
@Override
public void command(Uri hostUri, Uri nodeUri, Uri laneUri, float prio, Value body) {
this.context.command(hostUri, nodeUri, laneUri, prio, body);
}
@Override
public void command(String hostUri, String nodeUri, String laneUri, float prio, Value body) {
this.context.command(hostUri, nodeUri, laneUri, prio, body);
}
@Override
public void command(Uri hostUri, Uri nodeUri, Uri laneUri, Value body) {
this.context.command(hostUri, nodeUri, laneUri, body);
}
@Override
public void command(String hostUri, String nodeUri, String laneUri, Value body) {
this.context.command(hostUri, nodeUri, laneUri, body);
}
@Override
public void command(Uri nodeUri, Uri laneUri, float prio, Value body) {
this.context.command(nodeUri, laneUri, prio, body);
}
@Override
public void command(String nodeUri, String laneUri, float prio, Value body) {
this.context.command(nodeUri, laneUri, prio, body);
}
@Override
public void command(Uri nodeUri, Uri laneUri, Value body) {
this.context.command(nodeUri, laneUri, body);
}
@Override
public void command(String nodeUri, String laneUri, Value body) {
this.context.command(nodeUri, laneUri, body);
}
@Override
public void trace(Object message) {
this.context.trace(message);
}
@Override
public void debug(Object message) {
this.context.debug(message);
}
@Override
public void info(Object message) {
this.context.info(message);
}
@Override
public void warn(Object message) {
this.context.warn(message);
}
@Override
public void error(Object message) {
this.context.error(message);
}
public void close() {
this.context.close();
}
@Override
public void willStart() {
// hook
}
@Override
public void didStart() {
// hook
}
@Override
public void willStop() {
// hook
}
@Override
public void didStop() {
// hook
}
@Override
public void willClose() {
// hook
}
@Override
public void didClose() {
// hook
}
@Override
public void didFail(Throwable error) {
// hook
}
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/plane/Plane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.plane;
public interface Plane {
PlaneContext planeContext();
void willStart();
void didStart();
void willStop();
void didStop();
void willClose();
void didClose();
void didFail(Throwable error);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/plane/PlaneContext.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.plane;
import swim.api.agent.Agent;
import swim.api.agent.AgentFactory;
import swim.api.agent.AgentRoute;
import swim.api.auth.Authenticator;
import swim.api.policy.PlanePolicy;
import swim.api.ref.SwimRef;
import swim.concurrent.Schedule;
import swim.concurrent.Stage;
import swim.uri.Uri;
import swim.uri.UriPattern;
import swim.util.Log;
public interface PlaneContext extends SwimRef, Log {
Schedule schedule();
Stage stage();
PlanePolicy policy();
void setPolicy(PlanePolicy policy);
Authenticator getAuthenticator(String authenticatorName);
void addAuthenticator(String authenticatorName, Authenticator authenticator);
<A extends Agent> AgentRoute<A> createAgentRoute(Class<? extends A> agentClass);
<A extends Agent> AgentRoute<A> getAgentRoute(String routeName);
void addAgentRoute(String routeName, UriPattern pattern, AgentRoute<?> agentRoute);
void addAgentRoute(String routeName, String pattern, AgentRoute<?> agentRoute);
void removeAgentRoute(String routeName);
AgentFactory<?> getAgentFactory(Uri nodeUri);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/plane/PlaneDef.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.plane;
public interface PlaneDef {
String planeName();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/plane/PlaneException.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.plane;
public class PlaneException extends RuntimeException {
private static final long serialVersionUID = 1L;
public PlaneException(String message, Throwable cause) {
super(message, cause);
}
public PlaneException(String message) {
super(message);
}
public PlaneException(Throwable cause) {
super(cause);
}
public PlaneException() {
super();
}
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/plane/PlaneFactory.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.plane;
public interface PlaneFactory<P extends Plane> {
P createPlane(PlaneContext context);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/plane/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Plane runtime interface.
*/
package swim.api.plane;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/AbstractPolicy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
import swim.api.Downlink;
import swim.api.Lane;
import swim.api.Uplink;
import swim.api.agent.Agent;
import swim.api.agent.AgentRoute;
import swim.api.auth.Identity;
import swim.http.HttpMessage;
import swim.http.HttpRequest;
import swim.http.HttpResponse;
import swim.uri.Uri;
import swim.warp.CommandMessage;
import swim.warp.Envelope;
import swim.warp.EventMessage;
import swim.warp.LinkRequest;
import swim.warp.SyncRequest;
public class AbstractPolicy implements Policy, PlanePolicy, AgentRoutePolicy, AgentPolicy, LanePolicy, UplinkPolicy, DownlinkPolicy {
@Override
public AgentRoutePolicy agentRoutePolicy(AgentRoute<?> agentRoute) {
return this;
}
@Override
public AgentPolicy agentPolicy(Agent agent) {
return this;
}
@Override
public LanePolicy lanePolicy(Lane lane) {
return this;
}
@Override
public UplinkPolicy uplinkPolicy(Uplink uplink) {
return this;
}
@Override
public DownlinkPolicy downlinkPolicy(Downlink downlink) {
return this;
}
@Override
public PolicyDirective<Object> canConnect(Uri requestUri) {
return allow();
}
@Override
public PolicyDirective<LinkRequest> canLink(LinkRequest request, Identity identity) {
return authorize(request, identity);
}
@Override
public PolicyDirective<SyncRequest> canSync(SyncRequest request, Identity identity) {
return authorize(request, identity);
}
@Override
public PolicyDirective<EventMessage> canUplink(EventMessage message, Identity identity) {
return authorize(message, identity);
}
@Override
public PolicyDirective<CommandMessage> canDownlink(CommandMessage message, Identity identity) {
return authorize(message, identity);
}
@Override
public PolicyDirective<HttpMessage<?>> canRequest(HttpRequest<?> request) {
return allow();
}
@Override
public PolicyDirective<HttpResponse<?>> canRespond(HttpRequest<?> request, HttpResponse<?> response) {
return allow();
}
protected <T> PolicyDirective<T> authorize(Envelope envelope, Identity identity) {
return allow();
}
public <T> PolicyDirective<T> allow(T value) {
return PolicyDirective.allow(value);
}
public <T> PolicyDirective<T> allow() {
return PolicyDirective.allow();
}
public <T> PolicyDirective<T> deny(Object reason) {
return PolicyDirective.deny(this, reason);
}
public <T> PolicyDirective<T> deny() {
return PolicyDirective.deny(this);
}
public <T> PolicyDirective<T> forbid(Object reason) {
return PolicyDirective.forbid(this, reason);
}
public <T> PolicyDirective<T> forbid() {
return PolicyDirective.forbid(this);
}
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/AgentPolicy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
import swim.api.Downlink;
import swim.api.Lane;
public interface AgentPolicy extends Policy {
LanePolicy lanePolicy(Lane lane);
DownlinkPolicy downlinkPolicy(Downlink downlink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/AgentRoutePolicy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
import swim.api.Downlink;
import swim.api.agent.Agent;
public interface AgentRoutePolicy extends Policy {
AgentPolicy agentPolicy(Agent agent);
DownlinkPolicy downlinkPolicy(Downlink downlink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/DownlinkPolicy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
public interface DownlinkPolicy extends Policy {
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/HttpPolicy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
import swim.http.HttpMessage;
import swim.http.HttpRequest;
import swim.http.HttpResponse;
public interface HttpPolicy {
PolicyDirective<HttpMessage<?>> canRequest(HttpRequest<?> request);
PolicyDirective<HttpResponse<?>> canRespond(HttpRequest<?> request, HttpResponse<?> response);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/LanePolicy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
import swim.api.Uplink;
public interface LanePolicy extends Policy {
UplinkPolicy uplinkPolicy(Uplink uplink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/PlanePolicy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
import swim.api.Downlink;
import swim.api.agent.AgentRoute;
import swim.uri.Uri;
public interface PlanePolicy extends Policy {
AgentRoutePolicy agentRoutePolicy(AgentRoute<?> agentRoute);
DownlinkPolicy downlinkPolicy(Downlink downlink);
PolicyDirective<Object> canConnect(Uri requestUri);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/Policy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
import swim.api.auth.Identity;
import swim.http.HttpMessage;
import swim.http.HttpRequest;
import swim.http.HttpResponse;
import swim.warp.CommandMessage;
import swim.warp.EventMessage;
import swim.warp.LinkRequest;
import swim.warp.SyncRequest;
public interface Policy extends HttpPolicy {
PolicyDirective<LinkRequest> canLink(LinkRequest request, Identity identity);
PolicyDirective<SyncRequest> canSync(SyncRequest request, Identity identity);
PolicyDirective<EventMessage> canUplink(EventMessage message, Identity identity);
PolicyDirective<CommandMessage> canDownlink(CommandMessage message, Identity identity);
PolicyDirective<HttpMessage<?>> canRequest(HttpRequest<?> request);
PolicyDirective<HttpResponse<?>> canRespond(HttpRequest<?> request, HttpResponse<?> response);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/PolicyDirective.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
import swim.codec.Debug;
import swim.codec.Format;
import swim.codec.Output;
import swim.util.Murmur3;
public abstract class PolicyDirective<T> implements Debug {
PolicyDirective() { }
public boolean isAllowed() {
return false;
}
public boolean isDenied() {
return false;
}
public boolean isForbidden() {
return false;
}
public boolean isDefined() {
return false;
}
public T get() {
throw null;
}
public Policy policy() {
return null;
}
public Object reason() {
return null;
}
private static Allow<Object> allow;
private static Allow<Object> staticAllow() {
if (allow == null) {
allow = new Allow<>(null);
}
return allow;
}
@SuppressWarnings("unchecked")
public static <T> PolicyDirective<T> allow(T value) {
if (value != null) {
return new Allow<T>(value);
} else {
return (Allow<T>) staticAllow();
}
}
@SuppressWarnings("unchecked")
public static <T> PolicyDirective<T> allow() {
return (PolicyDirective<T>) staticAllow();
}
public static <T> PolicyDirective<T> deny(Policy policy, Object reason) {
return new Deny<T>(policy, reason);
}
public static <T> PolicyDirective<T> deny(Policy policy) {
return new Deny<T>(policy, null);
}
public static <T> PolicyDirective<T> deny(Object reason) {
return new Deny<T>(null, reason);
}
public static <T> PolicyDirective<T> deny() {
return new Deny<T>(null, null);
}
public static <T> PolicyDirective<T> forbid(Policy policy, Object reason) {
return new Forbid<T>(policy, reason);
}
public static <T> PolicyDirective<T> forbid(Policy policy) {
return new Forbid<T>(policy, null);
}
public static <T> PolicyDirective<T> forbid(Object reason) {
return new Forbid<T>(null, reason);
}
public static <T> PolicyDirective<T> forbid() {
return new Forbid<T>(null, null);
}
static final class Allow<T> extends PolicyDirective<T> {
final T value;
Allow(T value) {
this.value = value;
}
@Override
public boolean isAllowed() {
return true;
}
@Override
public boolean isDefined() {
return value != null;
}
@Override
public T get() {
return value;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else if (other instanceof Allow<?>) {
final Allow<?> that = (Allow<?>) other;
return value == null ? that.value == null : value.equals(that.value);
} else {
return false;
}
}
@Override
public int hashCode() {
if (hashSeed == 0) {
hashSeed = Murmur3.seed(Allow.class);
}
return Murmur3.mash(Murmur3.mix(hashSeed, Murmur3.hash(value)));
}
private static int hashSeed;
@Override
public void debug(Output<?> output) {
output = output.write("PolicyDirective").write('.').write("allow")
.write('(');
if (value != null) {
output = output.debug(value);
}
output = output.write(')');
}
@Override
public String toString() {
return Format.debug(this);
}
}
static final class Deny<T> extends PolicyDirective<T> {
final Policy policy;
final Object reason;
Deny(Policy policy, Object reason) {
this.policy = policy;
this.reason = reason;
}
@Override
public boolean isDenied() {
return true;
}
@Override
public Policy policy() {
return policy;
}
@Override
public Object reason() {
return reason;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else if (other instanceof Deny<?>) {
final Deny<?> that = (Deny<?>) other;
return (policy == null ? that.policy == null : policy.equals(that.policy))
&& (reason == null ? that.reason == null : reason.equals(that.reason));
} else {
return false;
}
}
@Override
public int hashCode() {
if (hashSeed == 0) {
hashSeed = Murmur3.seed(Deny.class);
}
return Murmur3.mash(Murmur3.mix(Murmur3.mix(hashSeed,
Murmur3.hash(policy)), Murmur3.hash(reason)));
}
private static int hashSeed;
@Override
public void debug(Output<?> output) {
output = output.write("PolicyDirective").write('.')
.write("deny").write('(').debug(policy);
if (reason != null) {
output = output.write(", ").debug(reason);
}
output = output.write(')');
}
@Override
public String toString() {
return Format.debug(this);
}
}
static final class Forbid<T> extends PolicyDirective<T> {
final Policy policy;
final Object reason;
Forbid(Policy policy, Object reason) {
this.policy = policy;
this.reason = reason;
}
@Override
public boolean isForbidden() {
return true;
}
@Override
public Policy policy() {
return policy;
}
@Override
public Object reason() {
return reason;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else if (other instanceof Forbid<?>) {
final Forbid<?> that = (Forbid<?>) other;
return (policy == null ? that.policy == null : policy.equals(that.policy))
&& (reason == null ? that.reason == null : reason.equals(that.reason));
} else {
return false;
}
}
@Override
public int hashCode() {
if (hashSeed == 0) {
hashSeed = Murmur3.seed(Forbid.class);
}
return Murmur3.mash(Murmur3.mix(Murmur3.mix(hashSeed,
Murmur3.hash(policy)), Murmur3.hash(reason)));
}
private static int hashSeed;
@Override
public void debug(Output<?> output) {
output = output.write("PolicyDirective").write('.').write("forbid")
.write('(').debug(policy);
if (reason != null) {
output = output.write(", ").debug(reason);
}
output = output.write(')');
}
@Override
public String toString() {
return Format.debug(this);
}
}
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/UplinkPolicy.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.policy;
public interface UplinkPolicy extends Policy {
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/policy/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Security policy runtime interface.
*/
package swim.api.policy;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ref/HostRef.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ref;
import swim.api.downlink.DownlinkFactory;
import swim.structure.Value;
import swim.uri.Uri;
public interface HostRef extends DownlinkFactory {
Uri hostUri();
NodeRef nodeRef(Uri nodeUri);
NodeRef nodeRef(String nodeUri);
LaneRef laneRef(Uri nodeUri, Uri laneUri);
LaneRef laneRef(String nodeUri, String laneUri);
void command(Uri nodeUri, Uri laneUri, float prio, Value body);
void command(String nodeUri, String laneUri, float prio, Value body);
void command(Uri nodeUri, Uri laneUri, Value body);
void command(String nodeUri, String laneUri, Value body);
void close();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ref/LaneRef.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ref;
import swim.api.downlink.DownlinkFactory;
import swim.structure.Value;
import swim.uri.Uri;
public interface LaneRef extends DownlinkFactory {
Uri hostUri();
Uri nodeUri();
Uri laneUri();
void command(float prio, Value body);
void command(Value body);
void close();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ref/NodeRef.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ref;
import swim.api.downlink.DownlinkFactory;
import swim.structure.Value;
import swim.uri.Uri;
public interface NodeRef extends DownlinkFactory {
Uri hostUri();
Uri nodeUri();
LaneRef laneRef(Uri laneUri);
LaneRef laneRef(String laneUri);
void command(Uri laneUri, float prio, Value body);
void command(String laneUri, float prio, Value body);
void command(Uri laneUri, Value body);
void command(String laneUri, Value body);
void close();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ref/SwimRef.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ref;
import swim.api.downlink.DownlinkFactory;
import swim.structure.Value;
import swim.uri.Uri;
public interface SwimRef extends DownlinkFactory {
HostRef hostRef(Uri hostUri);
HostRef hostRef(String hostUri);
NodeRef nodeRef(Uri hostUri, Uri nodeUri);
NodeRef nodeRef(String hostUri, String nodeUri);
NodeRef nodeRef(Uri nodeUri);
NodeRef nodeRef(String nodeUri);
LaneRef laneRef(Uri hostUri, Uri nodeUri, Uri laneUri);
LaneRef laneRef(String hostUri, String nodeUri, String laneUri);
LaneRef laneRef(Uri nodeUri, Uri laneUri);
LaneRef laneRef(String nodeUri, String laneUri);
void command(Uri hostUri, Uri nodeUri, Uri laneUri, float prio, Value body);
void command(String hostUri, String nodeUri, String laneUri, float prio, Value body);
void command(Uri hostUri, Uri nodeUri, Uri laneUri, Value body);
void command(String hostUri, String nodeUri, String laneUri, Value body);
void command(Uri nodeUri, Uri laneUri, float prio, Value body);
void command(String nodeUri, String laneUri, float prio, Value body);
void command(Uri nodeUri, Uri laneUri, Value body);
void command(String nodeUri, String laneUri, Value body);
void close();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ref/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Linkable, partially resolved references to hosts, nodes, and lanes.
*/
package swim.api.ref;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/service/AbstractService.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.service;
import java.net.InetSocketAddress;
import swim.api.SwimContext;
import swim.concurrent.Schedule;
import swim.concurrent.Stage;
import swim.io.IpInterface;
import swim.io.IpService;
import swim.io.IpServiceRef;
import swim.io.IpSettings;
import swim.io.IpSocket;
import swim.io.IpSocketRef;
import swim.util.Log;
public class AbstractService implements Service, IpInterface, Log {
protected final ServiceContext context;
public AbstractService(ServiceContext context) {
this.context = context;
}
public AbstractService() {
this(SwimContext.getServiceContext());
}
@Override
public ServiceContext serviceContext() {
return this.context;
}
public Schedule schedule() {
return this.context.schedule();
}
public Stage stage() {
return this.context.stage();
}
@Override
public IpSettings ipSettings() {
return this.context.ipSettings();
}
@Override
public IpServiceRef bindTcp(InetSocketAddress localAddress, IpService service, IpSettings ipSettings) {
return this.context.bindTcp(localAddress, service, ipSettings);
}
@Override
public IpServiceRef bindTls(InetSocketAddress localAddress, IpService service, IpSettings ipSettings) {
return this.context.bindTls(localAddress, service, ipSettings);
}
@Override
public IpSocketRef connectTcp(InetSocketAddress remoteAddress, IpSocket socket, IpSettings ipSettings) {
return this.context.connectTcp(remoteAddress, socket, ipSettings);
}
@Override
public IpSocketRef connectTls(InetSocketAddress remoteAddress, IpSocket socket, IpSettings ipSettings) {
return this.context.connectTls(remoteAddress, socket, ipSettings);
}
@Override
public void trace(Object message) {
this.context.trace(message);
}
@Override
public void debug(Object message) {
this.context.debug(message);
}
@Override
public void info(Object message) {
this.context.info(message);
}
@Override
public void warn(Object message) {
this.context.warn(message);
}
@Override
public void error(Object message) {
this.context.error(message);
}
public void close() {
this.context.close();
}
@Override
public void willStart() {
// hook
}
@Override
public void didStart() {
// hook
}
@Override
public void willStop() {
// hook
}
@Override
public void didStop() {
// hook
}
@Override
public void willClose() {
// hook
}
@Override
public void didClose() {
// hook
}
@Override
public void didFail(Throwable error) {
// hook
}
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/service/Service.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.service;
public interface Service {
ServiceContext serviceContext();
void willStart();
void didStart();
void willStop();
void didStop();
void willClose();
void didClose();
void didFail(Throwable error);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/service/ServiceContext.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.service;
import swim.concurrent.Schedule;
import swim.concurrent.Stage;
import swim.io.IpInterface;
import swim.util.Log;
public interface ServiceContext extends IpInterface, Log {
Schedule schedule();
Stage stage();
void close();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/service/ServiceDef.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.service;
public interface ServiceDef {
String serviceName();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/service/ServiceException.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.service;
public class ServiceException extends RuntimeException {
private static final long serialVersionUID = 1L;
public ServiceException(String message, Throwable cause) {
super(message, cause);
}
public ServiceException(String message) {
super(message);
}
public ServiceException(Throwable cause) {
super(cause);
}
public ServiceException() {
super();
}
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/service/ServiceFactory.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.service;
public interface ServiceFactory<S extends Service> {
S createService(ServiceContext context);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/service/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Network service runtime interface.
*/
package swim.api.service;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/space/Space.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.space;
import java.util.Collection;
import swim.api.plane.Plane;
import swim.api.plane.PlaneFactory;
import swim.api.policy.PlanePolicy;
import swim.api.ref.SwimRef;
import swim.concurrent.Schedule;
import swim.concurrent.Stage;
import swim.util.Log;
public interface Space extends SwimRef, Log {
Schedule schedule();
Stage stage();
PlanePolicy policy();
<P extends Plane> P openPlane(String planeName, PlaneFactory<P> planeFactory);
<P extends Plane> P openPlane(String planeName, Class<? extends P> planeClass);
Plane getPlane(String planeName);
<P extends Plane> P getPlane(Class<? extends P> planeClass);
Collection<? extends Plane> planes();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/space/SpaceDef.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.space;
import java.util.Collection;
import swim.api.plane.PlaneDef;
public interface SpaceDef {
String spaceName();
Collection<? extends PlaneDef> planeDefs();
PlaneDef getPlaneDef(String planeName);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/space/SpaceException.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.space;
public class SpaceException extends RuntimeException {
private static final long serialVersionUID = 1L;
public SpaceException(String message, Throwable cause) {
super(message, cause);
}
public SpaceException(String message) {
super(message);
}
public SpaceException(Throwable cause) {
super(cause);
}
public SpaceException() {
super();
}
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/space/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Space runtime interface.
*/
package swim.api.space;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/store/Store.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.store;
import swim.api.data.ListData;
import swim.api.data.MapData;
import swim.api.data.SpatialData;
import swim.api.data.ValueData;
import swim.math.R2Shape;
import swim.math.Z2Form;
import swim.structure.Value;
public interface Store {
ListData<Value> listData(Value name);
ListData<Value> listData(String name);
MapData<Value, Value> mapData(Value name);
MapData<Value, Value> mapData(String name);
<S> SpatialData<Value, S, Value> spatialData(Value name, Z2Form<S> shapeForm);
<S> SpatialData<Value, S, Value> spatialData(String name, Z2Form<S> shapeForm);
SpatialData<Value, R2Shape, Value> geospatialData(Value name);
SpatialData<Value, R2Shape, Value> geospatialData(String name);
ValueData<Value> valueData(Value name);
ValueData<Value> valueData(String name);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/store/StoreException.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.store;
public class StoreException extends RuntimeException {
private static final long serialVersionUID = 1L;
public StoreException(String message, Throwable cause) {
super(message, cause);
}
public StoreException(String message) {
super(message);
}
public StoreException(Throwable cause) {
super(cause);
}
public StoreException() {
super();
}
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/store/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Storage runtime interface.
*/
package swim.api.store;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/WarpDownlink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp;
import swim.api.Downlink;
import swim.api.function.DidClose;
import swim.api.function.DidConnect;
import swim.api.function.DidDisconnect;
import swim.api.function.DidFail;
import swim.api.warp.function.DidLink;
import swim.api.warp.function.DidReceive;
import swim.api.warp.function.DidSync;
import swim.api.warp.function.DidUnlink;
import swim.api.warp.function.WillCommand;
import swim.api.warp.function.WillLink;
import swim.api.warp.function.WillReceive;
import swim.api.warp.function.WillSync;
import swim.api.warp.function.WillUnlink;
import swim.structure.Value;
import swim.uri.Uri;
public interface WarpDownlink extends Downlink, WarpLink {
WarpDownlink hostUri(Uri hostUri);
WarpDownlink hostUri(String hostUri);
WarpDownlink nodeUri(Uri nodeUri);
WarpDownlink nodeUri(String nodeUri);
WarpDownlink laneUri(Uri laneUri);
WarpDownlink laneUri(String laneUri);
float prio();
WarpDownlink prio(float prio);
float rate();
WarpDownlink rate(float rate);
Value body();
WarpDownlink body(Value body);
boolean keepLinked();
WarpDownlink keepLinked(boolean keepLinked);
boolean keepSynced();
WarpDownlink keepSynced(boolean keepSynced);
@Override
WarpDownlink observe(Object observer);
@Override
WarpDownlink unobserve(Object observer);
WarpDownlink willReceive(WillReceive willReceive);
WarpDownlink didReceive(DidReceive didReceive);
WarpDownlink willCommand(WillCommand willCommand);
WarpDownlink willLink(WillLink willLink);
WarpDownlink didLink(DidLink didLink);
WarpDownlink willSync(WillSync willSync);
WarpDownlink didSync(DidSync didSync);
WarpDownlink willUnlink(WillUnlink willUnlink);
WarpDownlink didUnlink(DidUnlink didUnlink);
@Override
WarpDownlink didConnect(DidConnect didConnect);
@Override
WarpDownlink didDisconnect(DidDisconnect didDisconnect);
@Override
WarpDownlink didClose(DidClose didClose);
@Override
WarpDownlink didFail(DidFail didFail);
@Override
WarpDownlink open();
void command(float prio, Value body);
void command(Value body);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/WarpLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp;
import swim.api.Lane;
import swim.api.warp.function.DidCommand;
import swim.api.warp.function.DidEnter;
import swim.api.warp.function.DidLeave;
import swim.api.warp.function.DidUplink;
import swim.api.warp.function.WillCommand;
import swim.api.warp.function.WillEnter;
import swim.api.warp.function.WillLeave;
import swim.api.warp.function.WillUplink;
public interface WarpLane extends Lane {
@Override
WarpLane observe(Object observer);
@Override
WarpLane unobserve(Object observer);
WarpLane willCommand(WillCommand willCommand);
WarpLane didCommand(DidCommand willCommand);
WarpLane willUplink(WillUplink willUplink);
WarpLane didUplink(DidUplink didUplink);
WarpLane willEnter(WillEnter willEnter);
WarpLane didEnter(DidEnter didEnter);
WarpLane willLeave(WillLeave willLeave);
WarpLane didLeave(DidLeave didLeave);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/WarpLink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp;
import swim.api.Link;
public interface WarpLink extends Link {
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/WarpUplink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp;
import swim.api.Uplink;
import swim.api.function.DidClose;
import swim.api.warp.function.OnCommandMessage;
import swim.api.warp.function.OnEventMessage;
import swim.api.warp.function.OnLinkRequest;
import swim.api.warp.function.OnLinkedResponse;
import swim.api.warp.function.OnSyncRequest;
import swim.api.warp.function.OnSyncedResponse;
import swim.api.warp.function.OnUnlinkRequest;
import swim.api.warp.function.OnUnlinkedResponse;
import swim.structure.Value;
public interface WarpUplink extends Uplink, WarpLink {
float prio();
float rate();
Value body();
@Override
WarpUplink observe(Object observer);
@Override
WarpUplink unobserve(Object observer);
WarpUplink onEvent(OnEventMessage onEvent);
WarpUplink onCommand(OnCommandMessage onCommand);
WarpUplink onLink(OnLinkRequest onLink);
WarpUplink onLinked(OnLinkedResponse onLinked);
WarpUplink onSync(OnSyncRequest onSync);
WarpUplink onSynced(OnSyncedResponse onSynced);
WarpUplink onUnlink(OnUnlinkRequest onUnlink);
WarpUplink onUnlinked(OnUnlinkedResponse onUnlinked);
WarpUplink didClose(DidClose didClose);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* WARP lane and downlink interfaces.
*/
package swim.api.warp;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/DidCommand.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.structure.Value;
@FunctionalInterface
public interface DidCommand extends Preemptive {
void didCommand(Value body);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/DidEnter.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.api.auth.Identity;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface DidEnter extends Preemptive {
void didEnter(Identity identity);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/DidLeave.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.api.auth.Identity;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface DidLeave extends Preemptive {
void didLeave(Identity identity);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/DidLink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface DidLink extends Preemptive {
void didLink();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/DidReceive.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.structure.Value;
@FunctionalInterface
public interface DidReceive extends Preemptive {
void didReceive(Value body);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/DidSync.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface DidSync extends Preemptive {
void didSync();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/DidUnlink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface DidUnlink extends Preemptive {
void didUnlink();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/DidUplink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.api.warp.WarpUplink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface DidUplink extends Preemptive {
void didUplink(WarpUplink uplink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnCommand.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface OnCommand<V> extends Preemptive {
void onCommand(V value);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnCommandMessage.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.warp.CommandMessage;
@FunctionalInterface
public interface OnCommandMessage extends Preemptive {
void onCommand(CommandMessage message);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnEvent.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface OnEvent<V> extends Preemptive {
void onEvent(V value);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnEventMessage.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.warp.EventMessage;
@FunctionalInterface
public interface OnEventMessage extends Preemptive {
void onEvent(EventMessage message);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnLinkRequest.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.warp.LinkRequest;
@FunctionalInterface
public interface OnLinkRequest extends Preemptive {
void onLink(LinkRequest request);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnLinkedResponse.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.warp.LinkedResponse;
@FunctionalInterface
public interface OnLinkedResponse extends Preemptive {
void onLinked(LinkedResponse response);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnSyncRequest.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.warp.SyncRequest;
@FunctionalInterface
public interface OnSyncRequest extends Preemptive {
void onSync(SyncRequest request);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnSyncedResponse.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.warp.SyncedResponse;
@FunctionalInterface
public interface OnSyncedResponse extends Preemptive {
void onSynced(SyncedResponse response);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnUnlinkRequest.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.warp.UnlinkRequest;
@FunctionalInterface
public interface OnUnlinkRequest extends Preemptive {
void onUnlink(UnlinkRequest request);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/OnUnlinkedResponse.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.warp.UnlinkedResponse;
@FunctionalInterface
public interface OnUnlinkedResponse extends Preemptive {
void onUnlinked(UnlinkedResponse response);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/WillCommand.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.structure.Value;
@FunctionalInterface
public interface WillCommand extends Preemptive {
void willCommand(Value body);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/WillEnter.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.api.auth.Identity;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillEnter extends Preemptive {
void willEnter(Identity identity);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/WillLeave.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.api.auth.Identity;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillLeave extends Preemptive {
void willLeave(Identity identity);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/WillLink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillLink extends Preemptive {
void willLink();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/WillReceive.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
import swim.structure.Value;
@FunctionalInterface
public interface WillReceive extends Preemptive {
void willReceive(Value body);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/WillSync.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillSync extends Preemptive {
void willSync();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/WillUnlink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillUnlink extends Preemptive {
void willUnlink();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/WillUplink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.warp.function;
import swim.api.warp.WarpUplink;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillUplink extends Preemptive {
void willUplink(WarpUplink uplink);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp | java-sources/ai/swim/swim-api/3.10.0/swim/api/warp/function/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* WARP lane and downlink callback function interfaces.
*/
package swim.api.warp.function;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/WsDownlink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws;
import swim.api.Downlink;
import swim.api.function.DidClose;
import swim.api.function.DidConnect;
import swim.api.function.DidDisconnect;
import swim.api.function.DidFail;
import swim.api.ws.function.DidReadFrameWs;
import swim.api.ws.function.DidUpgradeWs;
import swim.api.ws.function.DidWriteFrameWs;
import swim.api.ws.function.DoUpgradeWs;
import swim.api.ws.function.WillReadFrameWs;
import swim.api.ws.function.WillUpgradeWs;
import swim.api.ws.function.WillWriteFrameWs;
import swim.uri.Uri;
import swim.ws.WsControl;
import swim.ws.WsData;
public interface WsDownlink<I, O> extends Downlink, WsLink {
WsDownlink<I, O> requestUri(Uri requestUri);
@Override
WsDownlink<I, O> observe(Object observer);
@Override
WsDownlink<I, O> unobserve(Object observer);
WsDownlink<I, O> willUpgrade(WillUpgradeWs willUpgrade);
WsDownlink<I, O> doUpgrade(DoUpgradeWs doUpgrade);
WsDownlink<I, O> didUpgrade(DidUpgradeWs didUpgrade);
WsDownlink<I, O> willReadFrame(WillReadFrameWs<I> willReadFrame);
WsDownlink<I, O> didReadFrame(DidReadFrameWs<I> didReadFrame);
WsDownlink<I, O> willWriteFrame(WillWriteFrameWs<O> willWriteFrame);
WsDownlink<I, O> didWriteFrame(DidWriteFrameWs<O> didWriteFrame);
@Override
WsDownlink<I, O> didConnect(DidConnect didConnect);
@Override
WsDownlink<I, O> didDisconnect(DidDisconnect didDisconnect);
@Override
WsDownlink<I, O> didClose(DidClose didClose);
@Override
WsDownlink<I, O> didFail(DidFail didFail);
@Override
WsDownlink<I, O> open();
<O2 extends O> void write(WsData<O2> frame);
<O2 extends O> void write(WsControl<?, O2> frame);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/WsLane.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws;
import swim.api.Lane;
import swim.api.ws.function.DidReadFrameWs;
import swim.api.ws.function.DidUpgradeWs;
import swim.api.ws.function.DidWriteFrameWs;
import swim.api.ws.function.DoUpgradeWs;
import swim.api.ws.function.WillReadFrameWs;
import swim.api.ws.function.WillUpgradeWs;
import swim.api.ws.function.WillWriteFrameWs;
import swim.ws.WsControl;
import swim.ws.WsData;
public interface WsLane<I, O> extends Lane {
@Override
WsLane<I, O> observe(Object observer);
@Override
WsLane<I, O> unobserve(Object observer);
WsLane<I, O> willUpgrade(WillUpgradeWs willUpgrade);
WsLane<I, O> doUpgrade(DoUpgradeWs doUpgrade);
WsLane<I, O> didUpgrade(DidUpgradeWs didUpgrade);
WsLane<I, O> willReadFrame(WillReadFrameWs<I> willReadFrame);
WsLane<I, O> didReadFrame(DidReadFrameWs<I> didReadFrame);
WsLane<I, O> willWriteFrame(WillWriteFrameWs<O> willWriteFrame);
WsLane<I, O> didWriteFrame(DidWriteFrameWs<O> didWriteFrame);
<O2 extends O> void write(WsData<O2> frame);
<O2 extends O> void write(WsControl<?, O2> frame);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/WsLink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws;
import swim.api.Link;
import swim.uri.Uri;
public interface WsLink extends Link {
Uri requestUri();
@Override
WsLink observe(Object observer);
@Override
WsLink unobserve(Object observer);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/WsUplink.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws;
import swim.api.Uplink;
import swim.ws.WsRequest;
public interface WsUplink extends Uplink, WsLink {
WsRequest request();
@Override
WsUplink observe(Object observer);
@Override
WsUplink unobserve(Object observer);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* WebSocket lanes and downlinks.
*/
package swim.api.ws;
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/function/DidReadFrameWs.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws.function;
import swim.concurrent.Preemptive;
import swim.ws.WsFrame;
@FunctionalInterface
public interface DidReadFrameWs<I> extends Preemptive {
void didReadFrame(WsFrame<? extends I> frame);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/function/DidUpgradeWs.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws.function;
import swim.concurrent.Preemptive;
import swim.ws.WsResponse;
@FunctionalInterface
public interface DidUpgradeWs extends Preemptive {
void didUpgrade(WsResponse response);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/function/DidWriteFrameWs.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws.function;
import swim.concurrent.Preemptive;
import swim.ws.WsFrame;
@FunctionalInterface
public interface DidWriteFrameWs<O> extends Preemptive {
void didWriteFrame(WsFrame<? extends O> frame);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/function/DoUpgradeWs.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws.function;
import swim.concurrent.Preemptive;
import swim.ws.WsRequest;
import swim.ws.WsResponse;
@FunctionalInterface
public interface DoUpgradeWs extends Preemptive {
WsResponse doUpgrade(WsRequest request);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/function/WillReadFrameWs.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws.function;
import swim.codec.Decoder;
import swim.concurrent.Preemptive;
@FunctionalInterface
public interface WillReadFrameWs<I> extends Preemptive {
Decoder<I> willReadFrame();
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/function/WillUpgradeWs.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws.function;
import swim.concurrent.Preemptive;
import swim.ws.WsRequest;
@FunctionalInterface
public interface WillUpgradeWs extends Preemptive {
void willUpgrade(WsRequest request);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/function/WillWriteFrameWs.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.api.ws.function;
import swim.concurrent.Preemptive;
import swim.ws.WsFrame;
@FunctionalInterface
public interface WillWriteFrameWs<O> extends Preemptive {
void willWriteFrame(WsFrame<? extends O> frame);
}
|
0 | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws | java-sources/ai/swim/swim-api/3.10.0/swim/api/ws/function/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* WebSocket lane and downlink callback function interfaces.
*/
package swim.api.ws.function;
|
0 | java-sources/ai/swim/swim-args | java-sources/ai/swim/swim-args/3.10.0/module-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Command-line argument parser.
*/
module swim.args {
requires swim.util;
requires transitive swim.codec;
requires transitive swim.collections;
exports swim.args;
}
|
0 | java-sources/ai/swim/swim-args/3.10.0/swim | java-sources/ai/swim/swim-args/3.10.0/swim/args/Arg.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.args;
import swim.codec.Debug;
import swim.codec.Format;
import swim.codec.Output;
import swim.util.Murmur3;
public class Arg implements Cloneable, Debug {
final String name;
String value;
boolean optional;
public Arg(String name, String value, boolean optional) {
this.name = name;
this.value = value;
this.optional = optional;
}
public String name() {
return this.name;
}
public String value() {
return this.value;
}
public Arg value(String value) {
this.value = value;
return this;
}
public boolean optional() {
return this.optional;
}
public Arg optional(boolean optional) {
this.optional = optional;
return this;
}
public boolean canEqual(Object other) {
return other instanceof Arg;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else if (other instanceof Arg) {
final Arg that = (Arg) other;
return that.canEqual(this) && this.name.equals(that.name)
&& (this.value == null ? that.value == null : this.value.equals(that.value))
&& this.optional == that.optional;
}
return false;
}
@Override
public int hashCode() {
if (hashSeed == 0) {
hashSeed = Murmur3.seed(Arg.class);
}
return Murmur3.mash(Murmur3.mix(Murmur3.mix(Murmur3.mix(hashSeed,
this.name.hashCode()), Murmur3.hash(this.value)), Murmur3.hash(this.optional)));
}
@Override
public void debug(Output<?> output) {
output = output.write("Arg").write('.').write("of").write('(').debug(this.name);
if (this.value != null) {
output = output.write(", ").debug(this.value);
}
output = output.write(')');
if (this.optional) {
output = output.write('.').write("optional").write('(').write("true").write(')');
}
}
@Override
public String toString() {
return Format.debug(this);
}
@Override
public Arg clone() {
return new Arg(this.name, this.value, this.optional);
}
private static int hashSeed;
public static Arg of(String name, String value, boolean optional) {
return new Arg(name, value, optional);
}
public static Arg of(String name, String value) {
return new Arg(name, value, false);
}
public static Arg of(String name) {
return new Arg(name, null, false);
}
}
|
0 | java-sources/ai/swim/swim-args/3.10.0/swim | java-sources/ai/swim/swim-args/3.10.0/swim/args/Cmd.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.args;
import swim.codec.Debug;
import swim.codec.Format;
import swim.codec.Output;
import swim.codec.Unicode;
import swim.collections.FingerTrieSeq;
import swim.util.Murmur3;
public class Cmd implements Cloneable, Debug {
final String id;
final String name;
String desc;
FingerTrieSeq<Opt> opts;
FingerTrieSeq<Cmd> cmds;
ExecCmd exec;
Cmd base;
public Cmd(String id, String name, String desc, FingerTrieSeq<Opt> opts,
FingerTrieSeq<Cmd> cmds, ExecCmd exec, Cmd base) {
this.id = id;
this.name = name;
this.desc = desc;
this.opts = opts;
this.cmds = cmds;
this.exec = exec;
this.base = base;
}
public Cmd base() {
return this.base;
}
public String id() {
return this.id;
}
public String name() {
return this.name;
}
public String desc() {
return this.desc;
}
public Cmd desc(String desc) {
this.desc = desc;
return this;
}
public FingerTrieSeq<Opt> opts() {
return this.opts;
}
public Cmd opt(Opt opt) {
this.opts = this.opts.appended(opt);
return this;
}
public Cmd opt(String opt) {
return opt(Opt.of(opt));
}
public FingerTrieSeq<Cmd> cmds() {
return this.cmds;
}
public Cmd cmd(Cmd cmd) {
this.cmds = this.cmds.appended(cmd);
return this;
}
public Cmd cmd(String cmd) {
return cmd(Cmd.of(cmd));
}
public Opt getOpt(String name) {
for (int i = 0, n = this.opts.size(); i < n; i += 1) {
final Opt opt = this.opts.get(i);
if (name.equals(opt.name)) {
return opt;
}
}
throw new IllegalArgumentException("undefined opt: " + name);
}
public Cmd parse(String[] params) {
return parse(params, 1);
}
public Cmd parse(String[] params, int paramIndex) {
final int paramCount = params.length;
final int optCount = this.opts.size();
final int cmdCount = this.cmds.size();
while (paramIndex < paramCount) {
final String param = params[paramIndex];
for (int cmdIndex = 0; cmdIndex < cmdCount; cmdIndex += 1) {
final Cmd cmd = this.cmds.get(cmdIndex);
if (param.equals(cmd.name)) {
final Cmd subCmd = cmd;
subCmd.base = this;
return subCmd.parse(params, paramIndex + 1);
}
}
paramIndex += 1;
final int argLength = param.length();
if (argLength > 2 && param.charAt(0) == '-' && param.charAt(1) == '-') {
final String name = param.substring(2);
for (int optIndex = 0; optIndex < optCount; optIndex += 1) {
final Opt opt = this.opts.get(optIndex);
if (name.equals(opt.name)) {
opt.defs += 1;
paramIndex = opt.parse(params, paramIndex);
}
}
} else if (argLength > 1 && param.charAt(0) == '-') {
for (int flagIndex = 1; flagIndex < argLength; flagIndex += 1) {
final char flag = param.charAt(flagIndex);
for (int optIndex = 0; optIndex < optCount; optIndex += 1) {
final Opt opt = this.opts.get(optIndex);
if (flag == opt.flag) {
opt.defs += 1;
if (argLength == 2) {
paramIndex = opt.parse(params, paramIndex);
}
}
}
}
}
}
return this;
}
public ExecCmd exec() {
return this.exec;
}
public Cmd exec(ExecCmd exec) {
this.exec = exec;
return this;
}
public void run() {
if (this.exec != null) {
this.exec.exec(this);
}
}
public Cmd helpCmd() {
return this.cmd(Cmd.help());
}
public void writeFullName(Output<String> output) {
if (this.base != null) {
this.base.writeFullName(output);
output.write(' ');
}
output.write(this.name);
}
public void writeHelp(Output<String> output) {
output.write("Usage: ");
this.writeFullName(output);
final int optCount = this.opts.size();
if (optCount != 0) {
output.write(" [options]");
}
final int cmdCount = this.cmds.size();
if (cmdCount != 0) {
output.write(" <command>");
}
output.writeln();
if (optCount != 0) {
output.writeln();
output.writeln("Options:");
for (int optIndex = 0; optIndex < optCount; optIndex += 1) {
final Opt opt = this.opts.get(optIndex);
if (opt.flag != 0) {
output.write(" -").write(opt.flag).write(", --").write(opt.name);
} else {
output.write(" --").write(opt.name);
}
int optLength = opt.name.length();
final int argCount = opt.args.size();
for (int argIndex = 0; argIndex < argCount; argIndex += 1) {
final Arg arg = opt.args.get(argIndex);
output.write(' ').write('<').write(arg.name).write('>');
optLength += 2 + arg.name.length() + 1;
if (arg.optional) {
output.write('?');
optLength += 1;
}
}
for (int i = optLength; i < 15; i += 1) {
output.write(' ');
}
if (opt.desc != null) {
output.write(' ').write(opt.desc);
}
output.writeln();
}
}
if (cmdCount != 0) {
output.writeln();
output.writeln("Commands:");
for (int cmdIndex = 0; cmdIndex < cmdCount; cmdIndex += 1) {
final Cmd cmd = this.cmds.get(cmdIndex);
output.write(" ").write(cmd.name);
for (int i = cmd.name.length(); i < 20; i += 1) {
output.write(' ');
}
if (cmd.desc != null) {
output.write(" ").write(cmd.desc);
}
output.writeln();
}
}
}
public String toHelp() {
final Output<String> output = Unicode.stringOutput();
this.writeHelp(output);
return output.bind();
}
public boolean canEqual(Object other) {
return other instanceof Cmd;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else if (other instanceof Cmd) {
final Cmd that = (Cmd) other;
return that.canEqual(this) && this.id.equals(that.id) && this.name.equals(that.name)
&& (this.desc == null ? that.desc == null : this.desc.equals(that.desc))
&& this.opts.equals(that.opts) && this.cmds.equals(that.cmds)
&& (this.exec == null ? that.exec == null : this.exec.equals(that.exec));
}
return false;
}
@Override
public int hashCode() {
if (hashSeed == 0) {
hashSeed = Murmur3.seed(Cmd.class);
}
return Murmur3.mash(Murmur3.mix(Murmur3.mix(Murmur3.mix(Murmur3.mix(Murmur3.mix(Murmur3.mix(
hashSeed, this.id.hashCode()), this.name.hashCode()), Murmur3.hash(this.desc)),
opts.hashCode()), cmds.hashCode()), Murmur3.hash(this.exec)));
}
@Override
public void debug(Output<?> output) {
output = output.write("Cmd").write('.').write("of").write('(').debug(this.name).write(')');
if (this.desc != null) {
output = output.write('.').write("flag").write('(').debug(this.desc).write(')');
}
final int optCount = this.opts.size();
for (int optIndex = 0; optIndex < optCount; optIndex += 1) {
final Opt opt = this.opts.get(optIndex);
output = output.write('.').write("opt").write('(').debug(opt).write(')');
}
final int cmdCount = this.cmds.size();
for (int cmdIndex = 0; cmdIndex < cmdCount; cmdIndex += 1) {
final Cmd cmd = this.cmds.get(cmdIndex);
output = output.write('.').write("cmd").write('(').debug(cmd).write(')');
}
if (this.exec != null) {
output = output.write('.').write("exec").write('(').debug(this.exec).write(')');
}
if (this.base != null) {
output = output.write('.').write("base").write('(').debug(this.base).write(')');
}
}
@Override
public String toString() {
return Format.debug(this);
}
@Override
public Cmd clone() {
final int optCount = this.opts.size();
FingerTrieSeq<Opt> opts = FingerTrieSeq.empty();
for (int i = 0; i < optCount; i += 1) {
opts = opts.appended(this.opts.get(i).clone());
}
final int cmdCount = this.cmds.size();
FingerTrieSeq<Cmd> cmds = FingerTrieSeq.empty();
for (int i = 0; i < cmdCount; i += 1) {
cmds = cmds.appended(this.cmds.get(i).clone());
}
return new Cmd(this.id, this.name, this.desc, opts, cmds, this.exec, this.base);
}
private static int hashSeed;
public static Cmd of(String id, String name) {
return new Cmd(id, name, null, FingerTrieSeq.empty(), FingerTrieSeq.empty(), null, null);
}
public static Cmd of(String id) {
return new Cmd(id, id, null, FingerTrieSeq.empty(), FingerTrieSeq.empty(), null, null);
}
public static Cmd help() {
return new Cmd("help", "help", null, FingerTrieSeq.empty(), FingerTrieSeq.empty(), new ExecHelpCmd(), null);
}
}
final class ExecHelpCmd implements ExecCmd {
@Override
public void exec(Cmd cmd) {
if (cmd.base != null) {
System.out.println(cmd.base.toHelp());
}
}
}
|
0 | java-sources/ai/swim/swim-args/3.10.0/swim | java-sources/ai/swim/swim-args/3.10.0/swim/args/ExecCmd.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.args;
public interface ExecCmd {
void exec(Cmd cmd);
}
|
0 | java-sources/ai/swim/swim-args/3.10.0/swim | java-sources/ai/swim/swim-args/3.10.0/swim/args/Opt.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.args;
import swim.codec.Debug;
import swim.codec.Format;
import swim.codec.Output;
import swim.collections.FingerTrieSeq;
import swim.util.Murmur3;
public class Opt implements Cloneable, Debug {
final String name;
char flag;
String desc;
FingerTrieSeq<Arg> args;
int defs;
public Opt(String name, char flag, String desc, FingerTrieSeq<Arg> args, int defs) {
this.name = name;
this.flag = flag;
this.desc = desc;
this.args = args;
this.defs = defs;
}
public String name() {
return this.name;
}
public char flag() {
return this.flag;
}
public Opt flag(char flag) {
this.flag = flag;
return this;
}
public String desc() {
return this.desc;
}
public Opt desc(String desc) {
this.desc = desc;
return this;
}
public FingerTrieSeq<Arg> args() {
return this.args;
}
public Opt arg(Arg arg) {
this.args = this.args.appended(arg);
return this;
}
public Opt arg(String arg) {
return arg(Arg.of(arg));
}
public int defs() {
return this.defs;
}
public boolean isDefined() {
return this.defs != 0;
}
public Arg getArg() {
return getArg(0);
}
public Arg getArg(int index) {
return this.args.get(index);
}
public String getValue() {
return getValue(0);
}
public String getValue(int index) {
final Arg arg = this.args.get(index);
return arg != null ? arg.value() : null;
}
public int parse(String[] params, int paramIndex) {
final int argCount = this.args.size();
final int paramCount = params.length;
for (int argIndex = 0; argIndex < argCount && paramIndex < paramCount; argIndex += 1) {
final Arg arg = this.args.get(argIndex);
final String param = params[paramIndex];
if (!arg.optional || param.charAt(0) != '-') {
arg.value(param);
paramIndex += 1;
} else {
break;
}
}
return paramIndex;
}
public boolean canEqual(Object other) {
return other instanceof Opt;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else if (other instanceof Opt) {
final Opt that = (Opt) other;
return that.canEqual(this) && this.name.equals(that.name) && this.flag == that.flag
&& (this.desc == null ? that.desc == null : this.desc.equals(that.desc))
&& this.args.equals(that.args) && this.defs == that.defs;
}
return false;
}
@Override
public int hashCode() {
if (hashSeed == 0) {
hashSeed = Murmur3.seed(Opt.class);
}
return Murmur3.mash(Murmur3.mix(Murmur3.mix(Murmur3.mix(Murmur3.mix(Murmur3.mix(hashSeed,
this.name.hashCode()), this.flag), Murmur3.hash(this.desc)), this.args.hashCode()), this.defs));
}
@Override
public void debug(Output<?> output) {
output = output.write("Opt").write('.').write("of").write('(').debug(this.name).write(')');
if (this.flag != 0) {
output = output.write('.').write("flag").write('(').debug(this.flag).write(')');
}
if (this.desc != null) {
output = output.write('.').write("desc").write('(').debug(this.desc).write(')');
}
final int argCount = this.args.size();
for (int argIndex = 0; argIndex < argCount; argIndex += 1) {
final Arg arg = this.args.get(argIndex);
output = output.write('.').write("arg").write('(').debug(arg).write(')');
}
}
@Override
public String toString() {
return Format.debug(this);
}
@Override
public Opt clone() {
final int argCount = this.args.size();
FingerTrieSeq<Arg> args = FingerTrieSeq.empty();
for (int i = 0; i < argCount; i += 1) {
args = args.appended(this.args.get(i).clone());
}
return new Opt(this.name, this.flag, this.desc, args, this.defs);
}
private static int hashSeed;
public static Opt of(String name, char flag) {
return new Opt(name, flag, null, FingerTrieSeq.empty(), 0);
}
public static Opt of(String name) {
return new Opt(name, '\0', null, FingerTrieSeq.empty(), 0);
}
}
|
0 | java-sources/ai/swim/swim-args/3.10.0/swim | java-sources/ai/swim/swim-args/3.10.0/swim/args/package-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Command-line argument parser.
*/
package swim.args;
|
0 | java-sources/ai/swim/swim-auth | java-sources/ai/swim/swim-auth/3.10.0/module-info.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* Swim authenticator runtime.
*/
module swim.auth {
requires transitive swim.security;
requires transitive swim.io.http;
requires transitive swim.kernel;
exports swim.auth;
provides swim.kernel.Kernel with swim.auth.AuthenticatorKernel;
}
|
0 | java-sources/ai/swim/swim-auth/3.10.0/swim | java-sources/ai/swim/swim-auth/3.10.0/swim/auth/Authenticated.java | // Copyright 2015-2019 SWIM.AI inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package swim.auth;
import swim.api.auth.Identity;
import swim.api.store.Store;
import swim.structure.Value;
import swim.uri.Uri;
public class Authenticated implements Identity {
final Uri requestUri;
final Uri fromUri;
final Value subject;
public Authenticated(Uri requestUri, Uri fromUri, Value subject) {
this.requestUri = requestUri;
this.fromUri = fromUri;
this.subject = subject;
}
@Override
public boolean isAuthenticated() {
return true;
}
@Override
public Uri requestUri() {
return this.requestUri;
}
@Override
public Uri fromUri() {
return this.fromUri;
}
@Override
public Value subject() {
return this.subject;
}
@Override
public Store data() {
throw new UnsupportedOperationException(); // TODO
}
@Override
public Store session() {
throw new UnsupportedOperationException(); // TODO
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.