private List<IFileSpec> haveList(List<IFileSpec> fileSpecs, String[] filter) throws ConnectionException, AccessException { List<IFileSpec> haveList = new ArrayList<IFileSpec>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { return haveList; } List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.HAVE, Server.getPreferredPathArray(filter, fileSpecs), null); if (resultMaps != null) { for (Map<String, Object> result : resultMaps) { haveList.add(handleFileReturn(result, serverImpl)); } } return haveList; }
private List<IFileSpec> haveList(List<IFileSpec> fileSpecs, String[] filter) throws ConnectionException, AccessException { List<IFileSpec> haveList = new ArrayList<IFileSpec>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { return haveList; } List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.HAVE, Server.getPreferredPathArray(filter, fileSpecs), null); if (resultMaps != null) { for (Map<String, Object> result : resultMaps) { haveList.add(handleFileReturn(result, serverImpl)); } } return haveList; }
/** * @see com.perforce.p4java.client.IClient#where(java.util.List) */ @Override public List<IFileSpec> where(List<IFileSpec> fileSpecs) throws ConnectionException, AccessException { List<IFileSpec> resultList = new ArrayList<IFileSpec>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { return resultList; } List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.WHERE, Server.getPreferredPathArray(null, fileSpecs), null); if (resultMaps != null) { for (Map<String, Object> result : resultMaps) { // p4ic4idea: enhanced exception handling resultList.add(handleFileReturn(result, serverImpl)); } } return resultList; }
/** * @see com.perforce.p4java.client.IClient#where(java.util.List) */ @Override public List<IFileSpec> where(List<IFileSpec> fileSpecs) throws ConnectionException, AccessException { List<IFileSpec> resultList = new ArrayList<IFileSpec>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { return resultList; } List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.WHERE, Server.getPreferredPathArray(null, fileSpecs), null); if (resultMaps != null) { for (Map<String, Object> result : resultMaps) { resultList.add(handleFileReturn(result, serverImpl)); } } return resultList; }
/** * @see com.perforce.p4java.client.IClient#sync(java.util.List, com.perforce.p4java.option.client.SyncOptions) */ @Override public List<IFileSpec> sync(List<IFileSpec> fileSpecs, SyncOptions syncOpts) throws P4JavaException { List<IFileSpec> specList = new ArrayList<IFileSpec>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException( "Attempted to sync a client that is not the server's current client"); } List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList(CmdSpec.SYNC, Parameters.processParameters( syncOpts, fileSpecs, this.server), null); if (resultMaps != null) { for (Map<String, Object> map : resultMaps) { specList.add(handleFileReturn(map, serverImpl)); } } return specList; }
/** * @see com.perforce.p4java.client.IClient#sync(java.util.List, com.perforce.p4java.option.client.SyncOptions) */ @Override public List<IFileSpec> sync(List<IFileSpec> fileSpecs, SyncOptions syncOpts) throws P4JavaException { List<IFileSpec> specList = new ArrayList<IFileSpec>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException( "Attempted to sync a client that is not the server's current client"); } List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList(CmdSpec.SYNC, Parameters.processParameters( syncOpts, fileSpecs, this.server), null); if (resultMaps != null) { for (Map<String, Object> map : resultMaps) { specList.add(handleFileReturn(map, serverImpl)); } } return specList; }
/** * @see com.perforce.p4java.client.IClient#sync(java.util.List, com.perforce.p4java.option.client.SyncOptions, com.perforce.p4java.server.callback.IStreamingCallback, int) */ @Override public void sync(List<IFileSpec> fileSpecs, SyncOptions syncOpts, IStreamingCallback callback, int key) throws P4JavaException { if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException( "Attempted to sync a client that is not the server's current client"); } this.serverImpl.execStreamingMapCommand(CmdSpec.SYNC.toString(), Parameters.processParameters( syncOpts, fileSpecs, this.server), null, callback, key); }
/** * @see com.perforce.p4java.client.IClient#sync(java.util.List, com.perforce.p4java.option.client.SyncOptions, com.perforce.p4java.server.callback.IStreamingCallback, int) */ @Override public void sync(List<IFileSpec> fileSpecs, SyncOptions syncOpts, IStreamingCallback callback, int key) throws P4JavaException { if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException( "Attempted to sync a client that is not the server's current client"); } this.serverImpl.execStreamingMapCommand(CmdSpec.SYNC.toString(), Parameters.processParameters( syncOpts, fileSpecs, this.server), null, callback, key); }
/** * @see com.perforce.p4java.client.IClient#sync(java.util.List, com.perforce.p4java.option.client.SyncOptions, com.perforce.p4java.server.callback.IStreamingCallback, int) */ @Override public void syncParallel(List<IFileSpec> fileSpecs, SyncOptions syncOpts, IStreamingCallback callback, int key, ParallelSyncOptions pSyncOpts) throws P4JavaException { if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException( "Attempted to sync a client that is not the server's current client"); } String[] syncOptions = ClientHelper.buildParallelOptions(serverImpl, fileSpecs, syncOpts, pSyncOpts); this.serverImpl.execStreamingMapCommand(CmdSpec.SYNC.toString(), syncOptions, null, callback, key, pSyncOpts.getCallback()); }
/** * @see com.perforce.p4java.client.IClient#sync(java.util.List, com.perforce.p4java.option.client.SyncOptions, com.perforce.p4java.server.callback.IStreamingCallback, int) */ @Override public void syncParallel(List<IFileSpec> fileSpecs, SyncOptions syncOpts, IStreamingCallback callback, int key, ParallelSyncOptions pSyncOpts) throws P4JavaException { if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException( "Attempted to sync a client that is not the server's current client"); } String[] syncOptions = ClientHelper.buildParallelOptions(serverImpl, fileSpecs, syncOpts, pSyncOpts); this.serverImpl.execStreamingMapCommand(CmdSpec.SYNC.toString(), syncOptions, null, callback, key, pSyncOpts.getCallback()); }
/** * @see com.perforce.p4java.client.IClient#syncParallel(List, SyncOptions, ParallelSyncOptions) */ @Override public List<IFileSpec> syncParallel(List<IFileSpec> fileSpecs, SyncOptions syncOpts, ParallelSyncOptions pSyncOpts) throws P4JavaException { List<IFileSpec> specList = new ArrayList<IFileSpec>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException( "Attempted to sync a client that is not the server's current client"); } String[] syncOptions = ClientHelper.buildParallelOptions(serverImpl, fileSpecs, syncOpts, pSyncOpts); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList(CmdSpec.SYNC.toString(), syncOptions, null, pSyncOpts.getCallback()); if (resultMaps != null) { for (Map<String, Object> map : resultMaps) { specList.add(handleFileReturn(map, serverImpl)); } } return specList; }
/** * @see com.perforce.p4java.client.IClient#syncParallel(List, SyncOptions, ParallelSyncOptions) */ @Override public List<IFileSpec> syncParallel(List<IFileSpec> fileSpecs, SyncOptions syncOpts, ParallelSyncOptions pSyncOpts) throws P4JavaException { List<IFileSpec> specList = new ArrayList<IFileSpec>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException( "Attempted to sync a client that is not the server's current client"); } String[] syncOptions = ClientHelper.buildParallelOptions(serverImpl, fileSpecs, syncOpts, pSyncOpts); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList(CmdSpec.SYNC.toString(), syncOptions, null, pSyncOpts.getCallback()); if (resultMaps != null) { for (Map<String, Object> map : resultMaps) { specList.add(handleFileReturn(map, serverImpl)); } } return specList; }
/** * @see com.perforce.p4java.client.IClient#shelveFiles(java.util.List, int, com.perforce.p4java.option.client.ShelveFilesOptions) */ @Override public List<IFileSpec> shelveFiles(List<IFileSpec> fileSpecs, int changelistId, ShelveFilesOptions opts) throws P4JavaException { List<IFileSpec> resultList = new ArrayList<IFileSpec>(); String changelistString = null; if (changelistId == IChangelist.DEFAULT) { changelistString = "-cdefault"; } else if (changelistId > 0) { changelistString = "-c" + changelistId; } // Set the server's current client to this client IClient currentClient = this.serverImpl.getCurrentClient(); this.serverImpl.setCurrentClient(this); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.SHELVE, Parameters.processParameters( opts, fileSpecs, changelistString, serverImpl), null); if (resultMaps != null) { for (Map<String, Object> result : resultMaps) { resultList.add(handleFileReturn(result, serverImpl)); } } // Set the server's current client back to the previous one this.serverImpl.setCurrentClient(currentClient); return resultList; }
/** * @see com.perforce.p4java.client.IClient#shelveFiles(java.util.List, int, com.perforce.p4java.option.client.ShelveFilesOptions) */ @Override public List<IFileSpec> shelveFiles(List<IFileSpec> fileSpecs, int changelistId, ShelveFilesOptions opts) throws P4JavaException { List<IFileSpec> resultList = new ArrayList<IFileSpec>(); String changelistString = null; if (changelistId == IChangelist.DEFAULT) { changelistString = "-cdefault"; } else if (changelistId > 0) { changelistString = "-c" + changelistId; } // Set the server's current client to this client IClient currentClient = this.serverImpl.getCurrentClient(); this.serverImpl.setCurrentClient(this); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.SHELVE, Parameters.processParameters( opts, fileSpecs, changelistString, serverImpl), null); if (resultMaps != null) { for (Map<String, Object> result : resultMaps) { resultList.add(handleFileReturn(result, serverImpl)); } } // Set the server's current client back to the previous one this.serverImpl.setCurrentClient(currentClient); return resultList; }
/** * @see com.perforce.p4java.client.IClient#shelveChangelist(com.perforce.p4java.core.IChangelist) */ @Override public List<IFileSpec> shelveChangelist(IChangelist list) throws ConnectionException, // p4ic4idea: remove exceptions not explicitly thrown. AccessException { if (list == null) { throw new NullPointerError("Null changelist specification in shelveChangelist method call"); } // Set the server's current client to this client IClient currentClient = this.serverImpl.getCurrentClient(); this.serverImpl.setCurrentClient(this); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList(CmdSpec.SHELVE, new String[]{"-i"}, InputMapper.map(list, true)); List<IFileSpec> resultList = new ArrayList<IFileSpec>(); if (resultMaps != null) { for (Map<String, Object> result : resultMaps) { // p4ic4idea: condense error handling logic resultList.add(handleFileReturn(result, serverImpl)); } } // Set the server's current client back to the previous one this.serverImpl.setCurrentClient(currentClient); return resultList; }
/** * @see com.perforce.p4java.client.IClient#shelveChangelist(com.perforce.p4java.core.IChangelist) */ @Override public List<IFileSpec> shelveChangelist(IChangelist list) throws ConnectionException, RequestException, AccessException { if (list == null) { throw new NullPointerError("Null changelist specification in shelveChangelist method call"); } // Set the server's current client to this client IClient currentClient = this.serverImpl.getCurrentClient(); this.serverImpl.setCurrentClient(this); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList(CmdSpec.SHELVE, new String[]{"-i"}, InputMapper.map(list, true)); List<IFileSpec> resultList = new ArrayList<IFileSpec>(); if (resultMaps != null) { for (Map<String, Object> result : resultMaps) { resultList.add(handleFileReturn(result, serverImpl)); } } // Set the server's current client back to the previous one this.serverImpl.setCurrentClient(currentClient); return resultList; }
/** * @see com.perforce.p4java.client.IClient#integrateFiles(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, java.lang.String, com.perforce.p4java.option.client.IntegrateFilesOptions) */ @Override public List<IFileSpec> integrateFiles(IFileSpec fromFile, IFileSpec toFile, String branchSpec, IntegrateFilesOptions opts) throws P4JavaException { // Set the server's current client to this client IClient currentClient = this.serverImpl.getCurrentClient(); this.serverImpl.setCurrentClient(this); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.INTEG, Parameters.processParameters( opts, fromFile, toFile, branchSpec, this.serverImpl), null); // Set the server's current client back to the previous one this.serverImpl.setCurrentClient(currentClient); return getIntegrationFilesFromReturn(resultMaps); }
/** * @see com.perforce.p4java.client.IClient#integrateFiles(com.perforce.p4java.core.file.IFileSpec, java.util.List, com.perforce.p4java.option.client.IntegrateFilesOptions) */ @Override public List<IFileSpec> integrateFiles(IFileSpec fromFile, List<IFileSpec> toFiles, IntegrateFilesOptions opts) throws P4JavaException { // Set the server's current client to this client IClient currentClient = this.serverImpl.getCurrentClient(); this.serverImpl.setCurrentClient(this); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.INTEG, Parameters.processParameters( opts, fromFile, toFiles, null, this.serverImpl), null); // Set the server's current client back to the previous one this.serverImpl.setCurrentClient(currentClient); return getIntegrationFilesFromReturn(resultMaps); }
/** * @see com.perforce.p4java.client.IClient#integrateFiles(com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec, java.lang.String, com.perforce.p4java.option.client.IntegrateFilesOptions) */ @Override public List<IFileSpec> integrateFiles(IFileSpec fromFile, IFileSpec toFile, String branchSpec, IntegrateFilesOptions opts) throws P4JavaException { // Set the server's current client to this client IClient currentClient = this.serverImpl.getCurrentClient(); this.serverImpl.setCurrentClient(this); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.INTEG, Parameters.processParameters( opts, fromFile, toFile, branchSpec, this.serverImpl), null); // Set the server's current client back to the previous one this.serverImpl.setCurrentClient(currentClient); return getIntegrationFilesFromReturn(resultMaps); }
/** * @see com.perforce.p4java.client.IClient#integrateFiles(com.perforce.p4java.core.file.IFileSpec, java.util.List, com.perforce.p4java.option.client.IntegrateFilesOptions) */ @Override public List<IFileSpec> integrateFiles(IFileSpec fromFile, List<IFileSpec> toFiles, IntegrateFilesOptions opts) throws P4JavaException { // Set the server's current client to this client IClient currentClient = this.serverImpl.getCurrentClient(); this.serverImpl.setCurrentClient(this); List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.INTEG, Parameters.processParameters( opts, fromFile, toFiles, null, this.serverImpl), null); // Set the server's current client back to the previous one this.serverImpl.setCurrentClient(currentClient); return getIntegrationFilesFromReturn(resultMaps); }