Package org.apache.maven.scm.provider.integrity.repository

Examples of org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository


            }
            // Grab the last token (or first token depends how you look at it)
            configPath = tokens[tokens.length - 1];
        }

        return new IntegrityScmProviderRepository( hostName, port, userName, password, configPath, getLogger() );
    }
View Full Code Here


        if ( null == filename || filename.length() == 0 )
        {
            throw new ScmException( "A single filename is required to execute the fileinfo command!" );
        }
        ScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        APISession api = iRepo.getAPISession();
        Commandline shell = new Commandline();
        shell.setWorkingDirectory( workingDirectory );
        shell.setExecutable( "si" );
        shell.createArg().setValue( "memberinfo" );
        shell.createArg().setValue( "--hostname=" + api.getHostName() );
View Full Code Here

        exportDir =
            ( ( null != exportDir && exportDir.length() > 0 ) ? exportDir : fileSet.getBasedir().getAbsolutePath() );
        // Let the user know where we're going to be exporting the files...
        getLogger().info( "Attempting to export files to " + exportDir );
        ExportScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            // Lets set our overall export success flag
            boolean exportSuccess = true;
            // Perform a fresh checkout of each file in the member list...
            List<Member> projectMembers = iRepo.getProject().listFiles( exportDir );
            // Initialize the list of files we actually exported...
            List<ScmFile> scmFileList = new ArrayList<ScmFile>();
            for ( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
            {
                Member siMember = it.next();
                try
                {
                    getLogger().info( "Attempting to export file: " + siMember.getTargetFilePath() + " at revision "
                                          + siMember.getRevision() );
                    siMember.checkout( iRepo.getAPISession() );
                    scmFileList.add( new ScmFile( siMember.getTargetFilePath(), ScmFileStatus.UNKNOWN ) );
                }
                catch ( APIException ae )
                {
                    exportSuccess = false;
View Full Code Here

    public ListScmResult executeListCommand( ScmProviderRepository repository, ScmFileSet fileSet, boolean recursive,
                                             ScmVersion scmVersion )
        throws ScmException
    {
        ListScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        getLogger().info( "Listing all files in project " + iRepo.getConfigruationPath() );
        try
        {
            // Get a listing for all the members in the project...
            List<Member> projectMembers = iRepo.getProject().listFiles( fileSet.getBasedir().getAbsolutePath() );
            // Initialize the list of ScmFile objects for the ListScmResult
            List<ScmFile> scmFileList = new ArrayList<ScmFile>();
            for ( Iterator<Member> it = projectMembers.iterator(); it.hasNext(); )
            {
                Member siMember = it.next();
View Full Code Here

        {
            throw new ScmException( "A single filename is required to execute the unlock command!" );
        }

        ScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            File memberFile = new File( workingDirectory.getAbsoluteFile() + File.separator + filename );
            Response res = siSandbox.unlock( memberFile, filename );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
View Full Code Here

    public RemoveScmResult executeRemoveCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message )
        throws ScmException
    {
        getLogger().info( "Attempting to un-register sandbox in directory " + fileSet.getBasedir().getAbsolutePath() );
        RemoveScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            Response res = siSandbox.drop();
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new RemoveScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
View Full Code Here

        {
            throw new ScmException( "A relative directory path is required to execute this command!" );
        }
        getLogger().info( "Creating subprojects one per directory, as required for " + dirPath );
        MkdirScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Response res = iRepo.getSandbox().createSubproject( dirPath );
            String subProject = res.getWorkItems().next().getResult().getField( "resultant" ).getItem().getDisplayId();
            List<ScmFile> createdDirs = new ArrayList<ScmFile>();
            createdDirs.add( new ScmFile( subProject, ScmFileStatus.ADDED ) );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
View Full Code Here

                                               CommandParameters params )
        throws ScmException
    {
        getLogger().info( "Attempting to connect with the MKS Integrity Server" );
        LoginScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        APISession api = iRepo.getAPISession();
        try
        {
            // First we will establish a connection to the MKS Integrity Server
            Response res = api.connect( iRepo.getHost(), iRepo.getPort(), iRepo.getUser(), iRepo.getPassword() );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new LoginScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );

            // Next we will prepare the Project and Sandbox for the other commands
            Project siProject = new Project( api, iRepo.getConfigruationPath() );
            Sandbox siSandbox = new Sandbox( api, siProject, fileSet.getBasedir().getAbsolutePath() );
            iRepo.setProject( siProject );
            iRepo.setSandbox( siSandbox );
        }
        catch ( APIException aex )
        {
            ExceptionHandler eh = new ExceptionHandler( aex );
            getLogger().error( "MKS API Exception: " + eh.getMessage() );
View Full Code Here

        }
        getLogger().info(
            "Attempting to obtain change log for date range: '" + Sandbox.RLOG_DATEFORMAT.format( startDate ) + "' to '"
                + Sandbox.RLOG_DATEFORMAT.format( endDate ) + "'" );
        ChangeLogScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            result = new ChangeLogScmResult( iRepo.getSandbox().getChangeLog( startDate, endDate ),
                                             new ScmResult( "si rlog", "", "", true ) );
        }
        catch ( APIException aex )
        {
            ExceptionHandler eh = new ExceptionHandler( aex );
View Full Code Here

    @Override
    public UnEditScmResult executeUnEditCommand( ScmProviderRepository repository, ScmFileSet fileSet )
        throws ScmException
    {
        getLogger().info( "Attempting to revert members in sandbox " + fileSet.getBasedir().getAbsolutePath() );
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        UnEditScmResult result;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            Response res = siSandbox.revertMembers();
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new UnEditScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.provider.integrity.repository.IntegrityScmProviderRepository

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.