Java Code Examples for org.fourthline.cling.model.meta.Service#getAction()

The following examples show how to use org.fourthline.cling.model.meta.Service#getAction() . 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: PortMappingAdd.java    From TVRemoteIME with GNU General Public License v2.0 6 votes vote down vote up
protected PortMappingAdd(Service service, ControlPoint controlPoint, PortMapping portMapping) {
    super(new ActionInvocation(service.getAction("AddPortMapping")), controlPoint);

    this.portMapping = portMapping;

    getActionInvocation().setInput("NewExternalPort", portMapping.getExternalPort());
    getActionInvocation().setInput("NewProtocol", portMapping.getProtocol());
    getActionInvocation().setInput("NewInternalClient", portMapping.getInternalClient());
    getActionInvocation().setInput("NewInternalPort", portMapping.getInternalPort());
    getActionInvocation().setInput("NewLeaseDuration", portMapping.getLeaseDurationSeconds());
    getActionInvocation().setInput("NewEnabled", portMapping.isEnabled());
    if (portMapping.hasRemoteHost())
        getActionInvocation().setInput("NewRemoteHost", portMapping.getRemoteHost());
    if (portMapping.hasDescription())
        getActionInvocation().setInput("NewPortMappingDescription", portMapping.getDescription());

}
 
Example 2
Source File: Browse.java    From DroidDLNA with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @param maxResults Can be <code>null</code>, then {@link #getDefaultMaxResults()} is used.
 */
public Browse(Service service, String objectID, BrowseFlag flag,
                            String filter, long firstResult, Long maxResults, SortCriterion... orderBy) {

    super(new ActionInvocation(service.getAction("Browse")));

    log.fine("Creating browse action for object ID: " + objectID);

    getActionInvocation().setInput("ObjectID", objectID);
    getActionInvocation().setInput("BrowseFlag", flag.toString());
    getActionInvocation().setInput("Filter", filter);
    getActionInvocation().setInput("StartingIndex", new UnsignedIntegerFourBytes(firstResult));
    getActionInvocation().setInput("RequestedCount",
            new UnsignedIntegerFourBytes(maxResults == null ? getDefaultMaxResults() : maxResults)
    );
    getActionInvocation().setInput("SortCriteria", SortCriterion.toString(orderBy));
}
 
Example 3
Source File: PrepareForConnection.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
public PrepareForConnection(Service service, ControlPoint controlPoint,
                            ProtocolInfo remoteProtocolInfo, ServiceReference peerConnectionManager,
                            int peerConnectionID, ConnectionInfo.Direction direction) {
    super(new ActionInvocation(service.getAction("PrepareForConnection")), controlPoint);

    getActionInvocation().setInput("RemoteProtocolInfo", remoteProtocolInfo.toString());
    getActionInvocation().setInput("PeerConnectionManager", peerConnectionManager.toString());
    getActionInvocation().setInput("PeerConnectionID", peerConnectionID);
    getActionInvocation().setInput("Direction", direction.toString());
}
 
Example 4
Source File: PortMappingDelete.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
protected PortMappingDelete(Service service, ControlPoint controlPoint, PortMapping portMapping) {
    super(new ActionInvocation(service.getAction("DeletePortMapping")), controlPoint);

    this.portMapping = portMapping;

    getActionInvocation().setInput("NewExternalPort", portMapping.getExternalPort());
    getActionInvocation().setInput("NewProtocol", portMapping.getProtocol());
    if (portMapping.hasRemoteHost())
        getActionInvocation().setInput("NewRemoteHost", portMapping.getRemoteHost());

}
 
Example 5
Source File: GetPositionInfo.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public GetPositionInfo(UnsignedIntegerFourBytes instanceId, Service service) {
    super(new ActionInvocation(service.getAction("GetPositionInfo")));
    getActionInvocation().setInput("InstanceID", instanceId);
}
 
Example 6
Source File: GetMediaInfo.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public GetMediaInfo(UnsignedIntegerFourBytes instanceId, Service service) {
    super(new ActionInvocation(service.getAction("GetMediaInfo")));
    getActionInvocation().setInput("InstanceID", instanceId);
}
 
Example 7
Source File: GetMute.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public GetMute(UnsignedIntegerFourBytes instanceId, Service service) {
    super(new ActionInvocation(service.getAction("GetMute")));
    getActionInvocation().setInput("InstanceID", instanceId);
    getActionInvocation().setInput("Channel", Channel.Master.toString());
}
 
Example 8
Source File: SetVolume.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public SetVolume(UnsignedIntegerFourBytes instanceId, Service service, long newVolume) {
    super(new ActionInvocation(service.getAction("SetVolume")));
    getActionInvocation().setInput("InstanceID", instanceId);
    getActionInvocation().setInput("Channel", Channel.Master.toString());
    getActionInvocation().setInput("DesiredVolume", new UnsignedIntegerTwoBytes(newVolume));
}
 
Example 9
Source File: GetPositionInfo.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public GetPositionInfo(UnsignedIntegerFourBytes instanceId, Service service) {
    super(new ActionInvocation(service.getAction("GetPositionInfo")));
    getActionInvocation().setInput("InstanceID", instanceId);
}
 
Example 10
Source File: Play.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public Play(UnsignedIntegerFourBytes instanceId, Service service, String speed) {
    super(new ActionInvocation(service.getAction("Play")));
    getActionInvocation().setInput("InstanceID", instanceId);
    getActionInvocation().setInput("Speed", speed);
}
 
Example 11
Source File: GetExternalIP.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public GetExternalIP(Service service) {
    super(new ActionInvocation(service.getAction("GetExternalIPAddress")));
}
 
Example 12
Source File: DLNAController.java    From Popeens-DSub with GNU General Public License v3.0 4 votes vote down vote up
public SetNextAVTransportURI(UnsignedIntegerFourBytes instanceId, Service service, String uri, String metadata) {
	super(new ActionInvocation(service.getAction("SetNextAVTransportURI")));
	getActionInvocation().setInput("InstanceID", instanceId);
	getActionInvocation().setInput("NextURI", uri);
	getActionInvocation().setInput("NextURIMetaData", metadata);
}
 
Example 13
Source File: GetVolume.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public GetVolume(UnsignedIntegerFourBytes instanceId, Service service) {
    super(new ActionInvocation(service.getAction("GetVolume")));
    getActionInvocation().setInput("InstanceID", instanceId);
    getActionInvocation().setInput("Channel", Channel.Master.toString());
}
 
Example 14
Source File: GetMediaInfo.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public GetMediaInfo(UnsignedIntegerFourBytes instanceId, Service service) {
    super(new ActionInvocation(service.getAction("GetMediaInfo")));
    getActionInvocation().setInput("InstanceID", instanceId);
}
 
Example 15
Source File: Seek.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public Seek(UnsignedIntegerFourBytes instanceId, Service service, SeekMode mode, String target) {
    super(new ActionInvocation(service.getAction("Seek")));
    getActionInvocation().setInput("InstanceID", instanceId);
    getActionInvocation().setInput("Unit", mode.name());
    getActionInvocation().setInput("Target", target);
}
 
Example 16
Source File: GetProtocolInfo.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
protected GetProtocolInfo(Service service, ControlPoint controlPoint) {
	super(new ActionInvocation(service.getAction("GetProtocolInfo")),
			controlPoint);
}
 
Example 17
Source File: Seek.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public Seek(UnsignedIntegerFourBytes instanceId, Service service, SeekMode mode, String target) {
    super(new ActionInvocation(service.getAction("Seek")));
    getActionInvocation().setInput("InstanceID", instanceId);
    getActionInvocation().setInput("Unit", mode.name());
    getActionInvocation().setInput("Target", target);
}
 
Example 18
Source File: SetMute.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public SetMute(UnsignedIntegerFourBytes instanceId, Service service, boolean desiredMute) {
    super(new ActionInvocation(service.getAction("SetMute")));
    getActionInvocation().setInput("InstanceID", instanceId);
    getActionInvocation().setInput("Channel", Channel.Master.toString());
    getActionInvocation().setInput("DesiredMute", desiredMute);
}
 
Example 19
Source File: GetProtocolInfo.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
protected GetProtocolInfo(Service service, ControlPoint controlPoint) {
	super(new ActionInvocation(service.getAction("GetProtocolInfo")),
			controlPoint);
}
 
Example 20
Source File: RemoveMessage.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public RemoveMessage(Service service, int id) {
    super(new ActionInvocation(service.getAction("RemoveMessage")));
    getActionInvocation().setInput("MessageID", id);
}