Examples of RepositorySession


Examples of org.apache.archiva.metadata.repository.RepositorySession

    @Override
    public ArchivaRepositoryStatistics getManagedRepositoryStatistics( String repositoryId, String lang )
        throws ArchivaRestServiceException
    {
        RepositorySession repositorySession = repositorySessionFactory.createSession();
        SimpleDateFormat sdf = new SimpleDateFormat( "EEE, d MMM yyyy HH:mm:ss Z", new Locale( lang ) );
        try
        {
            MetadataRepository metadataRepository = repositorySession.getRepository();

            RepositoryStatistics stats = null;
            try
            {
                stats = repositoryStatisticsManager.getLastStatistics( metadataRepository, repositoryId );
            }
            catch ( MetadataRepositoryException e )
            {
                log.warn( "Error retrieving repository statistics: {}", e.getMessage(), e );
            }
            if ( stats != null )
            {
                ArchivaRepositoryStatistics archivaRepositoryStatistics =
                    getModelMapper().map( stats, ArchivaRepositoryStatistics.class );
                archivaRepositoryStatistics.setDuration( archivaRepositoryStatistics.getScanEndTime().getTime()
                                                             - archivaRepositoryStatistics.getScanStartTime().getTime() );
                archivaRepositoryStatistics.setLastScanDate(
                    sdf.format( archivaRepositoryStatistics.getScanEndTime() ) );
                return archivaRepositoryStatistics;
            }

        }
        finally
        {
            if ( repositorySession != null )
            {
                repositorySession.close();
            }
        }
        return null;
    }
View Full Code Here

Examples of org.jbpm.pvm.internal.session.RepositorySession

   
    List<ProcessDefinition> processDefinitions = new ArrayList<ProcessDefinition>();
    for (Map<String, Object> properties: propertyMaps) {
      String deploymentId = properties.get("deploymentDbid").toString();
      String objectName = (String)properties.get("objectName");
      RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
      ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.getObject(deploymentId, objectName);
      processDefinitions.add(processDefinition);
    }
   
    return processDefinitions;
  }
View Full Code Here

Examples of tool.repository.RepositorySession

                file.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ONE);
              } catch (CoreException e) {
                ToolPlugin.showError("Error deleting file markers", e);
              }
              IProject project = file.getProject();
              RepositorySession session = RepositorySession.getRepositorySession(project);
              if (session != null){
               
                if (session.isJustRefreshed())
                  return false;
               
                IFolder plan = (IFolder) file.getParent();
               
                String result;
                try {
                  if (!session.isRepositoryOpen()){
                    session.openRepository();
                  }
                  if (!session.isWorkspaceOpen()){
                    session.openWorkspace();
                  }
                  mon.subTask("Compiling: " + file.getName());
                  result = session.compileComponent(plan.getName(), file.getLocation().toPortableString());
                  if (result != null)
                    processCompileErrors(file, result);
                } catch (NotConnectedException e) {
                  ToolPlugin.showError("Tool System Exception", e);
                } catch (CommandException e) {
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.