Package com.starbase.starteam

Examples of com.starbase.starteam.Server


    public void execute() throws BuildException {
        log("DEPRECATED - The starteam task is deprecated.  Use stcheckout instead.",
            Project.MSG_WARN);

        // Connect to the StarTeam server, and log on.
        Server s = getServer();

        try {
            // Search the items on this server.
            runServer(s);
        } finally {
            // Disconnect from the server.
            s.disconnect();
        }
        // after you are all of the properties are ok, do your thing
        // with StarTeam.  If there are any kind of exceptions then
        // send the message to the project log.
View Full Code Here


     *
     * @return A StarTeam server.
     */
    protected Server getServer() {
        // Simplest constructor, uses default encryption algorithm and compression level.
        Server s = new Server(getServerName(), getServerPort());

        // Optional; logOn() connects if necessary.
        s.connect();

        // Logon using specified user name and password.
        s.logOn(getUsername(), getPassword());

        return s;
    }
View Full Code Here

    public void execute() throws BuildException {
        log("DEPRECATED - The starteam task is deprecated.  Use stcheckout instead.",
            Project.MSG_WARN);

        // Connect to the StarTeam server, and log on.
        Server s = getServer();

        try {
            // Search the items on this server.
            runServer(s);
        } finally {
            // Disconnect from the server.
            s.disconnect();
        }
        // after you are all of the properties are ok, do your thing
        // with StarTeam.  If there are any kind of exceptions then
        // send the message to the project log.
View Full Code Here

     *
     * @return A StarTeam server.
     */
    protected Server getServer() {
        // Simplest constructor, uses default encryption algorithm and compression level.
        Server s = new Server(getServerName(), getServerPort());

        // Optional; logOn() connects if necessary.
        s.connect();

        // Logon using specified user name and password.
        s.logOn(getUsername(), getPassword());

        return s;
    }
View Full Code Here

    public void execute() throws BuildException {
        log("DEPRECATED - The starteam task is deprecated.  Use stcheckout instead.",
            Project.MSG_WARN);

        // Connect to the StarTeam server, and log on.
        Server s = getServer();

        try {
            // Search the items on this server.
            runServer(s);
        } finally {
            // Disconnect from the server.
            s.disconnect();
        }
        // after you are all of the properties are ok, do your thing
        // with StarTeam.  If there are any kind of exceptions then
        // send the message to the project log.
View Full Code Here

     *
     * @return A StarTeam server.
     */
    protected Server getServer() {
        // Simplest constructor, uses default encryption algorithm and compression level.
        Server s = new Server(getServerName(), getServerPort());

        // Optional; logOn() connects if necessary.
        s.connect();

        // Logon using specified user name and password.
        s.logOn(getUsername(), getPassword());

        return s;
    }
View Full Code Here

        // Store OLEDate equivalents of now and lastbuild for performance
        nowDate = new OLEDate(now.getTime());
        OLEDate lastBuildDate = new OLEDate(lastBuild.getTime());

        Server server = null;
        try {
            // Set up two view snapshots, one at lastbuild time, one now
            View view = StarTeamFinder.openView(userName + ":" + password + "@" + url);
            server = view.getServer();

            View snapshotAtNow = new View(view, ViewConfiguration.createFromTime(nowDate));
            View snapshotAtLastBuild =
                new View(view, ViewConfiguration.createFromTime(lastBuildDate));

            Map nowFiles = new HashMap();
            Map lastBuildFiles = new HashMap();

            Folder nowRoot = StarTeamFinder.findFolder(snapshotAtNow.getRootFolder(), folder);

            PropertyNames stPropertyNames = server.getPropertyNames();
            // properties to fetch immediately and cache
            final String[] propertiesToCache =
                new String[] {
                    stPropertyNames.FILE_CONTENT_REVISION,
                    stPropertyNames.MODIFIED_TIME,
                    stPropertyNames.FILE_FILE_TIME_AT_CHECKIN,
                    stPropertyNames.COMMENT,
                    stPropertyNames.MODIFIED_USER_ID,
                    stPropertyNames.FILE_NAME };

            if (preloadFileInformation) {
                // cache information for now
                nowRoot.populateNow(server.getTypeNames().FILE, propertiesToCache, -1);
            }

            // Visit all files in the snapshots and add to Maps
            addFolderModsToList(nowFiles, nowRoot);

            try {
                Folder lastBuildRoot =
                    StarTeamFinder.findFolder(snapshotAtLastBuild.getRootFolder(), folder);

                if (preloadFileInformation) {
                    // cache information for last build
                    lastBuildRoot.populateNow(server.getTypeNames().FILE, propertiesToCache, -1);
                }

                addFolderModsToList(lastBuildFiles, lastBuildRoot);
            } catch (ServerException se) {
                LOG.error("Server Exception occurred visiting last build view: ", se);
            }

            compareFileLists(nowFiles, lastBuildFiles);

            // Discard cached items so memory is not eaten up
            snapshotAtNow.getRootFolder().discardItems(server.getTypeNames().FILE, -1);

            try {
                snapshotAtLastBuild.getRootFolder().discardItems(server.getTypeNames().FILE, -1);
            } catch (ServerException se) {
                LOG.error("Server Exception occurred discarding last build file cache: ", se);
            }

            LOG.info(modifications.size() + " modifications in " + folder);
            return modifications;
        } catch (Exception e) {
            LOG.error("Problem looking up modifications in StarTeam.", e);
            modifications.clear();
            return modifications;
        } finally {
            if (server != null) {
                server.disconnect();
            }
        }
    }
View Full Code Here

        // Store OLEDate equivalents of now and lastbuild for performance
        nowDate = new OLEDate(now.getTime());
        OLEDate lastBuildDate = new OLEDate(lastBuild.getTime());

        Server server = null;
        try {
            // Set up two view snapshots, one at lastbuild time, one now
            View view = StarTeamFinder.openView(userName + ":" + password + "@" + url);
            server = view.getServer();

            View snapshotAtNow = new View(view, ViewConfiguration.createFromTime(nowDate));
            View snapshotAtLastBuild =
                new View(view, ViewConfiguration.createFromTime(lastBuildDate));

            Map nowFiles = new HashMap();
            Map lastBuildFiles = new HashMap();

            Folder nowRoot = StarTeamFinder.findFolder(snapshotAtNow.getRootFolder(), folder);

            PropertyNames stPropertyNames = server.getPropertyNames();
            // properties to fetch immediately and cache
            final String[] propertiesToCache =
                new String[] {
                    stPropertyNames.FILE_CONTENT_REVISION,
                    stPropertyNames.MODIFIED_TIME,
                    stPropertyNames.FILE_FILE_TIME_AT_CHECKIN,
                    stPropertyNames.COMMENT,
                    stPropertyNames.MODIFIED_USER_ID,
                    stPropertyNames.FILE_NAME };

            if (preloadFileInformation) {
                // cache information for now
                nowRoot.populateNow(server.getTypeNames().FILE, propertiesToCache, -1);
            }

            // Visit all files in the snapshots and add to Maps
            addFolderModsToList(nowFiles, nowRoot);

            try {
                Folder lastBuildRoot =
                    StarTeamFinder.findFolder(snapshotAtLastBuild.getRootFolder(), folder);

                if (preloadFileInformation) {
                    // cache information for last build
                    lastBuildRoot.populateNow(server.getTypeNames().FILE, propertiesToCache, -1);
                }

                addFolderModsToList(lastBuildFiles, lastBuildRoot);
            } catch (ServerException se) {
                LOG.error("Server Exception occurred visiting last build view: ", se);
            }

            compareFileLists(nowFiles, lastBuildFiles);

            // Discard cached items so memory is not eaten up
            snapshotAtNow.getRootFolder().discardItems(server.getTypeNames().FILE, -1);

            try {
                snapshotAtLastBuild.getRootFolder().discardItems(server.getTypeNames().FILE, -1);
            } catch (ServerException se) {
                LOG.error("Server Exception occurred discarding last build file cache: ", se);
            }

            LOG.info(modifications.size() + " modifications in " + folder);
            return modifications;
        } catch (Exception e) {
            LOG.error("Problem looking up modifications in StarTeam.", e);
            modifications.clear();
            return modifications;
        } finally {
            if (server != null) {
                server.disconnect();
            }
        }
    }
View Full Code Here

    public void execute() throws BuildException {
        log("DEPRECATED - The starteam task is deprecated.  Use stcheckout instead.",
            Project.MSG_WARN);

        // Connect to the StarTeam server, and log on.
        Server s = getServer();

        try {
            // Search the items on this server.
            runServer(s);
        } finally {
            // Disconnect from the server.
            s.disconnect();
        }
        // after you are all of the properties are ok, do your thing
        // with StarTeam.  If there are any kind of exceptions then
        // send the message to the project log.
View Full Code Here

     *
     * @return A StarTeam server.
     */
    protected Server getServer() {
        // Simplest constructor, uses default encryption algorithm and compression level.
        Server s = new Server(getServerName(), getServerPort());

        // Optional; logOn() connects if necessary.
        s.connect();

        // Logon using specified user name and password.
        s.logOn(getUsername(), getPassword());

        return s;
    }
View Full Code Here

TOP

Related Classes of com.starbase.starteam.Server

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.