Examples of AdministrationService


Examples of org.apache.archiva.web.xmlrpc.api.AdministrationService

        info.setPassword( args[2] );
        info.setTimeZone( TimeZone.getDefault() );

        try
        {
            AdministrationService adminService = binder.bind( AdministrationService.class, new URL( args[0] ), info );
            PingService pingService = binder.bind( PingService.class, new URL( args[0] ), info );
                      
            System.out.println( "Ping : " + pingService.ping() );
           
            List<ManagedRepository> managedRepos = adminService.getAllManagedRepositories();
           
            System.out.println( "\n******** Managed Repositories ********" );
            for( ManagedRepository managedRepo : managedRepos )
            {
                System.out.println( "=================================" );
                System.out.println( "Id: " + managedRepo.getId() );
                System.out.println( "Name: " + managedRepo.getName() );
                System.out.println( "Layout: " + managedRepo.getLayout() );
                System.out.println( "URL: " + managedRepo.getUrl() );
                System.out.println( "Releases: " + managedRepo.isReleases() );
                System.out.println( "Snapshots: " + managedRepo.isSnapshots() );
            }               
           
            System.out.println( "\n******** Remote Repositories ********" );
            List<RemoteRepository> remoteRepos = adminService.getAllRemoteRepositories();
            for( RemoteRepository remoteRepo : remoteRepos )
            {
                System.out.println( "=================================" );
                System.out.println( "Id: " + remoteRepo.getId() );
                System.out.println( "Name: " + remoteRepo.getName() );
                System.out.println( "Layout: " + remoteRepo.getLayout() );
                System.out.println( "URL: " + remoteRepo.getUrl() );
            }
           
            System.out.println( "\n******** Repository Consumers ********" );
            List<String> repoConsumers = adminService.getAllRepositoryConsumers();
            for( String consumer : repoConsumers )
            {
                System.out.println( consumer );
            }
           
            Boolean success = adminService.configureRepositoryConsumer( "internal", "repository-purge", true );
            System.out.println( "\nConfigured repo consumer 'repository-purge' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.executeRepositoryScanner( "internal" );
            System.out.println( "\nExecuted repo scanner of repository 'internal' : " +
                ( (Boolean) success ).booleanValue() );

            /** add, get and delete managed repo **/
            /*
 
View Full Code Here

Examples of org.apache.archiva.web.xmlrpc.api.AdministrationService

        Binder binder = new DefaultBinder();
       
        try
        {
            AuthenticationInfo authnInfo = new AuthenticationInfo( args[1], args[2] );
            AdministrationService adminService = binder.bind( AdministrationService.class, new URL( args[0] ), authnInfo );
            PingService pingService = binder.bind( PingService.class, new URL( args[0] ), authnInfo );
                      
            System.out.println( "Ping : " + pingService.ping() );
           
            List<ManagedRepository> managedRepos = adminService.getAllManagedRepositories();
           
            System.out.println( "\n******** Managed Repositories ********" );
            for( ManagedRepository managedRepo : managedRepos )
            {
                System.out.println( "=================================" );
                System.out.println( "Id: " + managedRepo.getId() );
                System.out.println( "Name: " + managedRepo.getName() );
                System.out.println( "Layout: " + managedRepo.getLayout() );
                System.out.println( "URL: " + managedRepo.getUrl() );
                System.out.println( "Releases: " + managedRepo.isReleases() );
                System.out.println( "Snapshots: " + managedRepo.isSnapshots() );
            }               
           
            System.out.println( "\n******** Remote Repositories ********" );
            List<RemoteRepository> remoteRepos = adminService.getAllRemoteRepositories();
            for( RemoteRepository remoteRepo : remoteRepos )
            {
                System.out.println( "=================================" );
                System.out.println( "Id: " + remoteRepo.getId() );
                System.out.println( "Name: " + remoteRepo.getName() );
                System.out.println( "Layout: " + remoteRepo.getLayout() );
                System.out.println( "URL: " + remoteRepo.getUrl() );
            }
           
            System.out.println( "\n******** Repository Consumers ********" );
            List<String> repoConsumers = adminService.getAllRepositoryConsumers();
            for( String consumer : repoConsumers )
            {
                System.out.println( consumer );
            }
           
            System.out.println( "\n******** Database Consumers ********" );
            List<String> dbConsumers = adminService.getAllDatabaseConsumers();
            for( String consumer : dbConsumers )
            {
                System.out.println( consumer );
            }
           
            Boolean success = adminService.configureRepositoryConsumer( "internal", "repository-purge", true );
            System.out.println( "\nConfigured repo consumer 'repository-purge' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.configureDatabaseConsumer( "update-db-bytecode-stats", false );
            System.out.println( "\nConfigured db consumer 'update-db-bytecode-stats' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.executeRepositoryScanner( "internal" );
            System.out.println( "\nExecuted repo scanner of repository 'internal' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.executeDatabaseScanner();
            System.out.println( "\nExecuted database scanner : " + ( (Boolean) success ).booleanValue() );
          
            /* delete artifact */
            /*
             * NOTE: before enabling & invoking deleteArtifact, make sure that the repository and artifact exists first!
View Full Code Here

Examples of org.apache.archiva.web.xmlrpc.api.AdministrationService

        Binder binder = new DefaultBinder();
       
        try
        {
            AuthenticationInfo authnInfo = new AuthenticationInfo( args[1], args[2] );
            AdministrationService adminService = binder.bind( AdministrationService.class, new URL( args[0] ), authnInfo );
            List<ManagedRepository> managedRepos = adminService.getAllManagedRepositories();
           
            System.out.println( "\n******** Managed Repositories ********" );
            for( ManagedRepository managedRepo : managedRepos )
            {
                System.out.println( "=================================" );
                System.out.println( "Id: " + managedRepo.getId() );
                System.out.println( "Name: " + managedRepo.getName() );
                System.out.println( "Layout: " + managedRepo.getLayout() );
                System.out.println( "URL: " + managedRepo.getUrl() );
                System.out.println( "Releases: " + managedRepo.isReleases() );
                System.out.println( "Snapshots: " + managedRepo.isSnapshots() );
            }               
           
            System.out.println( "\n******** Remote Repositories ********" );
            List<RemoteRepository> remoteRepos = adminService.getAllRemoteRepositories();
            for( RemoteRepository remoteRepo : remoteRepos )
            {
                System.out.println( "=================================" );
                System.out.println( "Id: " + remoteRepo.getId() );
                System.out.println( "Name: " + remoteRepo.getName() );
                System.out.println( "Layout: " + remoteRepo.getLayout() );
                System.out.println( "URL: " + remoteRepo.getUrl() );
            }
           
            System.out.println( "\n******** Repository Consumers ********" );
            List<String> repoConsumers = adminService.getAllRepositoryConsumers();
            for( String consumer : repoConsumers )
            {
                System.out.println( consumer );
            }
           
            System.out.println( "\n******** Database Consumers ********" );
            List<String> dbConsumers = adminService.getAllDatabaseConsumers();
            for( String consumer : dbConsumers )
            {
                System.out.println( consumer );
            }
           
            Boolean success = adminService.configureRepositoryConsumer( "internal", "repository-purge", true );
            System.out.println( "\nConfigured repo consumer 'repository-purge' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.configureDatabaseConsumer( "update-db-bytecode-stats", false );
            System.out.println( "\nConfigured db consumer 'update-db-bytecode-stats' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.executeRepositoryScanner( "internal" );
            System.out.println( "\nExecuted repo scanner of repository 'internal' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.executeDatabaseScanner();
            System.out.println( "\nExecuted database scanner : " + ( (Boolean) success ).booleanValue() );
          
            /* delete artifact */
            /*
             * NOTE: before enabling & invoking deleteArtifact, make sure that the repository and artifact exists first!
View Full Code Here

Examples of org.apache.archiva.web.xmlrpc.api.AdministrationService

        Binder binder = new DefaultBinder();
       
        try
        {
            AuthenticationInfo authnInfo = new AuthenticationInfo( args[1], args[2] );
            AdministrationService adminService = binder.bind( AdministrationService.class, new URL( args[0] ), authnInfo );
            List<ManagedRepository> managedRepos = adminService.getAllManagedRepositories();
           
            System.out.println( "\n******** Managed Repositories ********" );
            for( ManagedRepository managedRepo : managedRepos )
            {
                System.out.println( "=================================" );
                System.out.println( "Id: " + managedRepo.getId() );
                System.out.println( "Name: " + managedRepo.getName() );
                System.out.println( "Layout: " + managedRepo.getLayout() );
                System.out.println( "URL: " + managedRepo.getUrl() );
                System.out.println( "Releases: " + managedRepo.isReleases() );
                System.out.println( "Snapshots: " + managedRepo.isSnapshots() );
            }               
           
            System.out.println( "\n******** Remote Repositories ********" );
            List<RemoteRepository> remoteRepos = adminService.getAllRemoteRepositories();
            for( RemoteRepository remoteRepo : remoteRepos )
            {
                System.out.println( "=================================" );
                System.out.println( "Id: " + remoteRepo.getId() );
                System.out.println( "Name: " + remoteRepo.getName() );
                System.out.println( "Layout: " + remoteRepo.getLayout() );
                System.out.println( "URL: " + remoteRepo.getUrl() );
            }
           
            System.out.println( "\n******** Repository Consumers ********" );
            List<String> repoConsumers = adminService.getAllRepositoryConsumers();
            for( String consumer : repoConsumers )
            {
                System.out.println( consumer );
            }
           
            System.out.println( "\n******** Database Consumers ********" );
            List<String> dbConsumers = adminService.getAllDatabaseConsumers();
            for( String consumer : dbConsumers )
            {
                System.out.println( consumer );
            }
           
            Boolean success = adminService.configureRepositoryConsumer( "internal", "repository-purge", true );
            System.out.println( "\nConfigured repo consumer 'repository-purge' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.configureDatabaseConsumer( "update-db-bytecode-stats", false );
            System.out.println( "\nConfigured db consumer 'update-db-bytecode-stats' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.executeRepositoryScanner( "internal" );
            System.out.println( "\nExecuted repo scanner of repository 'internal' : " +
                ( (Boolean) success ).booleanValue() );
           
            success = adminService.executeDatabaseScanner();
            System.out.println( "\nExecuted database scanner : " + ( (Boolean) success ).booleanValue() );
          
            /* delete artifact */
            /*
             * NOTE: before enabling & invoking deleteArtifact, make sure that the repository and artifact exists first!
View Full Code Here

Examples of org.openmrs.api.AdministrationService

    @Before
    public void setUp() throws Exception {
        String xml = (new TestUtil()).loadXmlFromFile(XML_HTML_FORM_ENTRY_REGIMEN_UTIL_TEST_DATASET);

        // used to avoid lock timeout on GP#order.nextOrderNumberSeed
        AdministrationService administrationService = mock(AdministrationService.class);

        when(administrationService.getGlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_STANDARD_DRUG_REGIMENS))
                .thenReturn(xml);

        when(administrationService.getGlobalProperty("")).thenAnswer(new Answer<String>() {
            @Override
            public String answer(InvocationOnMock invocationOnMock) throws Throwable {
                return "" + orderNumberCounter++;
            }
        });
View Full Code Here

Examples of org.palo.viewapi.services.AdministrationService

    AuthUser admin = userSession.getUser();
    if(admin == null)
      return new XObject[0];
   
    String type = parent.getType();   
    AdministrationService adminService =
      ServiceProvider.getAdministrationService(admin);
   
    XObject[] ret;
   
    if(type.equals(XConstants.TYPE_ACCOUNTS_NODE))
View Full Code Here

Examples of org.palo.viewapi.services.AdministrationService

    }
    return xRoles.toArray(new XRole[0]);
  }

  public Boolean [] hasRoles(String sessionId, XUser xuser, String [] roles) throws SessionExpiredException {
    AdministrationService adminService = ServiceProvider
        .getAdministrationService(getLoggedInUser(sessionId));
    Boolean [] result = new Boolean[roles.length];
    for (int i = 0; i < roles.length; i++) {
      result[i] = false;
    }
    User user = getNative(sessionId, xuser);
    for (Role r: adminService.getRoles(user)) {
      for (int i = 0; i < roles.length; i++) {
        if (r.getName().equalsIgnoreCase(roles[i])) {
          result[i] = true;
        }
      }
    }
    for (Group g: adminService.getGroups(user)) {
      for (Role r: g.getRoles()) {
        for (int i = 0; i < roles.length; i++) {
          if (r.getName().equalsIgnoreCase(roles[i])) {
            result[i] = true;
          }
View Full Code Here

Examples of org.palo.viewapi.services.AdministrationService

    }
    return result;
  }

  public XUser[] getUsers(String sessionId) throws SessionExpiredException {
    AdministrationService adminService = ServiceProvider
        .getAdministrationService(getLoggedInUser(sessionId));
    List<XUser> xUsers= new ArrayList<XUser>();
    for(User usr : adminService.getUsers()) {
      XUser xUser = (XUser)XConverter.createX(usr);
      xUsers.add(xUser);
    }
    return xUsers.toArray(new XUser[0]);
    //TODO throw exception or return empty array !?!?!?
View Full Code Here

Examples of org.palo.viewapi.services.AdministrationService

    return xUsers.toArray(new XUser[0]);
    //TODO throw exception or return empty array !?!?!?
  }

  public Boolean hasAccount(String sessionId, XConnection con) throws SessionExpiredException {
    AdministrationService adminService = ServiceProvider.
      getAdministrationService(getLoggedInUser(sessionId));
    for (Account acc: adminService.getAccounts()) {
      if (acc.getConnection() != null && acc.getConnection().getId().equals(con.getId())) {
        return true;
      }
    }
    return false;
View Full Code Here

Examples of org.palo.viewapi.services.AdministrationService

    if (acc != null) {
      if (acc.getUser() != null) {
        if (acc.getUser().getId().equals(user.getId())) {
          // This account needs to be changed.
          AuthUser admin = getLoggedInUser(sessionId);
          AdministrationService admService = ServiceProvider.getAdministrationService(admin);         
          User admUser = admService.getUser(admin.getId());         
          if (!admUser.getId().equals(user.getId())) {
            for (Account a: admService.getAccounts(admUser)) {
              if (a.getConnection().getId().equals(acc.getConnection().getId())) {
                return a;
              }
            }
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.