Package org.cyclos.impl.access
Class ServiceFacadeImpl
- java.lang.Object
-
- org.cyclos.impl.access.ServiceFacadeImpl
-
- All Implemented Interfaces:
ServiceFacade
@Component public class ServiceFacadeImpl extends Object implements ServiceFacade
Implementation forServiceFacade
-
-
Constructor Summary
Constructors Constructor Description ServiceFacadeImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseSubscription(String id)Permanently closes the push notification subscription with the given idStringgetResourceCacheKey()Returns a string which can be used to control cache of resources regarding this Cyclos version / compilationResponseInfohandleInboundSms(RequestInfo request)Handles an inbound SMS request, returning the response which should be returned to the gatewayInvocationResultinvoke(InvocationData data)Invokes a service method according to the givenInvocationDataRequestDataresolveRequestData(boolean proxy, String protocol, String remoteAddress, String rootUrl, String uri)Returns the route data about a given request URI.ResponseInforunCustomWebService(InvocationData invocationData, RequestInfo request)This is a special entry point because custom web services may define a guest authorization that uses a specific username / password received as a BASIC auth.Stringsubscribe(InvocationData invocation, String clientId, String lastEventId, PushNotificationEventFilter filter, Consumer<PushNotificationEvent<?>> listener)Subscribes a push notifications listener returning the subscription id.voidtimeoutSubscription(String id)Marks the given push notification subscription as timed-out.
-
-
-
Method Detail
-
closeSubscription
public void closeSubscription(String id)
Description copied from interface:ServiceFacadePermanently closes the push notification subscription with the given id- Specified by:
closeSubscriptionin interfaceServiceFacade
-
getResourceCacheKey
public String getResourceCacheKey()
Description copied from interface:ServiceFacadeReturns a string which can be used to control cache of resources regarding this Cyclos version / compilation- Specified by:
getResourceCacheKeyin interfaceServiceFacade
-
handleInboundSms
public ResponseInfo handleInboundSms(RequestInfo request)
Description copied from interface:ServiceFacadeHandles an inbound SMS request, returning the response which should be returned to the gateway- Specified by:
handleInboundSmsin interfaceServiceFacade
-
invoke
public InvocationResult invoke(InvocationData data) throws FrameworkException, IllegalInvocationException
Description copied from interface:ServiceFacadeInvokes a service method according to the givenInvocationData- Specified by:
invokein interfaceServiceFacade- Throws:
FrameworkExceptionIllegalInvocationException
-
resolveRequestData
public RequestData resolveRequestData(boolean proxy, String protocol, String remoteAddress, String rootUrl, String uri) throws FrameworkException
Description copied from interface:ServiceFacadeReturns the route data about a given request URI. The return will contain the matched network id and internal name (if not on global mode), the resolved configuration id (if null, should be handled as a not found on client) and the final URI always starting with '/' (after removing the network root path and guest configuration key)- Specified by:
resolveRequestDatain interfaceServiceFacade- Throws:
FrameworkException
-
runCustomWebService
public ResponseInfo runCustomWebService(InvocationData invocationData, RequestInfo request)
This is a special entry point because custom web services may define a guest authorization that uses a specific username / password received as a BASIC auth. If we would move this to a regular service, this would fail for not corresponding to a valid user / password.- Specified by:
runCustomWebServicein interfaceServiceFacade
-
subscribe
public String subscribe(InvocationData invocation, String clientId, String lastEventId, PushNotificationEventFilter filter, Consumer<PushNotificationEvent<?>> listener)
Description copied from interface:ServiceFacadeSubscribes a push notifications listener returning the subscription id.- Specified by:
subscribein interfaceServiceFacade
-
timeoutSubscription
public void timeoutSubscription(String id)
Description copied from interface:ServiceFacadeMarks the given push notification subscription as timed-out. It means it will enqueue missed events, so if a new reconnection with the same client id shows up, it will send all missed events.- Specified by:
timeoutSubscriptionin interfaceServiceFacade
-
-