@Override public List<Map<String, Object>> login2(Login2Options opts, String user) throws P4JavaException { String[] params; if (user == null || user.isEmpty()) { params = processParameters(opts, server); } else { params = processParameters(opts, null, user, server); } List<Map<String, Object>> resultMaps = execMapCmdList(LOGIN2, params, null); return resultMaps; }
@Override public InputStream getBlobObject(String repo, String sha) throws P4JavaException { InputStream inputStream = execStreamCmd( GRAPH, Parameters.processParameters( null, null, new String[]{"cat-file", "-n", repo, "blob", sha}, server) ); return inputStream; }
@Override public InputStream getChangelistDiffs(final int changelistId, final GetChangelistDiffsOptions opts) throws P4JavaException { return execStreamCmd(DESCRIBE, processParameters(opts, null, String.valueOf(changelistId), server)); }
@Override public List<IChangelist> getInterchanges(final IFileSpec fromFile, final IFileSpec toFile, final GetInterchangesOptions opts) throws P4JavaException { List<IFileSpec> files = new ArrayList<>(); files.add(fromFile); files.add(toFile); List<Map<String, Object>> resultMaps = execMapCmdList(INTERCHANGES, processParameters(opts, files, server), null); return processInterchangeMaps(resultMaps, InterchangesDelegatorHidden.isListIndividualFilesThatRequireIntegration(opts)); }
@Override public String deleteStream( @Nonnull final String streamPath, final StreamOptions opts) throws P4JavaException { Validate.notBlank(streamPath, "Stream name shouldn't null or empty."); List<Map<String, Object>> resultMaps = execMapCmdList( STREAM, processParameters(opts, null, new String[]{"-d", streamPath}, server), null); return parseCommandResultMapIfIsInfoMessageAsString(resultMaps); } }
@Override public String deleteLabel(final String labelName, final DeleteLabelOptions opts) throws P4JavaException { Validate.notBlank(labelName, "Label name shouldn't null or empty."); List<Map<String, Object>> resultMaps = execMapCmdList( LABEL, processParameters(opts, null, new String[]{"-d", labelName}, server), null); return parseCommandResultMapIfIsInfoMessageAsString(resultMaps); } }
@Override public String updateUserGroup(@Nonnull final IUserGroup group, @Nullable final UpdateUserGroupOptions opts) throws P4JavaException { Validate.notNull(group); List<Map<String, Object>> resultMaps = execMapCmdList(GROUP, Parameters.processParameters(opts, null, "-i", server), InputMapper.map(group)); return ResultMapParser.parseCommandResultMapAsString(resultMaps); }
@Override public List<IChangelist> getInterchanges(final IFileSpec fromFile, final IFileSpec toFile, final GetInterchangesOptions opts) throws P4JavaException { List<IFileSpec> files = new ArrayList<>(); files.add(fromFile); files.add(toFile); List<Map<String, Object>> resultMaps = execMapCmdList(INTERCHANGES, processParameters(opts, files, server), null); return processInterchangeMaps(resultMaps, InterchangesDelegatorHidden.isListIndividualFilesThatRequireIntegration(opts)); }
/** * @see com.perforce.p4java.client.IClient#resolvedFiles(java.util.List, com.perforce.p4java.option.client.ResolvedFilesOptions) */ @Override public List<IFileSpec> resolvedFiles(List<IFileSpec> fileSpecs, ResolvedFilesOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.RESOLVED, Parameters.processParameters(opts, fileSpecs, serverImpl), null); return getIntegrationFilesFromReturn(resultMaps); }
@Override public String deleteUserGroup(@Nonnull IUserGroup group, @Nullable UpdateUserGroupOptions opts) throws P4JavaException { Validate.notNull(group); Validate.notBlank(group.getName(), "Group name shouldn't a null or empty."); List<Map<String, Object>> resultMaps = execMapCmdList(GROUP, Parameters .processParameters(opts, null, new String[] { "-d", group.getName() }, server), null); return ResultMapParser.parseCommandResultMapAsString(resultMaps); }
@Override public Map<String, String> getKeys(final GetKeysOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList( KEYS, processParameters(opts, server), null); return parseKeysCommandResultMaps(resultMaps); }
@Override public List<IExtendedFileSpec> getExtendedFiles(final List<IFileSpec> fileSpecs, final GetExtendedFilesOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList(FSTAT, processParameters(opts, fileSpecs, server), null); return ResultListBuilder.buildNonNullExtendedFileSpecListFromCommandResultMaps(resultMaps, server); } }
@Override public String reload(final ReloadOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList( RELOAD, processParameters(opts, server), null); return parseCommandResultMapAsString(resultMaps); } }
@Override public String updateStream( @Nonnull final IStream stream, final StreamOptions opts) throws P4JavaException { Validate.notNull(stream); List<Map<String, Object>> resultMaps = execMapCmdList( STREAM, processParameters(opts, null, "-i", server), InputMapper.map(stream)); return parseCommandResultMapIfIsInfoMessageAsString(resultMaps); }
@Override public String unload(final UnloadOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList( UNLOAD, processParameters(opts, server), null); return parseCommandResultMapAsString(resultMaps); } }
@Override public List<IExtendedFileSpec> verifyFiles( final List<IFileSpec> fileSpecs, final VerifyFilesOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList( VERIFY, processParameters(opts, fileSpecs, server), null); return buildNonNullExtendedFileSpecListFromCommandResultMaps(resultMaps, server); } }
/** * @see com.perforce.p4java.client.IClient#resolvedFiles(java.util.List, com.perforce.p4java.option.client.ResolvedFilesOptions) */ @Override public List<IFileSpec> resolvedFiles(List<IFileSpec> fileSpecs, ResolvedFilesOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = this.serverImpl.execMapCmdList( CmdSpec.RESOLVED, Parameters.processParameters(opts, fileSpecs, serverImpl), null); return getIntegrationFilesFromReturn(resultMaps); }
@Override public List<IExtendedFileSpec> getExtendedFiles(final List<IFileSpec> fileSpecs, final GetExtendedFilesOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList(FSTAT, processParameters(opts, fileSpecs, server), null); return ResultListBuilder.buildNonNullExtendedFileSpecListFromCommandResultMaps(resultMaps, server); } }
@Override public String updateUser(@Nonnull final IUser user, final UpdateUserOptions opts) throws P4JavaException { Validate.notNull(user); Validate.notBlank(user.getLoginName()); List<Map<String, Object>> resultMaps = execMapCmdList( USER, processParameters(opts, null, "-i", server), InputMapper.map(user)); return parseCommandResultMapAsString(resultMaps); }
@Override public Map<String, String> getCounters(final CounterOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList( COUNTERS, processParameters(opts, server), null); return parseCounterCommandResultMaps( resultMaps, rethrowFunction(uncheckExceptionFunction) ); }