本文整理汇总了Java中org.fourthline.cling.UpnpServiceConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java UpnpServiceConfiguration类的具体用法?Java UpnpServiceConfiguration怎么用?Java UpnpServiceConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UpnpServiceConfiguration类属于org.fourthline.cling包,在下文中一共展示了UpnpServiceConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
protected UpnpServiceConfiguration createConfiguration() {
return new ArchosUpnpServiceConfiguration() {
@Override
public StreamClient createStreamClient() throws InitializationException {
// Use Jetty
return new ArchosStreamClientImpl(
new StreamClientConfigurationImpl(
getSyncProtocolExecutorService()
) {
@Override
public String getUserAgentValue(int majorVersion, int minorVersion) {
// TODO: UPNP VIOLATION: Synology NAS requires User-Agent to contain
// "Android" to return DLNA protocolInfo required to stream to Samsung TV
// see: http://two-play.com/forums/viewtopic.php?f=6&t=81
ServerClientTokens tokens = new ServerClientTokens(majorVersion, minorVersion);
tokens.setOsName("Android");
tokens.setOsVersion(Build.VERSION.RELEASE);
return tokens.toString();
}
}
);
}
};
}
示例2: createServiceConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
private UpnpServiceConfiguration createServiceConfiguration() {
return new DefaultUpnpServiceConfiguration() {
@Override
public DeviceDescriptorBinder getDeviceDescriptorBinderUDA10() {
return new SempDeviceDescriptorBinderImpl(this, sempServerUrl);
}
@Override
public StreamClient createStreamClient() {
// disable the client in order to avoid requesting descriptors from UPnP devices
return null;
}
@Override
public StreamServer createStreamServer(NetworkAddressFactory networkAddressFactory) {
return new org.fourthline.cling.transport.impl.apache.StreamServerImpl(
new StreamServerConfigurationImpl()
);
}
};
}
示例3: createConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
@Override
protected UpnpServiceConfiguration createConfiguration() {
return new AndroidUpnpServiceConfiguration() {
@Override
public int getRegistryMaintenanceIntervalMillis() {
return 20000;
}
@Override
public ServiceType[] getExclusiveServiceTypes() {
return new ServiceType[]{
new UDAServiceType("ContentDirectory") //SwitchPower
};
}
};
}
示例4: getConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
/**
* returns the upnp service configuration
*
* @return the configuration
*/
public UpnpServiceConfiguration getConfiguration() {
if (!isInitialized()) {
return null;
}
return androidUpnpService.getConfiguration();
}
示例5: createConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
@Override
protected UpnpServiceConfiguration createConfiguration() {
return new AndroidUpnpServiceConfiguration() {
@Override
public int getRegistryMaintenanceIntervalMillis() {
return 7000;
}
@Override
public ServiceType[] getExclusiveServiceTypes() {
return new ServiceType[]{new UDAServiceType("ContentDirectory")};
}
};
}
示例6: RouterImpl
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
/**
* @param configuration The configuration used by this router.
* @param protocolFactory The protocol factory used by this router.
*/
@Inject
public RouterImpl(UpnpServiceConfiguration configuration, ProtocolFactory protocolFactory) {
log.info("Creating Router: " + getClass().getName());
this.configuration = configuration;
this.protocolFactory = protocolFactory;
}
示例7: ControlPointImpl
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
@Inject
public ControlPointImpl(UpnpServiceConfiguration configuration, ProtocolFactory protocolFactory, Registry registry) {
log.fine("Creating ControlPoint: " + getClass().getName());
this.configuration = configuration;
this.protocolFactory = protocolFactory;
this.registry = registry;
}
示例8: AndroidRouter
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
public AndroidRouter(UpnpServiceConfiguration configuration,
ProtocolFactory protocolFactory,
Context context) throws InitializationException {
super(configuration, protocolFactory);
this.context = context;
this.wifiManager = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE));
this.networkInfo = NetworkUtils.getConnectedNetworkInfo(context);
// Only register for network connectivity changes if we are not running on emulator
if (!ModelUtil.ANDROID_EMULATOR) {
this.broadcastReceiver = new ConnectivityBroadcastReceiver();
context.registerReceiver(broadcastReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
}
}
示例9: createConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
private UpnpServiceConfiguration createConfiguration() {
return new AndroidUpnpServiceConfiguration() {
@Override public ServiceType[] getExclusiveServiceTypes() {
return new ServiceType[] {
new UDAServiceType("ContentDirectory", 1)
};
}
@Override protected SOAPActionProcessor createSOAPActionProcessor() {
return new RecoveringSOAPActionProcessorImpl() {
@Override
@DebugLog
public void readBody(ActionResponseMessage responseMsg, ActionInvocation actionInvocation) throws UnsupportedDataException {
try {
super.readBody(responseMsg, actionInvocation);
} catch (Exception e) {
//Hack for X_GetFeatureList embedding this in the body
String fixedBody = StringUtils.remove(getMessageBody(responseMsg),"<?xml version=\"1.0\" encoding=\"utf-8\"?>");
responseMsg.setBody(fixedBody);
super.readBody(responseMsg, actionInvocation);
}
}
};
}
@Override public int getRegistryMaintenanceIntervalMillis() {
return 2500;//10000;
}
};
}
示例10: getConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
/**
* returns the upnp service configuration
*
* @return the configuration
*/
public UpnpServiceConfiguration getConfiguration() {
if (!isInitialized()) {
return null;
}
return androidUpnpService.getConfiguration();
}
示例11: createRouter
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
protected AndroidRouter createRouter(UpnpServiceConfiguration configuration,
ProtocolFactory protocolFactory,
Context context) {
return new AndroidRouter(configuration, protocolFactory, context);
}
示例12: getConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
public UpnpServiceConfiguration getConfiguration() {
return upnpService.getConfiguration();
}
示例13: createConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
@Override
protected UpnpServiceConfiguration createConfiguration() {
return new FixedAndroidUpnpServiceConfiguration();
}
示例14: getConfiguration
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
public UpnpServiceConfiguration getConfiguration() {
return configuration;
}
示例15: MockRouter
import org.fourthline.cling.UpnpServiceConfiguration; //导入依赖的package包/类
public MockRouter(UpnpServiceConfiguration configuration,
ProtocolFactory protocolFactory) {
this.configuration = configuration;
this.protocolFactory = protocolFactory;
}