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


Java ServiceFactory.getService方法代碼示例

本文整理匯總了Java中com.huawei.esdk.fusioncompute.local.ServiceFactory.getService方法的典型用法代碼示例。如果您正苦於以下問題:Java ServiceFactory.getService方法的具體用法?Java ServiceFactory.getService怎麽用?Java ServiceFactory.getService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.huawei.esdk.fusioncompute.local.ServiceFactory的用法示例。


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

示例1: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    
    ClientProviderBean bean = new ClientProviderBean();
    bean.setProtocol("https");
    bean.setServerIp("110.168.10.6");
    bean.setServerPort("7443");
    bean.setUserName("suxin");
    
    AuthenticateResource a = null;
    a = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    FCSDKResponse<LoginResp> r = a.login("suxin", "[email protected]");
    
    alarmResource = ServiceFactory.getService(AlarmResource.class, bean);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_cli,代碼行數:19,代碼來源:AlarmResourceTest.java

示例2: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    
    //        System.setProperty("javax.net.ssl.trustStore", "D:\\workspace\\esdk_fc_neadp_1.3_native_java\\src\\main\\java");
    ClientProviderBean bean = new ClientProviderBean();
    bean.setProtocol("https");
    bean.setServerIp("110.168.10.8");
    bean.setServerPort("7443");
    bean.setUserName("");
    
    AuthenticateResource a = null;
    a = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    FCSDKResponse<LoginResp> r = a.login("suxin", "[email protected]");
    
    System.out.println(r.getErrorCode());
    System.out.println(gson.toJson(r));
    
    portGroupResource = ServiceFactory.getService(PortGroupResource.class, bean);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_native_java,代碼行數:23,代碼來源:PortGroupResourceTest.java

示例3: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    
    //        System.setProperty("javax.net.ssl.trustStore", "D:\\workspace\\esdk_fc_neadp_1.3_native_java\\src\\main\\java");
    ClientProviderBean bean = new ClientProviderBean();
    bean.setProtocol("https");
    bean.setServerIp("110.168.10.6");
    bean.setServerPort("7443");
    bean.setUserName("suxin");
    
    AuthenticateResource a = null;
    a = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    FCSDKResponse<LoginResp> r = a.login("suxin", "[email protected]");
    
    System.out.println(r.getErrorCode());
    System.out.println(gson.toJson(r));
    
    portGroupResource = ServiceFactory.getService(PortGroupResource.class, bean);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_cli,代碼行數:23,代碼來源:PortGroupResourceTest.java

示例4: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    
    //        System.setProperty("javax.net.ssl.trustStore", "D:\\workspace\\esdk_fc_neadp_1.3_native_java\\src\\main\\java");
    ClientProviderBean bean = new ClientProviderBean();
    bean.setProtocol("https");
    bean.setServerIp("110.168.10.8");
    bean.setServerPort("7443");
    bean.setUserName("");
    
    AuthenticateResource a = null;
    a = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    FCSDKResponse<LoginResp> r = a.login("suxin", "[email protected]");
    
    System.out.println(System.getProperty("java.home"));
    System.out.println(r.getErrorCode());
    System.out.println(gson.toJson(r));
    
    dataStorageResource = ServiceFactory.getService(DataStorageResource.class, bean);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_native_java,代碼行數:24,代碼來源:DataStorageResourceTest.java

示例5: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
    public static void setUpBeforeClass()
    {
        
        //System.setProperty("javax.net.ssl.trustStore", "D:\\workspace\\esdk_fc_neadp_1.3_native_java\\src\\main\\java");
        ClientProviderBean bean = new ClientProviderBean();
        bean.setProtocol("https");
        bean.setServerIp("110.168.10.8");
        bean.setServerPort("7443");
        bean.setUserName("");
        
//        AuthenticateResource authenticateResource = null;
        authenticateResource = ServiceFactory.getService(AuthenticateResource.class, bean);
        
        FCSDKResponse<LoginResp> r = authenticateResource.login("suxin", "[email protected]");
        
        System.out.println(r.getErrorCode());
        System.out.println(gson.toJson(r));
        volumeResource = ServiceFactory.getService(VolumeResource.class, bean);
        
    }
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_native_java,代碼行數:22,代碼來源:VolumeResourceTest.java

示例6: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    
    //        System.setProperty("javax.net.ssl.trustStore", "D:\\workspace\\esdk_fc_neadp_1.3_native_java\\src\\main\\java");
    ClientProviderBean bean = new ClientProviderBean();
    bean.setProtocol("https");
    bean.setServerIp("110.168.10.8");
    bean.setServerPort("7443");
    bean.setUserName("");
    
    AuthenticateResource a = null;
    a = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    FCSDKResponse<LoginResp> r = a.login("suxin", "[email protected]");
    
    System.out.println(r.getErrorCode());
    System.out.println(gson.toJson(r));
    alarmResource = ServiceFactory.getService(AlarmResource.class, bean);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_native_java,代碼行數:22,代碼來源:AlarmResourceTest.java

示例7: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    ClientProviderBean clientProvider = new ClientProviderBean();
    clientProvider.setServerIp("110.168.10.8");
    clientProvider.setServerPort("7443");
    clientProvider.setProtocol("https");
    AuthenticateResource a = ServiceFactory.getService(AuthenticateResource.class, clientProvider);
    
    FCSDKResponse<LoginResp> r = a.login("duhuadong","[email protected]");
    
    System.out.println(System.getProperty("java.home"));
    System.out.println(r.getErrorCode());
    System.out.println(g.toJson(r));
    
    
     service = ServiceFactory.getService(ClusterResource.class, clientProvider);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_native_java,代碼行數:20,代碼來源:ClusterResourceTest.java

示例8: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    
    //        System.setProperty("javax.net.ssl.trustStore", "D:\\workspace\\esdk_fc_neadp_1.3_native_java\\src\\main\\java");
    ClientProviderBean bean = new ClientProviderBean();
    bean.setProtocol("https");
    bean.setServerIp("112.168.10.62");
    bean.setServerPort("7443");
    //        bean.setUserName("suxin");
    
    AuthenticateResource a = null;
    a = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    FCSDKResponse<LoginResp> r = a.login("suxin", "[email protected]");
    
    //        System.out.println(System.getProperty("java.home"));
    System.out.println(r.getErrorCode());
    System.out.println(gson.toJson(r));
    
    dataStorageResource = ServiceFactory.getService(DataStorageResource.class, bean);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_cli,代碼行數:24,代碼來源:DataStorageResourceTest.java

示例9: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    
    //        System.setProperty("javax.net.ssl.trustStore", "D:\\workspace\\esdk_fc_neadp_1.3_native_java\\src\\main\\java");
    ClientProviderBean bean = new ClientProviderBean();
    bean.setProtocol("https");
    bean.setServerIp("110.168.10.8");
    bean.setServerPort("7443");
    bean.setUserName("");
    
    AuthenticateResource a = null;
    a = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    FCSDKResponse<LoginResp> r = a.login("duhuadong", "[email protected]");
    
    System.out.println(r.getErrorCode());
    System.out.println(gson.toJson(r));
    
    portGroupResource = ServiceFactory.getService(PortGroupResource.class, bean);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_cli,代碼行數:23,代碼來源:PortGroupResourceTest.java

示例10: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
{
    System.setProperty("javax.net.ssl.trustStore", "D:\\IDE\\worksapce_maven\\esdk_fc_neadp_1.3_native_java\\src\\main\\java");
    ClientProviderBean clientProvider = new ClientProviderBean();
    clientProvider.setServerIp("110.168.10.6");
    clientProvider.setServerPort("7443");
    clientProvider.setProtocol("https");
    AuthenticateResource a = ServiceFactory.getService(AuthenticateResource.class, clientProvider);
    
    FCSDKResponse<LoginResp> r = a.login("zhangsan","[email protected]");
    
    System.out.println(System.getProperty("java.home"));
    System.out.println(r.getErrorCode());
    System.out.println(g.toJson(r));
    
    
     service = ServiceFactory.getService(MonitorResource.class, clientProvider);
    
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_cli,代碼行數:21,代碼來源:MonitorResourceTest.java

示例11: intialService

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
public static void intialService()
{
    //獲取服務器配置信息
    bean = getClientProviderBean();
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    authenticateResource = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    portGroupResource = ServiceFactory.getService(PortGroupResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    dataStorageResource = ServiceFactory.getService(DataStorageResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    hostResource = ServiceFactory.getService(HostResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    clusterResource = ServiceFactory.getService(ClusterResource.class, bean);
   
    //從native Jar包的ServiceFactory類中獲取相應的服務
    siteResource = ServiceFactory.getService(SiteResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    dVSwitchResource = ServiceFactory.getService(DVSwitchResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    vmResource = ServiceFactory.getService(VmResource.class, bean);
    
    LOGGER.info("Service initialization Complete!");
}
 
開發者ID:Huawei,項目名稱:eSDK_FC_SDK_Java,代碼行數:32,代碼來源:ServiceManageFactory.java

示例12: intialService

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
public static void intialService()
{
    //獲取服務器配置信息
    bean = getClientProviderBean();
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    monitorResource=ServiceFactory.getService(MonitorResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    authenticateResource = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    portGroupResource = ServiceFactory.getService(PortGroupResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    dataStorageResource = ServiceFactory.getService(DataStorageResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    hostResource = ServiceFactory.getService(HostResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    clusterResource = ServiceFactory.getService(ClusterResource.class, bean);
   
    //從native Jar包的ServiceFactory類中獲取相應的服務
    siteResource = ServiceFactory.getService(SiteResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    dVSwitchResource = ServiceFactory.getService(DVSwitchResource.class, bean);
    
    //從native Jar包的ServiceFactory類中獲取相應的服務
    vmResource = ServiceFactory.getService(VmResource.class, bean);
    
    LOGGER.info("Service initialization Complete!");
}
 
開發者ID:Huawei,項目名稱:eSDK_FC_SDK_Java,代碼行數:35,代碼來源:ServiceManageFactory.java

示例13: main

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
public static void main(String[] args) {
    //�趨����������
    ClientProviderBean clientProvider = new ClientProviderBean();
    //�趨����������_�趨������IP
    clientProvider.setServerIp("172.22.32.56");
    //�趨����������_�趨�������˿ں�
    clientProvider.setServerPort("7443");
    //��ʼ���û���Դʵ��
    AuthenticateResource auth = ServiceFactory.getService(AuthenticateResource.class, clientProvider);
    //���û������û�������Ϊ�������������AuthenticateResource�ṩ��login����������û��ĵ�¼
    FCSDKResponse<LoginResp> resp = auth.login("test001", "[email protected]");
}
 
開發者ID:Huawei,項目名稱:eSDK_FC_SDK_Java,代碼行數:13,代碼來源:Test.java

示例14: setUpBeforeClass

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@BeforeClass
public static void setUpBeforeClass()
    throws Exception
{
    clientProvider = new ClientProviderBean();
    clientProvider.setUserName("zhangsan");
    clientProvider.setServerIp("110.168.10.6");
    clientProvider.setServerPort("7443");
    clientProvider.setProtocol("https");
    
    a  = ServiceFactory.getService(AuthenticateResource.class, clientProvider);
    String userName = "zhangsan";
    String password = "[email protected]";
    FCSDKResponse<LoginResp> loginResp = a.login(userName, password);
    if (!"00000000".equals(loginResp.getErrorCode()))
    {
        System.out.println("login error code:" + loginResp.getErrorCode() + ", desc:" + loginResp.getErrorDes());
        throw new Exception("authenticate failed!");
    }
    System.out.println("UserId:" + loginResp.getResult().getUserId());
    System.out.println("UserName:" + loginResp.getResult().getUserName());
    System.out.println("RightType:" + loginResp.getResult().getRightType());
    System.out.println("Validity:" + loginResp.getResult().getValidity());
    System.out.println("PrivilegeIds:" + loginResp.getResult().getPrivilegeIds());
    System.out.println("RoleList:" + loginResp.getResult().getRoleList());
    instance = (EquipmentResource)ServiceFactory.getService(EquipmentResource.class, clientProvider);
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_cli,代碼行數:28,代碼來源:EquipmentResourceTest.java

示例15: testAuthenticate

import com.huawei.esdk.fusioncompute.local.ServiceFactory; //導入方法依賴的package包/類
@Before
public void testAuthenticate()
{
    ClientProviderBean bean = new ClientProviderBean();
    bean.setProtocol("https");
    bean.setServerIp("172.22.4.4");
    bean.setServerPort("7443");
    
    AuthenticateResource a = null;
    a = ServiceFactory.getService(AuthenticateResource.class, bean);
    
    FCSDKResponse<LoginResp> r = a.login("fc01", "[email protected]");
    instance = ServiceFactory.getService(VmResource.class, bean);
    site = ServiceFactory.getService(SiteResource.class, bean);
}
 
開發者ID:eSDK,項目名稱:esdk_cloud_fc_cli,代碼行數:16,代碼來源:VmResourceTest.java


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