Package org.bigbluebutton.voiceconf.red5

Examples of org.bigbluebutton.voiceconf.red5.Service


            return null;
        }
    }

    public void output(String[] args) throws SigarException {
        Service service = null;
        String name = args[0];
        String cmd = null;

        if (args.length == 2) {
            cmd = args[1];
        }
       
        try {
            service = new Service(name);
       
            if ((cmd == null) || cmd.equals("state")) {
                service.list(this.out);
            }
            else if (cmd.equals("start")) {
                service.start();
            }
            else if (cmd.equals("stop")) {
                service.stop();
            }
            else if (cmd.equals("pause")) {
                service.pause();
            }
            else if (cmd.equals("resume")) {
                service.resume();
            }
            else if (cmd.equals("delete")) {
                service.delete();
            }
            else if (cmd.equals("restart")) {
                service.stop(0);
                service.start();
            }
            else {
                println("Unsupported service command: " + args[1]);
                println("Valid commands: " + COMMANDS);
            }
        } finally {
            if (service != null) {
                service.close();
            }
        }
    }
View Full Code Here


    public TestService(String name) {
        super(name);
    }

    public void testServiceOpen() throws Exception {
        Service service = new Service("Eventlog");
        service.getConfig();
        service.close();
       
        String dummyName = "DOESNOTEXIST";
        try {
            new Service(dummyName);
            assertTrue(false);
        } catch (Win32Exception e) {
            traceln(dummyName + ": " + e.getMessage());
            assertTrue(true);
        }
View Full Code Here

    public void testDeleteService() throws Exception {
        if (!TEST_DELETE) {
            return;
        }
        Service service = new Service(TEST_NAME);
        service.delete();
    }
View Full Code Here

    BuilderIssues issues = this.allService.getIssues();
    assertTrue( issues.toString(), issues.isValid());
    assertTrue( issues.toString(), issues.isEmpty());

    // Build
    Service s = this.allService.build();

    assertNotNull( s);
    assertTrue( this.allService.isBuilt() );

    assertEquals( allName, s.getName() );
    assertEquals( allType, s.getType() );
    assertEquals( allBaseUri, s.getBaseUri() );

    assertEquals( odapService, s.getServiceByName( odapName ) );
    assertEquals( wcsService, s.getServiceByName( wcsName ) );
    assertEquals( wmsService, s.getServiceByName( wmsName ) );

    assertEquals( odapService, s.findServiceByNameGlobally( odapName ) );
    assertEquals( wcsService, s.findServiceByNameGlobally( wcsName ) );
    assertEquals( wmsService, s.findServiceByNameGlobally( wmsName ) );

    List<Service> services = s.getServices();
    assertFalse( services.isEmpty() );
    assertEquals( 3, services.size() );

    assertEquals( odapService, services.get( 0 ) );
    assertEquals( wcsService, services.get( 1 ) );
    assertEquals( wmsService, services.get( 2 ) );

    // Test that Service methods succeed after build.
    List<Property> propList = s.getProperties();
    assertEquals( 2, propList.size() );
    Property prop1 = propList.get( 0 );
    Property prop2 = propList.get( 1 );

    assertEquals( "propName1", prop1.getName() );
View Full Code Here

TOP

Related Classes of org.bigbluebutton.voiceconf.red5.Service

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.