當前位置: 首頁>>代碼示例>>Java>>正文


Java Capabilities類代碼示例

本文整理匯總了Java中org.onvif.ver10.schema.Capabilities的典型用法代碼示例。如果您正苦於以下問題:Java Capabilities類的具體用法?Java Capabilities怎麽用?Java Capabilities使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Capabilities類屬於org.onvif.ver10.schema包,在下文中一共展示了Capabilities類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import org.onvif.ver10.schema.Capabilities; //導入依賴的package包/類
/**
 * Initalizes the addresses used for SOAP messages and to get the internal
 * IP, if given IP is a proxy.
 * 
 * @throws ConnectException
 *             Get thrown if device doesn't give answers to
 *             GetCapabilities()
 * @throws SOAPException
 */
protected void init() throws ConnectException, SOAPException {
    BindingProvider deviceServicePort = (BindingProvider) new DeviceService().getDevicePort();
    this.device = getServiceProxy(deviceServicePort, deviceUri).create(Device.class);
    
    resetSystemDateAndTime();
    
    Capabilities capabilities = this.device.getCapabilities(Arrays.asList(CapabilityCategory.ALL));
    if (capabilities == null) {
        throw new ConnectException("Capabilities not reachable.");
    }

    //String localDeviceUri = capabilities.getDevice().getXAddr();

    if (capabilities.getMedia() != null && capabilities.getMedia().getXAddr() != null) {
        this.media = new MediaService().getMediaPort();
        this.media = getServiceProxy((BindingProvider) media, capabilities.getMedia().getXAddr()).create(Media.class);
    }

    if (capabilities.getPTZ() != null && capabilities.getPTZ().getXAddr() != null) {
        this.ptz = new PtzService().getPtzPort();
        this.ptz = getServiceProxy((BindingProvider) ptz, capabilities.getPTZ().getXAddr()).create(PTZ.class);
    }

    if (capabilities.getImaging() != null && capabilities.getImaging().getXAddr() != null) {
        this.imaging = new ImagingService().getImagingPort();
        this.imaging = getServiceProxy((BindingProvider) imaging, capabilities.getImaging().getXAddr()).create(ImagingPort.class);
    }

    if (capabilities.getEvents() != null && capabilities.getEvents().getXAddr() != null) {
        this.events = new EventService().getEventPort();
        this.events = getServiceProxy((BindingProvider) events, capabilities.getEvents().getXAddr()).create(EventPortType.class);
    }
}
 
開發者ID:fpompermaier,項目名稱:onvif,代碼行數:43,代碼來源:OnvifDevice.java

示例2: init

import org.onvif.ver10.schema.Capabilities; //導入依賴的package包/類
/**
 * Initalizes the addresses used for SOAP messages and to get the internal
 * IP, if given IP is a proxy.
 * 
 * @throws ConnectException
 *             Get thrown if device doesn't give answers to
 *             GetCapabilities()
 * @throws SOAPException 
 */
protected void init() throws ConnectException, SOAPException {
    Capabilities capabilities = getDevices().getCapabilities();

    if (capabilities == null) {
        throw new ConnectException("Capabilities not reachable.");
    }

    String localDeviceUri = capabilities.getDevice().getXAddr();

    if (localDeviceUri.startsWith("http://")) {
        originalIp = localDeviceUri.replace("http://", "");
        originalIp = originalIp.substring(0, originalIp.indexOf('/'));
    }
    else {
        logger.error("Unknown/Not implemented local procotol!");
    }
        
    if (!originalIp.equals(HOST_IP)) {
        isProxy = true;
    }

    if (capabilities.getMedia() != null && capabilities.getMedia().getXAddr() != null) {
        serverMediaUri = replaceLocalIpWithProxyIp(capabilities.getMedia().getXAddr());
    }

    if (capabilities.getPTZ() != null && capabilities.getPTZ().getXAddr() != null) {
        serverPtzUri = replaceLocalIpWithProxyIp(capabilities.getPTZ().getXAddr());
    }
    
    if (capabilities.getImaging() != null && capabilities.getImaging().getXAddr() != null) {
        serverImagingUri = replaceLocalIpWithProxyIp(capabilities.getImaging().getXAddr());
    }

    if (capabilities.getMedia() != null && capabilities.getEvents().getXAddr() != null) {
        serverEventsUri = replaceLocalIpWithProxyIp(capabilities.getEvents().getXAddr());
    }
}
 
開發者ID:milg0,項目名稱:onvif-java-lib,代碼行數:47,代碼來源:OnvifDevice.java

示例3: init

import org.onvif.ver10.schema.Capabilities; //導入依賴的package包/類
/**
 * Initalizes the addresses used for SOAP messages and to get the internal
 * IP, if given IP is a proxy.
 * 
 * @throws Exception
 */
protected void init() throws Exception {

    this.client = new SoapClient(this);
    this.devMngtService = new DeviceManagementService(this,client, "http://" + domain + "/onvif/device_service");
    Capabilities capabilities = getDeviceManagementService().getCapabilities();

    if (capabilities == null) {
        throw new ConnectException("Capabilities not reachable.");
    }

    String localDeviceUri = capabilities.getDevice().getXAddr();

    if (localDeviceUri.startsWith("http://")) {
        returnedDomain = localDeviceUri.replace("http://", "");
        returnedDomain = returnedDomain.substring(0, returnedDomain.indexOf('/'));
    } else {
        throw new ConnectException("Unknown protocol");
    }

    if (!returnedDomain.equals(domain)) {
        isProxy = true;
    }

    if (capabilities.getMedia() != null && capabilities.getMedia().getXAddr() != null) {
        this.mediaService = new MediaService(this,client, replaceLocalIpWithProxyIp(capabilities.getMedia().getXAddr()));
    }

    if (capabilities.getPTZ() != null && capabilities.getPTZ().getXAddr() != null) {
        this.ptzService = new PtzService(this,client, replaceLocalIpWithProxyIp(capabilities.getPTZ().getXAddr()));
    }

    if (capabilities.getImaging() != null && capabilities.getImaging().getXAddr() != null) {
        this.imagingService = new ImagingService(this,client,
                replaceLocalIpWithProxyIp(capabilities.getImaging().getXAddr()));
    }

    // event uri - not used currently
    // if (capabilities.getMedia() != null &&
    // capabilities.getEvents().getXAddr() != null) {
    // replaceLocalIpWithProxyIp(capabilities.getEvents().getXAddr());
    // }
}
 
開發者ID:D2Edev,項目名稱:onvifjava,代碼行數:49,代碼來源:OnvifDevice.java

示例4: getCapabilities

import org.onvif.ver10.schema.Capabilities; //導入依賴的package包/類
public Capabilities getCapabilities() throws Exception {
    GetCapabilitiesResponse response = client.processRequest(new GetCapabilities(), GetCapabilitiesResponse.class,
            serviceUrl, false);
    return response.getCapabilities();
}
 
開發者ID:D2Edev,項目名稱:onvifjava,代碼行數:6,代碼來源:DeviceManagementService.java

示例5: getCapabilities

import org.onvif.ver10.schema.Capabilities; //導入依賴的package包/類
/**
 * Ruft den Wert der capabilities-Eigenschaft ab.
 * 
 * @return possible object is {@link Capabilities }
 * 
 */
public Capabilities getCapabilities() {
    return capabilities;
}
 
開發者ID:D2Edev,項目名稱:onvifjava,代碼行數:10,代碼來源:GetCapabilitiesResponse.java

示例6: setCapabilities

import org.onvif.ver10.schema.Capabilities; //導入依賴的package包/類
/**
 * Legt den Wert der capabilities-Eigenschaft fest.
 * 
 * @param value
 *            allowed object is {@link Capabilities }
 * 
 */
public void setCapabilities(Capabilities value) {
    this.capabilities = value;
}
 
開發者ID:D2Edev,項目名稱:onvifjava,代碼行數:11,代碼來源:GetCapabilitiesResponse.java

示例7: getCapabilities

import org.onvif.ver10.schema.Capabilities; //導入依賴的package包/類
/**
 * Recupera il valore della proprietà capabilities.
 * 
 * @return
 *     possible object is
 *     {@link Capabilities }
 *     
 */
public Capabilities getCapabilities() {
    return capabilities;
}
 
開發者ID:fpompermaier,項目名稱:onvif,代碼行數:12,代碼來源:GetCapabilitiesResponse.java

示例8: setCapabilities

import org.onvif.ver10.schema.Capabilities; //導入依賴的package包/類
/**
 * Imposta il valore della proprietà capabilities.
 * 
 * @param value
 *     allowed object is
 *     {@link Capabilities }
 *     
 */
public void setCapabilities(Capabilities value) {
    this.capabilities = value;
}
 
開發者ID:fpompermaier,項目名稱:onvif,代碼行數:12,代碼來源:GetCapabilitiesResponse.java


注:本文中的org.onvif.ver10.schema.Capabilities類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。