org.fourthline.cling.protocol.sync.SendingAction Java Examples

The following examples show how to use org.fourthline.cling.protocol.sync.SendingAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MockProtocolFactory.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SendingAction createSendingAction(ActionInvocation actionInvocation, URL controlURL) {
    return null;
}
 
Example #2
Source File: ProtocolFactoryImpl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public SendingAction createSendingAction(ActionInvocation actionInvocation, URL controlURL) {
    return new SendingAction(getUpnpService(), actionInvocation, controlURL);
}
 
Example #3
Source File: ActionCallback.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    Service service = actionInvocation.getAction().getService();

    // Local execution
    if (service instanceof LocalService) {
        LocalService localService = (LocalService)service;

        // Executor validates input inside the execute() call immediately
        localService.getExecutor(actionInvocation.getAction()).execute(actionInvocation);

        if (actionInvocation.getFailure() != null) {
            failure(actionInvocation, null);
        } else {
            success(actionInvocation);
        }

    // Remote execution
    } else if (service instanceof RemoteService){

        if (getControlPoint()  == null) {
            throw new IllegalStateException("Callback must be executed through ControlPoint");
        }

        RemoteService remoteService = (RemoteService)service;

        // Figure out the remote URL where we'd like to send the action request to
        URL controLURL = remoteService.getDevice().normalizeURI(remoteService.getControlURI());

        // Do it
        SendingAction prot = getControlPoint().getProtocolFactory().createSendingAction(actionInvocation, controLURL);
        prot.run();

        IncomingActionResponseMessage response = prot.getOutputMessage();

        if (response == null) {
            failure(actionInvocation, null);
        } else if (response.getOperation().isFailed()) {
            failure(actionInvocation, response.getOperation());
        } else {
            success(actionInvocation);
        }
    }
}
 
Example #4
Source File: MockProtocolFactory.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@Override
public SendingAction createSendingAction(ActionInvocation actionInvocation, URL controlURL) {
    return null;
}
 
Example #5
Source File: ProtocolFactoryImpl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public SendingAction createSendingAction(ActionInvocation actionInvocation, URL controlURL) {
    return new SendingAction(getUpnpService(), actionInvocation, controlURL);
}
 
Example #6
Source File: ActionCallback.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public void run() {
    Service service = actionInvocation.getAction().getService();

    // Local execution
    if (service instanceof LocalService) {
        LocalService localService = (LocalService)service;

        // Executor validates input inside the execute() call immediately
        localService.getExecutor(actionInvocation.getAction()).execute(actionInvocation);

        if (actionInvocation.getFailure() != null) {
            failure(actionInvocation, null);
        } else {
            success(actionInvocation);
        }

    // Remote execution
    } else if (service instanceof RemoteService){

        if (getControlPoint()  == null) {
            throw new IllegalStateException("Callback must be executed through ControlPoint");
        }

        RemoteService remoteService = (RemoteService)service;

        // Figure out the remote URL where we'd like to send the action request to
        URL controLURL = remoteService.getDevice().normalizeURI(remoteService.getControlURI());

        // Do it
        SendingAction prot = getControlPoint().getProtocolFactory().createSendingAction(actionInvocation, controLURL);
        prot.run();

        IncomingActionResponseMessage response = prot.getOutputMessage();

        if (response == null) {
            failure(actionInvocation, null);
        } else if (response.getOperation().isFailed()) {
            failure(actionInvocation, response.getOperation());
        } else {
            success(actionInvocation);
        }
    }
}
 
Example #7
Source File: ProtocolFactory.java    From TVRemoteIME with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Called by the {@link org.fourthline.cling.controlpoint.ControlPoint}, creates a protocol for executing an action.
 */
public SendingAction createSendingAction(ActionInvocation actionInvocation, URL controlURL);
 
Example #8
Source File: ProtocolFactory.java    From DroidDLNA with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Called by the {@link org.fourthline.cling.controlpoint.ControlPoint}, creates a protocol for executing an action.
 */
public SendingAction createSendingAction(ActionInvocation actionInvocation, URL controlURL);