/** * Get the ID of the connection. * * @since 0.966 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "stop", receiver = @Receiver(type = TypeKind.OBJECT, structType = MOCK_LISTENER_ENDPOINT, structPackage = "ballerina.http"), isPublic = true ) public class NonListeningStop extends org.ballerinalang.net.http.serviceendpoint.Stop { }
/** * This function which implements the finishSpan method for tracing. */ @BallerinaFunction( orgName = "ballerina", packageName = "observe", functionName = "finishSpan", receiver = @Receiver(type = TypeKind.STRUCT, structType = "Span", structPackage = "ballerina.observe"), isPublic = true ) public class FinishSpan extends BlockingNativeCallableUnit { @Override public void execute(Context context) { BStruct span = (BStruct) context.getRefArgument(0); String spanId = span.getStringField(0); OpenTracerBallerinaWrapper.getInstance().finishSpan(spanId); } }
/** * Get the ID of the connection. * * @since 0.966 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "start", receiver = @Receiver(type = TypeKind.OBJECT, structType = HTTP_LISTENER_ENDPOINT, structPackage = "ballerina/http"), isPublic = true ) public class Start extends AbstractHttpNativeFunction { @Override public void execute(Context context) { context.setReturnValues(); } }
/** * Get the ID of the connection. * * @since 0.966 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "start", receiver = @Receiver(type = TypeKind.OBJECT, structType = MOCK_LISTENER_ENDPOINT, structPackage = "ballerina.http"), isPublic = true ) public class NonListeningStart extends org.ballerinalang.net.http.serviceendpoint.Start { @Override public void execute(Context context) { // don't want to open a port to listen, hence nothing to do } }
/** * This is the native reset function implementation of the Counter object. * * @since 0.980.0 */ @BallerinaFunction( orgName = "ballerina", packageName = "observe", functionName = "reset", receiver = @Receiver(type = TypeKind.OBJECT, structType = ObserveNativeImplConstants.COUNTER, structPackage = ObserveNativeImplConstants.OBSERVE_PACKAGE_PATH), isPublic = true ) public class CounterReset extends BlockingNativeCallableUnit { @Override public void execute(Context context) { BMap bStruct = (BMap) context.getRefArgument(0); Counter counter = (Counter) bStruct.getNativeData(ObserveNativeImplConstants.METRIC_NATIVE_INSTANCE_KEY); counter.reset(); } }
/** * Get the ID of the connection. * * @since 0.966 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "stop", receiver = @Receiver(type = TypeKind.OBJECT, structType = HTTP_LISTENER_ENDPOINT, structPackage = "ballerina/http"), isPublic = true ) public class Stop extends AbstractHttpNativeFunction { @Override public void execute(Context context) { Struct serverEndpoint = BLangConnectorSPIUtil.getConnectorEndpointStruct(context); getServerConnector(serverEndpoint).stop(); serverEndpoint.addNativeData(HttpConstants.CONNECTOR_STARTED, false); resetRegistry(serverEndpoint); context.setReturnValues(); } }
/** * Get the entity without the body of inbound response. * * @since 0.96 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "getEntityWithoutBody", receiver = @Receiver(type = TypeKind.OBJECT, structType = "Response", structPackage = "ballerina/http"), returnType = {@ReturnType(type = TypeKind.OBJECT)} ) public class GetEntityWithoutBody extends BlockingNativeCallableUnit { @Override public void execute(Context context) { context.setReturnValues(HttpUtil.getEntity(context, true, false)); } }
/** * {@code Send} is the send action implementation of the JMS Connector. */ @BallerinaFunction(orgName = "ballerina", packageName = "jms", functionName = "acknowledge", receiver = @Receiver(type = TypeKind.OBJECT, structType = "TopicSubscriberCaller", structPackage = "ballerina/jms"), args = { @Argument(name = "message", type = TypeKind.OBJECT, structType = "Message") }, isPublic = true ) public class Acknowledge extends AbstractBlockingAction { @Override public void execute(Context context, CallableUnitCallback callableUnitCallback) { MessageAcknowledgementHandler.handle(context); } }
/** * Get the ID of the connection. * * @since 0.966 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "initEndpoint", receiver = @Receiver(type = TypeKind.OBJECT, structType = MOCK_LISTENER_ENDPOINT, structPackage = "ballerina.http"), returnType = {@ReturnType(type = TypeKind.OBJECT)}, isPublic = true ) public class NonListeningInitEndpoint extends org.ballerinalang.net.http.serviceendpoint.InitEndpoint { }
/** * Get the 'Entity' of the inbound request with the body. * * @since 0.96.0 */ @BallerinaFunction(orgName = "ballerina", packageName = "http", functionName = "getEntity", receiver = @Receiver(type = TypeKind.OBJECT, structType = "Request", structPackage = "ballerina/http"), returnType = { @ReturnType(type = TypeKind.OBJECT) }, isPublic = true) public class GetEntity extends BlockingNativeCallableUnit { @Override public void execute(Context context) { context.setReturnValues(HttpUtil.getEntity(context, true, true)); } }
/** * Get the entity without the body of inbound request. * * @since 0.96 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "getEntityWithoutBody", receiver = @Receiver(type = TypeKind.OBJECT, structType = "Request", structPackage = "ballerina/http"), returnType = {@ReturnType(type = TypeKind.OBJECT)} ) public class GetEntityWithoutBody extends BlockingNativeCallableUnit { @Override public void execute(Context context) { context.setReturnValues(HttpUtil.getEntity(context, true, false)); } }
/** * Set the entity of the inbound response. * * @since 0.96 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "setEntity", receiver = @Receiver(type = TypeKind.OBJECT, structType = "Response", structPackage = "ballerina/http"), args = {@Argument(name = "entity", type = TypeKind.OBJECT)}, isPublic = false ) public class SetEntity extends BlockingNativeCallableUnit { @Override public void execute(Context context) { HttpUtil.setEntity(context, false); context.setReturnValues(); } }
/** * Set the entity of the inbound request. * * @since 0.96.0 */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "setEntity", receiver = @Receiver(type = TypeKind.OBJECT, structType = "Request", structPackage = "ballerina/http"), args = {@Argument(name = "entity", type = TypeKind.OBJECT)}, isPublic = true ) public class SetEntity extends BlockingNativeCallableUnit { @Override public void execute(Context context) { HttpUtil.setEntity(context, true); context.setReturnValues(); } }
/** * {@code GetHeaderNames} is the ballerina extern function to get all transport header names in a Push Promise. */ @BallerinaFunction( orgName = "ballerina", packageName = "http", functionName = "getHeaderNames", receiver = @Receiver(type = TypeKind.OBJECT, structType = "PushPromise", structPackage = "ballerina/http"), returnType = {@ReturnType(type = TypeKind.ARRAY, elementType = TypeKind.STRING)}, isPublic = true ) public class GetHeaderNames extends BlockingNativeCallableUnit { @Override public void execute(Context context) { BMap<String, BValue> pushPromiseStruct = (BMap<String, BValue>) context.getRefArgument(0); Http2PushPromise http2PushPromise = HttpUtil.getPushPromise(pushPromiseStruct, HttpUtil.createHttpPushPromise(pushPromiseStruct)); Set<String> httpHeaderNames = http2PushPromise.getHttpRequest().headers().names(); context.setReturnValues(new BValueArray(httpHeaderNames.toArray(new String[httpHeaderNames.size()]))); } }
/** * Get the 'Entity' of the inbound response. * * @since 0.96 */ @BallerinaFunction(orgName = "ballerina", packageName = "http", functionName = "getEntity", receiver = @Receiver(type = TypeKind.OBJECT, structType = "Response", structPackage = "ballerina/http"), returnType = { @ReturnType(type = TypeKind.OBJECT) }, isPublic = true) public class GetEntity extends BlockingNativeCallableUnit { @Override public void execute(Context context) { context.setReturnValues(HttpUtil.getEntity(context, false, true)); } }
/** * This is the getValue function native implementation of the Counter object. * * @since 0.980.0 */ @BallerinaFunction( orgName = "ballerina", packageName = "observe", functionName = "getValue", receiver = @Receiver(type = TypeKind.OBJECT, structType = ObserveNativeImplConstants.COUNTER, structPackage = ObserveNativeImplConstants.OBSERVE_PACKAGE_PATH), returnType = @ReturnType(type = TypeKind.INT), isPublic = true ) public class CounterGetValue extends BlockingNativeCallableUnit { @Override public void execute(Context context) { BMap bStruct = (BMap) context.getRefArgument(0); Counter counter = (Counter) bStruct.getNativeData(ObserveNativeImplConstants.METRIC_NATIVE_INSTANCE_KEY); context.setReturnValues(new BInteger(counter.getValue())); } }
/** * {@code Send} is the send action implementation of the topic producer Connector. */ @BallerinaFunction(orgName = "ballerina", packageName = "jms", functionName = "send", receiver = @Receiver(type = TypeKind.OBJECT, structType = "TopicPublisher", structPackage = "ballerina/jms"), args = { @Argument(name = "message", type = TypeKind.OBJECT) }, isPublic = true ) public class Send extends AbstractBlockingAction { @Override public void execute(Context context, CallableUnitCallback callableUnitCallback) { SendActionHandler.handle(context); } }
/** * {@code Send} is the send action implementation of the JMS Connector. */ @BallerinaFunction(orgName = "ballerina", packageName = "jms", functionName = "send", receiver = @Receiver(type = TypeKind.OBJECT, structType = "QueueSender", structPackage = "ballerina/jms"), args = { @Argument(name = "message", type = TypeKind.OBJECT) }, isPublic = true ) public class Send extends AbstractBlockingAction { @Override public void execute(Context context, CallableUnitCallback callableUnitCallback) { SendActionHandler.handle(context); } }
/** * Extern function ballerina.model.strings:equalsIgnoreCase. * * @since 0.8.0 */ @BallerinaFunction( orgName = "ballerina", packageName = "builtin", functionName = "string.equalsIgnoreCase", receiver = @Receiver(type = TypeKind.STRING), args = {@Argument(name = "anotherString", type = TypeKind.STRING)}, returnType = {@ReturnType(type = TypeKind.BOOLEAN)}, isPublic = true ) public class EqualsIgnoreCase extends BlockingNativeCallableUnit { @Override public void execute(Context context) { String string1 = context.getStringArgument(0); String anotherString = context.getStringArgument(1); BBoolean booleanValue = new BBoolean(string1.equalsIgnoreCase(anotherString)); context.setReturnValues(booleanValue); } }
/** * Register JMS listener for a consumer endpoint. * * @since 0.970 */ @BallerinaFunction( orgName = "ballerina", packageName = "jms", functionName = "registerListener", receiver = @Receiver(type = TypeKind.OBJECT, structType = "TopicSubscriber", structPackage = "ballerina/jms"), args = {@Argument(name = "serviceType", type = TypeKind.TYPEDESC), @Argument(name = "consumerActions", type = TypeKind.OBJECT, structType = "TopicSubscriberCaller"), @Argument(name = "data", type = TypeKind.MAP) }, isPublic = true ) public class RegisterMessageListener extends AbstractBlockingAction { @Override public void execute(Context context, CallableUnitCallback callableUnitCallback) { MessageListenerHandler.createAndRegister(context); } }