org.fourthline.cling.binding.annotations.UpnpInputArgument Java Examples

The following examples show how to use org.fourthline.cling.binding.annotations.UpnpInputArgument. 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 Project: TVRemoteIME   Author: kingthy   File: ConnectionManagerService.java    License: GNU General Public License v2.0 6 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "RcsID", getterName = "getRcsID"),
        @UpnpOutputArgument(name = "AVTransportID", getterName = "getAvTransportID"),
        @UpnpOutputArgument(name = "ProtocolInfo", getterName = "getProtocolInfo"),
        @UpnpOutputArgument(name = "PeerConnectionManager", stateVariable = "A_ARG_TYPE_ConnectionManager", getterName = "getPeerConnectionManager"),
        @UpnpOutputArgument(name = "PeerConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID", getterName = "getPeerConnectionID"),
        @UpnpOutputArgument(name = "Direction", getterName = "getDirection"),
        @UpnpOutputArgument(name = "Status", stateVariable = "A_ARG_TYPE_ConnectionStatus", getterName = "getConnectionStatus")
})
synchronized public ConnectionInfo getCurrentConnectionInfo(@UpnpInputArgument(name = "ConnectionID") int connectionId)
        throws ActionException {
    log.fine("Getting connection information of connection ID: " + connectionId);
    ConnectionInfo info;
    if ((info = activeConnections.get(connectionId)) == null) {
        throw new ConnectionManagerException(
                ConnectionManagerErrorCode.INVALID_CONNECTION_REFERENCE,
                "Non-active connection ID: " + connectionId
        );
    }
    return info;
}
 
Example #2
Source Project: DroidDLNA   Author: offbye   File: ConnectionManagerService.java    License: GNU General Public License v3.0 6 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "RcsID", getterName = "getRcsID"),
        @UpnpOutputArgument(name = "AVTransportID", getterName = "getAvTransportID"),
        @UpnpOutputArgument(name = "ProtocolInfo", getterName = "getProtocolInfo"),
        @UpnpOutputArgument(name = "PeerConnectionManager", stateVariable = "A_ARG_TYPE_ConnectionManager", getterName = "getPeerConnectionManager"),
        @UpnpOutputArgument(name = "PeerConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID", getterName = "getPeerConnectionID"),
        @UpnpOutputArgument(name = "Direction", getterName = "getDirection"),
        @UpnpOutputArgument(name = "Status", stateVariable = "A_ARG_TYPE_ConnectionStatus", getterName = "getConnectionStatus")
})
synchronized public ConnectionInfo getCurrentConnectionInfo(@UpnpInputArgument(name = "ConnectionID") int connectionId)
        throws ActionException {
    log.fine("Getting connection information of connection ID: " + connectionId);
    ConnectionInfo info;
    if ((info = activeConnections.get(connectionId)) == null) {
        throw new ConnectionManagerException(
                ConnectionManagerErrorCode.INVALID_CONNECTION_REFERENCE,
                "Non-active connection ID: " + connectionId
        );
    }
    return info;
}
 
Example #3
@UpnpAction
synchronized public void connectionComplete(@UpnpInputArgument(name = "ConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID") int connectionID)
        throws ActionException {
    ConnectionInfo info = getCurrentConnectionInfo(connectionID);
    log.fine("Closing connection ID " + connectionID);
    closeConnection(info);
    removeConnection(connectionID);
}
 
Example #4
@UpnpAction(out = {
        @UpnpOutputArgument(name = "Result",
                            stateVariable = "A_ARG_TYPE_Result")
})
public int isAuthorized(@UpnpInputArgument(name = "DeviceID",
                                               stateVariable = "A_ARG_TYPE_DeviceID")
                            String deviceID) {
    return 1;
}
 
Example #5
@UpnpAction(out = {
        @UpnpOutputArgument(name = "Result",
                            stateVariable = "A_ARG_TYPE_Result")
})
public int isValidated(@UpnpInputArgument(name = "DeviceID",
                                              stateVariable = "A_ARG_TYPE_DeviceID")
                           String deviceID) {
    return 1;
}
 
Example #6
@UpnpAction(out = {
        @UpnpOutputArgument(name = "RegistrationRespMsg",
                            stateVariable = "A_ARG_TYPE_RegistrationRespMsg")
})
public byte[] registerDevice(@UpnpInputArgument(name = "RegistrationReqMsg",
                                                stateVariable = "A_ARG_TYPE_RegistrationReqMsg")
                             byte[] registrationReqMsg) {
    return new byte[]{};
}
 
Example #7
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "NrTracks", stateVariable = "NumberOfTracks", getterName = "getNumberOfTracks"),
        @UpnpOutputArgument(name = "MediaDuration", stateVariable = "CurrentMediaDuration", getterName = "getMediaDuration"),
        @UpnpOutputArgument(name = "CurrentURI", stateVariable = "AVTransportURI", getterName = "getCurrentURI"),
        @UpnpOutputArgument(name = "CurrentURIMetaData", stateVariable = "AVTransportURIMetaData", getterName = "getCurrentURIMetaData"),
        @UpnpOutputArgument(name = "NextURI", stateVariable = "NextAVTransportURI", getterName = "getNextURI"),
        @UpnpOutputArgument(name = "NextURIMetaData", stateVariable = "NextAVTransportURIMetaData", getterName = "getNextURIMetaData"),
        @UpnpOutputArgument(name = "PlayMedium", stateVariable = "PlaybackStorageMedium", getterName = "getPlayMedium"),
        @UpnpOutputArgument(name = "RecordMedium", stateVariable = "RecordStorageMedium", getterName = "getRecordMedium"),
        @UpnpOutputArgument(name = "WriteStatus", stateVariable = "RecordMediumWriteStatus", getterName = "getWriteStatus")
})
public abstract MediaInfo getMediaInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #8
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "CurrentTransportState", stateVariable = "TransportState", getterName = "getCurrentTransportState"),
        @UpnpOutputArgument(name = "CurrentTransportStatus", stateVariable = "TransportStatus", getterName = "getCurrentTransportStatus"),
        @UpnpOutputArgument(name = "CurrentSpeed", stateVariable = "TransportPlaySpeed", getterName = "getCurrentSpeed")
})
public abstract TransportInfo getTransportInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #9
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "Track", stateVariable = "CurrentTrack", getterName = "getTrack"),
        @UpnpOutputArgument(name = "TrackDuration", stateVariable = "CurrentTrackDuration", getterName = "getTrackDuration"),
        @UpnpOutputArgument(name = "TrackMetaData", stateVariable = "CurrentTrackMetaData", getterName = "getTrackMetaData"),
        @UpnpOutputArgument(name = "TrackURI", stateVariable = "CurrentTrackURI", getterName = "getTrackURI"),
        @UpnpOutputArgument(name = "RelTime", stateVariable = "RelativeTimePosition", getterName = "getRelTime"),
        @UpnpOutputArgument(name = "AbsTime", stateVariable = "AbsoluteTimePosition", getterName = "getAbsTime"),
        @UpnpOutputArgument(name = "RelCount", stateVariable = "RelativeCounterPosition", getterName = "getRelCount"),
        @UpnpOutputArgument(name = "AbsCount", stateVariable = "AbsoluteCounterPosition", getterName = "getAbsCount")
})
public abstract PositionInfo getPositionInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #10
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "PlayMedia", stateVariable = "PossiblePlaybackStorageMedia", getterName = "getPlayMediaString"),
        @UpnpOutputArgument(name = "RecMedia", stateVariable = "PossibleRecordStorageMedia", getterName = "getRecMediaString"),
        @UpnpOutputArgument(name = "RecQualityModes", stateVariable = "PossibleRecordQualityModes", getterName = "getRecQualityModesString")
})
public abstract DeviceCapabilities getDeviceCapabilities(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #11
Source Project: DroidDLNA   Author: offbye   File: AbstractAudioRenderingControl.java    License: GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "MinValue", stateVariable = "VolumeDB", getterName = "getMinValue"),
        @UpnpOutputArgument(name = "MaxValue", stateVariable = "VolumeDB", getterName = "getMaxValue")
})
public VolumeDBRange getVolumeDBRange(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                                      @UpnpInputArgument(name = "Channel") String channelName) throws RenderingControlException {
    return new VolumeDBRange(0, 0);
}
 
Example #12
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction(name = "GetCurrentTransportActions", out = @UpnpOutputArgument(name = "Actions", stateVariable = "CurrentTransportActions"))
public String getCurrentTransportActionsString(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException {
    try {
        return ModelUtil.toCommaSeparatedList(getCurrentTransportActions(instanceId));
    } catch (Exception ex) {
        return ""; // TODO: Empty string is not defined in spec but seems reasonable for no available action?
    }
}
 
Example #13
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAudioRenderingControl.java    License: GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction
public void setVolumeDB(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                        @UpnpInputArgument(name = "Channel") String channelName,
                        @UpnpInputArgument(name = "DesiredVolume", stateVariable = "VolumeDB") Integer  desiredVolumeDB) throws RenderingControlException {
    /*
    VolumeDB volumeDB = new VolumeDB();
    volumeDB.setChannel(channelName);
    volumeDB.setVal(new BigInteger(desiredVolumeDB.toString()));
    */
}
 
Example #14
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAudioRenderingControl.java    License: GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "MinValue", stateVariable = "VolumeDB", getterName = "getMinValue"),
        @UpnpOutputArgument(name = "MaxValue", stateVariable = "VolumeDB", getterName = "getMaxValue")
})
public VolumeDBRange getVolumeDBRange(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                                      @UpnpInputArgument(name = "Channel") String channelName) throws RenderingControlException {
    return new VolumeDBRange(0, 0);
}
 
Example #15
Source Project: DroidDLNA   Author: offbye   File: AbstractAudioRenderingControl.java    License: GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction
public void setVolumeDB(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                        @UpnpInputArgument(name = "Channel") String channelName,
                        @UpnpInputArgument(name = "DesiredVolume", stateVariable = "VolumeDB") Integer  desiredVolumeDB) throws RenderingControlException {
    /*
    VolumeDB volumeDB = new VolumeDB();
    volumeDB.setChannel(channelName);
    volumeDB.setVal(new BigInteger(desiredVolumeDB.toString()));
    */
}
 
Example #16
@UpnpAction(out = {
        @UpnpOutputArgument(name = "ConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID", getterName = "getConnectionID"),
        @UpnpOutputArgument(name = "AVTransportID", stateVariable = "A_ARG_TYPE_AVTransportID", getterName = "getAvTransportID"),
        @UpnpOutputArgument(name = "RcsID", stateVariable = "A_ARG_TYPE_RcsID", getterName = "getRcsID")
})
synchronized public ConnectionInfo prepareForConnection(
        @UpnpInputArgument(name = "RemoteProtocolInfo", stateVariable = "A_ARG_TYPE_ProtocolInfo") ProtocolInfo remoteProtocolInfo,
        @UpnpInputArgument(name = "PeerConnectionManager", stateVariable = "A_ARG_TYPE_ConnectionManager") ServiceReference peerConnectionManager,
        @UpnpInputArgument(name = "PeerConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID") int peerConnectionId,
        @UpnpInputArgument(name = "Direction", stateVariable = "A_ARG_TYPE_Direction") String direction)
        throws ActionException {

    int connectionId = getNewConnectionId();

    ConnectionInfo.Direction dir;
    try {
        dir = ConnectionInfo.Direction.valueOf(direction);
    } catch (Exception ex) {
        throw new ConnectionManagerException(ErrorCode.ARGUMENT_VALUE_INVALID, "Unsupported direction: " + direction);
    }

    log.fine("Preparing for connection with local new ID " + connectionId + " and peer connection ID: " + peerConnectionId);

    ConnectionInfo newConnectionInfo = createConnection(
            connectionId,
            peerConnectionId,
            peerConnectionManager,
            dir,
            remoteProtocolInfo
    );

    storeConnection(newConnectionInfo);

    return newConnectionInfo;
}
 
Example #17
@UpnpAction
synchronized public void connectionComplete(@UpnpInputArgument(name = "ConnectionID", stateVariable = "A_ARG_TYPE_ConnectionID") int connectionID)
        throws ActionException {
    ConnectionInfo info = getCurrentConnectionInfo(connectionID);
    log.fine("Closing connection ID " + connectionID);
    closeConnection(info);
    removeConnection(connectionID);
}
 
Example #18
@UpnpAction(out = {
        @UpnpOutputArgument(name = "Result",
                            stateVariable = "A_ARG_TYPE_Result")
})
public int isAuthorized(@UpnpInputArgument(name = "DeviceID",
                                               stateVariable = "A_ARG_TYPE_DeviceID")
                            String deviceID) {
    return 1;
}
 
Example #19
@UpnpAction(out = {
        @UpnpOutputArgument(name = "Result",
                            stateVariable = "A_ARG_TYPE_Result")
})
public int isValidated(@UpnpInputArgument(name = "DeviceID",
                                              stateVariable = "A_ARG_TYPE_DeviceID")
                           String deviceID) {
    return 1;
}
 
Example #20
Source Project: DroidDLNA   Author: offbye   File: AbstractAudioRenderingControl.java    License: GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction
    public void setLoudness(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                            @UpnpInputArgument(name = "Channel") String channelName,
                            @UpnpInputArgument(name = "DesiredLoudness", stateVariable = "Loudness") boolean desiredLoudness) throws RenderingControlException {
/*
        Loudness loudness = new Loudness();
        loudness.setChannel(channelName);
        loudness.setVal(desiredLoudness);
*/
    }
 
Example #21
Source Project: DroidDLNA   Author: offbye   File: AbstractAVTransportService.java    License: GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "NrTracks", stateVariable = "NumberOfTracks", getterName = "getNumberOfTracks"),
        @UpnpOutputArgument(name = "MediaDuration", stateVariable = "CurrentMediaDuration", getterName = "getMediaDuration"),
        @UpnpOutputArgument(name = "CurrentURI", stateVariable = "AVTransportURI", getterName = "getCurrentURI"),
        @UpnpOutputArgument(name = "CurrentURIMetaData", stateVariable = "AVTransportURIMetaData", getterName = "getCurrentURIMetaData"),
        @UpnpOutputArgument(name = "NextURI", stateVariable = "NextAVTransportURI", getterName = "getNextURI"),
        @UpnpOutputArgument(name = "NextURIMetaData", stateVariable = "NextAVTransportURIMetaData", getterName = "getNextURIMetaData"),
        @UpnpOutputArgument(name = "PlayMedium", stateVariable = "PlaybackStorageMedium", getterName = "getPlayMedium"),
        @UpnpOutputArgument(name = "RecordMedium", stateVariable = "RecordStorageMedium", getterName = "getRecordMedium"),
        @UpnpOutputArgument(name = "WriteStatus", stateVariable = "RecordMediumWriteStatus", getterName = "getWriteStatus")
})
public abstract MediaInfo getMediaInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #22
Source Project: DroidDLNA   Author: offbye   File: AbstractAVTransportService.java    License: GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "CurrentTransportState", stateVariable = "TransportState", getterName = "getCurrentTransportState"),
        @UpnpOutputArgument(name = "CurrentTransportStatus", stateVariable = "TransportStatus", getterName = "getCurrentTransportStatus"),
        @UpnpOutputArgument(name = "CurrentSpeed", stateVariable = "TransportPlaySpeed", getterName = "getCurrentSpeed")
})
public abstract TransportInfo getTransportInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #23
Source Project: DroidDLNA   Author: offbye   File: AbstractAVTransportService.java    License: GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "Track", stateVariable = "CurrentTrack", getterName = "getTrack"),
        @UpnpOutputArgument(name = "TrackDuration", stateVariable = "CurrentTrackDuration", getterName = "getTrackDuration"),
        @UpnpOutputArgument(name = "TrackMetaData", stateVariable = "CurrentTrackMetaData", getterName = "getTrackMetaData"),
        @UpnpOutputArgument(name = "TrackURI", stateVariable = "CurrentTrackURI", getterName = "getTrackURI"),
        @UpnpOutputArgument(name = "RelTime", stateVariable = "RelativeTimePosition", getterName = "getRelTime"),
        @UpnpOutputArgument(name = "AbsTime", stateVariable = "AbsoluteTimePosition", getterName = "getAbsTime"),
        @UpnpOutputArgument(name = "RelCount", stateVariable = "RelativeCounterPosition", getterName = "getRelCount"),
        @UpnpOutputArgument(name = "AbsCount", stateVariable = "AbsoluteCounterPosition", getterName = "getAbsCount")
})
public abstract PositionInfo getPositionInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #24
Source Project: DroidDLNA   Author: offbye   File: AbstractAVTransportService.java    License: GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "PlayMedia", stateVariable = "PossiblePlaybackStorageMedia", getterName = "getPlayMediaString"),
        @UpnpOutputArgument(name = "RecMedia", stateVariable = "PossibleRecordStorageMedia", getterName = "getRecMediaString"),
        @UpnpOutputArgument(name = "RecQualityModes", stateVariable = "PossibleRecordQualityModes", getterName = "getRecQualityModesString")
})
public abstract DeviceCapabilities getDeviceCapabilities(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #25
Source Project: DroidDLNA   Author: offbye   File: AbstractAVTransportService.java    License: GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction(name = "GetCurrentTransportActions", out = @UpnpOutputArgument(name = "Actions", stateVariable = "CurrentTransportActions"))
public String getCurrentTransportActionsString(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException {
    try {
        return ModelUtil.toCommaSeparatedList(getCurrentTransportActions(instanceId));
    } catch (Exception ex) {
        return ""; // TODO: Empty string is not defined in spec but seems reasonable for no available action?
    }
}
 
Example #26
Source Project: DroidDLNA   Author: offbye   File: AbstractAudioRenderingControl.java    License: GNU General Public License v3.0 4 votes vote down vote up
@UpnpAction(out = @UpnpOutputArgument(name = "CurrentVolume", stateVariable = "VolumeDB"))
public Integer getVolumeDB(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                         @UpnpInputArgument(name = "Channel") String channelName) throws RenderingControlException {
    return 0;
}
 
Example #27
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: GNU General Public License v2.0 4 votes vote down vote up
@UpnpAction
public abstract void setAVTransportURI(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                                       @UpnpInputArgument(name = "CurrentURI", stateVariable = "AVTransportURI") String currentURI,
                                       @UpnpInputArgument(name = "CurrentURIMetaData", stateVariable = "AVTransportURIMetaData") String currentURIMetaData)
        throws AVTransportException;
 
Example #28
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: GNU General Public License v2.0 4 votes vote down vote up
@UpnpAction
public abstract void setNextAVTransportURI(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                                           @UpnpInputArgument(name = "NextURI", stateVariable = "AVTransportURI") String nextURI,
                                           @UpnpInputArgument(name = "NextURIMetaData", stateVariable = "AVTransportURIMetaData") String nextURIMetaData)
        throws AVTransportException;
 
Example #29
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: GNU General Public License v2.0 4 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "PlayMode", stateVariable = "CurrentPlayMode", getterName = "getPlayMode"),
        @UpnpOutputArgument(name = "RecQualityMode", stateVariable = "CurrentRecordQualityMode", getterName = "getRecQualityMode")
})
public abstract TransportSettings getTransportSettings(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #30
Source Project: DroidDLNA   Author: offbye   File: AbstractAudioRenderingControl.java    License: GNU General Public License v3.0 4 votes vote down vote up
@UpnpAction
public abstract void setMute(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId,
                             @UpnpInputArgument(name = "Channel") String channelName,
                             @UpnpInputArgument(name = "DesiredMute", stateVariable = "Mute") boolean desiredMute) throws RenderingControlException;